VR-Forces 4.1.1 Class Documentation
DtRangeRingsOptionsWidget.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2011 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <vrvUtil/signalslib.h>
15 
16 #include <QtGui/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 QComboBox;
26 class QLabel;
27 class QSpinBox;
28 class QFrame;
29 
31 //
33 
34 namespace makVrv
35 {
36  class DtDe;
37  class DtPersistenceControlsInterface;
38 }
39 
40 namespace makVrf
41 {
42  class DtRangeRingsOptionsWidget;
43  class DtRangeRingEntry;
44 
46  {
47  public:
51 
54 
55  protected: //Receive boost signals from interface class
56  virtual void on_colorChanged(int type, QColor color, const QString& label);
57  virtual void on_addInstance(int type, int color, const QString& label);
58  virtual void on_toggleRangeSphere(bool onOff);
59  virtual void on_toggleWeaponNameLabel( bool onOff );
60  virtual void on_toggleEntityNameLabel( bool onOff );
61  virtual void on_toggleRangeValueLabel( bool onOff );
62 
63 
64  protected:
65  virtual void setupFromOptions(const DtRangeRingsSettingsRecord&);
66 
68  virtual void on_import();
69  virtual void on_export();
70  virtual void on_defaultsRestored();
71  virtual void on_importFilePathChosen(const std::string& filePath);
72  virtual void on_exportFilePathChosen(const std::string& filePath);
73 
74  protected:
79  };
80 
82  {
83  Q_OBJECT
84 
85  public:
86 
88  DtRangeRingsOptionsWidget(makVrv::DtDe& de, QWidget* parent = NULL, const Qt::WindowFlags& flags = 0 );
89 
91  virtual ~DtRangeRingsOptionsWidget();
92 
93  virtual QString getLabelFromType(int type);
94 
95  //Accessors & mutators for dialog elements
96 
97  virtual void clearRangeRingTypes();
98  virtual void addRangeRingType(int type, const DtRangeRingsSettingsRecord::ColorOption&);
99 
100  virtual bool showRangeSphere();
101  virtual void setShowRangeSphere( bool onOff );
102 
103  virtual bool showWeaponNameLabel();
104  virtual void setShowWeaponNameLabel( bool onOff );
105 
106  virtual bool showEntityNameLabel();
107  virtual void setShowEntityNameLabel( bool onOff );
108 
109  virtual bool showRangeValueLabel();
110  virtual void setShowRangeValueLabel( bool onOff );
111 
112  protected:
113 
114  void setupGui();
115 
116  public slots: //Qt slots used as intermediaries between Qt signals and Boost signal classes
117 
118  virtual void on_colorChanged();
119  virtual void on_toggleRangeSphere(bool onOff);
120  virtual void on_toggleWeaponNameLabel( bool onOff );
121  virtual void on_toggleEntityNameLabel( bool onOff );
122  virtual void on_toggleRangeValueLabel( bool onOff );
123 
124  //Used to re-emit QT signals up to logic class
125  public:
126  boost::signal<void (int, QColor, QString)> signal_colorChanged;
127  boost::signal<void (bool)> signal_toggleRangeSphere;
128  boost::signal<void (bool)> signal_toggleWeaponNameLabel;
129  boost::signal<void (bool)> signal_toggleEntityNameLabel;
130  boost::signal<void (bool)> signal_toggleRangeValueLabel;
131 
132  private:
135 
138 
143 
144  QListWidget* myRangeRingTypesList;
145 
147  };
148 
151 
153  {
154  Q_OBJECT
155 
156  public:
157 
159  DtRangeRingEntry(QString label, int ringType , const DtRangeRingsSettingsRecord::ColorOption& rangeRingInfo );
160 
162  virtual ~DtRangeRingEntry();
163 
164  public: //Accessors
165 
166  virtual QColor ringColor();
167  virtual bool useForceColor();
168  virtual double ringAlphaF();
169  virtual int rangeRingType();
170  virtual QString ringLabel();
171 
172  signals:
173  //Signals on changes to RGB value, Alpha or toggling Use Force Color
174  void signalColorChanged();
175 
176  protected:
177 
178  void setupGui(QString ringTypeLabel, QColor colorFromRecord );
179  void setButtonColor();
180 
181  public slots: //Qt slots
182 
183  //creates a color choosing dialog and populates myUserDefinedRgb with it
184  virtual void chooseColor();
185  //updates widget coloring and triggers signal
186  virtual void slotColorChanged();
187 
188  protected:
189 
192 
193  QHBoxLayout* mainLayout;
197  QSpinBox* alphaSpinBox;
199  QString myEntryLabel;
200  };
201 
202 };

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)