VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rangeRingsOptionsWidget.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <vrvUtil/signalslib.h>
15 
16 #include <QtWidgets/QWidget>
17 
18 class QVBoxLayout;
19 class QCheckBox;
20 class QListWidget;
21 class QGroupBox;
22 class QHBoxLayout;
23 class QPushButton;
24 class QListWidgetItem;
25 class QGridLayout;
26 class QScrollArea;
27 class QComboBox;
28 class QLabel;
29 class QSpinBox;
30 class QFrame;
31 
35 
36 namespace makVrv
37 {
38  class DtDe;
39  class DtPersistenceControlsInterface;
40 }
41 
42 namespace makVrf
43 {
44  class DtRangeRingsOptionsWidget;
45  class DtRangeRingEntry;
46 
48  {
49  public:
53 
56 
57  protected: //Receive boost signals from interface class
58  virtual void on_colorChanged(const std::string& type, QColor color, const QString& label);
59  virtual void on_visibilityChanged(const std::string& type, bool);
60  virtual void on_addInstance(const std::string& type, int color, const QString& label);
61  virtual void on_toggleRangeSphere(bool onOff);
62  virtual void on_toggleWeaponNameLabel( bool onOff );
63  virtual void on_toggleEntityNameLabel( bool onOff );
64  virtual void on_toggleRangeValueLabel( bool onOff );
65  virtual void on_toggleDisplayByDefault( bool onOff );
66  virtual void on_toggleDisplayForSelected( bool onOff );
67  virtual void on_toggleDisplayPhysicalFootprint( bool onOff );
68  virtual void on_colorOptionAdded(std::string);
69  virtual void on_colorOptionRequested(std::string);
70  virtual void on_changeSphereOpacityModifier(double);
71 
72  protected:
73  virtual void setupFromOptions(const DtRangeRingsSettingsRecord&);
74 
76  virtual void on_import();
77  virtual void on_export();
78  virtual void on_defaultsRestored();
79  virtual void on_importFilePathChosen(const std::string& filePath);
80  virtual void on_exportFilePathChosen(const std::string& filePath);
81 
82  virtual void tick();
83 
84  protected:
89  };
90 
92  {
93  Q_OBJECT
94 
95  public:
96 
98  DtRangeRingsOptionsWidget(makVrv::DtDe& de, QWidget* parent = NULL, const Qt::WindowFlags& flags = 0 );
99 
101  virtual ~DtRangeRingsOptionsWidget();
102 
103  virtual QString getLabelFromType(const std::string& type);
104 
105  //Accessors & mutators for dialog elements
106 
107  virtual void clearRangeRingTypes();
108  virtual void addRangeRingType(const std::string& type, const DtRangeRingsSettingsRecord::ColorOption&);
109  virtual void colorOptionRequested(const std::string&);
110 
111  virtual bool showRangeSphere();
112  virtual void setShowRangeSphere( bool onOff );
113 
114  virtual void setSphereOpacityModifier(double);
115  virtual double sphereOpacityModifier() const;
116 
117  virtual bool showWeaponNameLabel();
118  virtual void setShowWeaponNameLabel( bool onOff );
119 
120  virtual bool showEntityNameLabel();
121  virtual void setShowEntityNameLabel( bool onOff );
122 
123  virtual bool showRangeValueLabel();
124  virtual void setShowRangeValueLabel( bool onOff );
125 
126  virtual bool displayByDefault();
127  virtual void setDisplayByDefault( bool onOff );
128 
129  virtual bool displayForSelected();
130  virtual void setDisplayForSelected( bool onOff );
131 
132  virtual bool displayPhysicalFootprint();
133  virtual void setDisplayPhysicalFootprint( bool onOff );
134 
135  protected:
136 
137  void setupGui();
138 
139  public slots: //Qt slots used as intermediaries between Qt signals and Boost signal classes
140 
141  virtual void on_colorChanged();
142  virtual void on_visibilityChanged(bool onOff);
143  virtual void on_toggleRangeSphere(bool onOff);
144  virtual void on_toggleWeaponNameLabel( bool onOff );
145  virtual void on_toggleEntityNameLabel( bool onOff );
146  virtual void on_toggleRangeValueLabel( bool onOff );
147 
148  virtual void on_toggleDisplayByDefault( bool onOff );
149  virtual void on_toggleDisplayForSelected( bool onOff );
150  virtual void on_toggleDisplayPhysicalFootprint( bool onOff );
151  virtual void sphereOpacityChanged();
152 
153  //Used to re-emit QT signals up to logic class
154  public:
155  boost::signal<void (std::string, QColor, QString)> signal_colorChanged;
156  boost::signal<void (std::string, bool)> signal_visibilityChanged;
157  boost::signal<void (bool)> signal_toggleRangeSphere;
158  boost::signal<void (bool)> signal_toggleWeaponNameLabel;
159  boost::signal<void (bool)> signal_toggleEntityNameLabel;
160  boost::signal<void (bool)> signal_toggleRangeValueLabel;
161  boost::signal<void (bool)> signal_toggleDisplayByDefaultValue;
162  boost::signal<void (bool)> signal_toggleDisplayForSelectedValue;
163  boost::signal<void (bool)> signal_toggleDisplayPhysicalFootprintValue;
164  boost::signal<void (double)> signal_sphereOpacityModifierChanged;
165 
166  private:
169 
172 
173  public:
182  QScrollArea* myScrollView;
184  QVBoxLayout* myMainLayout;
185  QHBoxLayout* my3DLayout;
187 
188  protected:
190 
191  typedef std::map<std::string, DtRangeRingEntry*> RangeRingEntries;
193  };
194 
197 
199  {
200  Q_OBJECT
201 
202  public:
203 
205  DtRangeRingEntry(QString label, const std::string& ringType , const DtRangeRingsSettingsRecord::ColorOption& rangeRingInfo,
206  QWidget* parent);
207 
209  virtual ~DtRangeRingEntry();
210 
211  public: //Accessors
212 
213  virtual QColor ringColor() const;
214  virtual bool useForceColor() const;
215  virtual double ringAlphaF() const;
216  virtual const std::string& rangeRingType() const;
217  virtual QString ringLabel() const;
218  virtual void setVisible(bool);
219 
220  signals:
221  //Signals on changes to RGB value, Alpha or toggling Use Force Color
222  void signalColorChanged();
223  void signalVisibilityChanged(bool);
224 
225  protected:
226 
227  void setupGui(QColor colorFromRecord, bool visible);
228  void setButtonColor();
229 
230  public slots: //Qt slots
231 
232  //creates a color choosing dialog and populates myUserDefinedRgb with it
233  virtual void chooseColor();
234  //updates widget coloring and triggers signal
235  virtual void slotColorChanged();
236  virtual void visibilityChanged();
237 
238  protected:
239 
240  std::string myRangeRingType;
242 
243  public:
245  QHBoxLayout* myColorLayout;
250  QString myEntryLabel;
251  };
252 
253 };

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)