VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
setStatePropertiesDialog.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #if !defined(Q_MOC_RUN)
18 #endif
19 
20 #include <QtWidgets/QCheckBox>
21 #include <QtWidgets/QScrollArea>
22 #include <QtWidgets/QSlider>
23 
24 class QLabel;
25 class QVBoxLayout;
26 class QGridLayout;
27 class QWidget;
28 class QComboBox;
29 class QLineEdit;
31 class QValidator;
32 class DtReaderWriter;
33 class QToolButton;
35 
36 namespace makVrf
37 {
40  {
41  Q_OBJECT
42 
43  public:
44  DtPropertySlider(QWidget* p);
45  virtual ~DtPropertySlider() override;
46 
48  virtual double percent() const;
49 
51  virtual void setPercent(double);
52 
53  virtual void setValue(double);
54  virtual double value() const;
55 
56  virtual void setRange(double lower, double upper);
57 
58  virtual void setValuesArePercentages(bool);
59 
60  protected slots:
61  virtual void sliderChanged();
62  virtual void textChanged();
63 
64  signals:
65  void percentChanged();
66 
67  public:
68  QSlider* slider;
70 
71  protected:
73  };
74 
78  {
79  Q_OBJECT
80 
81  public:
82  //CTOR
83  DtSetStatePropertiesDialog(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0);
84 
85  //DTOR
86  virtual ~DtSetStatePropertiesDialog() override;
87 
92  virtual void addProperty(const DtPropertyInterface*, bool merge = false, bool hasStar = false);
93 
95  virtual void setupGui(const std::set<makVrv::DtUniqueID>& data) override;
96 
97  virtual void setDefaultPlatformFile(const DtString&);
99  {
100  return myDefaultPlatformFile;
101  }
102 
103  protected:
104  virtual QWidget* contents(const std::set<makVrv::DtUniqueID>& data) override;
105 
106  virtual void setupFrom(const std::set<makVrv::DtUniqueID>& s) override;
107 
108  virtual void sendRequest() override;
109 
110  struct PropertyItem;
111 
113  typedef std::map<DtString, PropertyItem> PropertyItems;
114 
115  virtual void cleanupPropertyItem(PropertyItem&) const;
116 
117  virtual void clearProperties();
118 
120  virtual void markAsReadOnly(PropertyItem&);
121 
125  virtual bool addPropertyItemForDataEntry(PropertyItem&, const DtReaderWriter*, const DtString& pathSoFar, int level,
126  bool updateExistingValue = false, bool recurse = true);
127 
129  virtual int addPropertyItemToDataSheet(PropertyItem&, const DtReaderWriter*, const DtString& pathSoFar, int level);
130 
131  virtual void itemHasBeenUpdated(PropertyItem&, bool);
132 
133  virtual bool hasMoreThanDefaultValueInRegistry(const DtReaderWriter* rw) const;
134 
135  protected slots:
137  virtual void modifyStateProperty();
138  virtual void updateOkButton();
139  virtual void revertValue();
140  virtual void checkBoxChanged();
141 
142  protected:
143  virtual void checkBoxChanged(QCheckBox*);
144  virtual bool wantsSpacer() const;
145  virtual void setupStatement(const DtSimStatement*) override;
146  virtual DtRwProperties modifiedProperties() const;
147  virtual bool modifiedProperties(const PropertyItem&, DtReaderWriter* rw, bool parentItList = false) const;
148  virtual void setupStateProperties(DtSetStateProperties* col);
149 
150  virtual const DtReaderWriter* baseValueFor(const DtString& pathSoFar) const;
151 
153  virtual bool hasValue(const DtRwProperties& props, const DtString& val) const;
154 
156  virtual void extract(std::vector<DtReaderWriter*>& allCounts, const DtString& extractionType, DtReaderWriter* curItem,
157  const DtString& pathSoFar) const;
158 
160  virtual void extractItemsFor(DtReaderWriter*, const DtString& extractionType,
161  const DtString& title, DtRwProperties* container) const;
162 
163  virtual void addDataEntryIfModifiableValue(PropertyItem& item, const DtReaderWriter* rw, const DtString& pathSoFar,
164  int level, bool updateExistingValue, int row);
165 
167  virtual void valueFromWidget(const PropertyItem& item, DtReaderWriter* rw) const;
168 
170  virtual DtString properties() const;
171 
175  virtual bool replace() const;
176 
178  virtual DtString translationModule() const;
179 
181  virtual bool valuesArePercentages(const std::set<makVrv::DtUniqueID>& data) const;
182 
185  virtual bool sendValuesAsPercentages() const;
186 
188  virtual bool isValid() const;
189 
190  virtual void checkHasNoItems();
191  virtual bool updateProperty(QObject*, PropertyItems&);
192  virtual bool revertValue(QObject*, PropertyItems&);
193  virtual void revertValue(PropertyItem&);
194  virtual void propertiesUpdated(PropertyItem&);
195  virtual void hideIfOnlyOneCheckBox();
196  virtual void showEvent(QShowEvent*) override;
197 
198  public:
199  QWidget* myCanvas = nullptr;
200  QVBoxLayout* myMainLayout = nullptr;
201  QScrollArea* myScrollArea = nullptr;
202  QWidget* myScrollAreaCanvas = nullptr;
203  QGridLayout* myGridLayout = nullptr;
204  QLabel* myNoItems = nullptr;
205 
206  protected:
211 
213  {
214  PropertyItem() : labelLayout(0), label(0), validator(0), modified(false), alwaysUpdate(false), revertButton(0), properties(0), added(false), initiallyChecked(true), checkBox(nullptr) { widgets.widget = 0; };
215  PropertyItem(const PropertyItem& orig) : label(orig.label), validator(orig.validator), alwaysUpdate(orig.alwaysUpdate),
216  labelLayout(orig.labelLayout), modified(orig.modified), properties(orig.properties), revertButton(orig.revertButton), initiallyChecked(orig.initiallyChecked),
217  children(orig.children), added(orig.added), checkBox(orig.checkBox) { widgets.widget = orig.widgets.widget; };
218 
219  QHBoxLayout* labelLayout;
223 
224  union Widgets
225  {
226  QWidget* widget;
230  };
231 
234  bool modified;
238  bool added;
240  };
241 
244 
247 
251 
255 
258  std::map<DtString, std::set<DtString> > myIgnorePropertyMapColumns;
259  };
260 }
QLineEdit * lineEdit
Definition: setStatePropertiesDialog.h:227
const DtString & defaultPlatformFile() const
Definition: setStatePropertiesDialog.h:98
QValidator * validator
Definition: setStatePropertiesDialog.h:222
bool myValuesArePercentages
Definition: setStatePropertiesDialog.h:245
File: setStateProperties.h.
Definition: setStateProperties.h:40
DtString myProperty
Definition: setStatePropertiesDialog.h:243
Definition: baseTaskSetDialogInterface.h:35
QSlider * slider
Definition: setStatePropertiesDialog.h:68
Widgets widgets
Definition: setStatePropertiesDialog.h:232
SpecificRwType * addProperty(DtReaderWriter &properties, const DtString &propertyName)
Adds a property with the specified name to the given set of properties. SpecificRwType must be a subc...
bool myValuesAreRanged
Set this value to true in the class constructor to show a slider to set the values bounded by the ran...
Definition: setStatePropertiesDialog.h:250
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
QLabel * label
Definition: setStatePropertiesDialog.h:221
Definition: readerWriter.h:85
PropertyItem()
Definition: setStatePropertiesDialog.h:214
Definition: setStatePropertiesDialog.h:212
DtString myDefaultPlatformFile
If specified, and there is no data because the item that wants to be set does not exist...
Definition: setStatePropertiesDialog.h:209
DtRwProperties myStateProperties
Definition: setStatePropertiesDialog.h:253
Interface class used to define minimal interface for a property. The DtPropertyInterface class provid...
Definition: propertyInterface.h:53
bool myCreatePropertySlider
Definition: setStatePropertiesDialog.h:246
A slider that can be used for property values to set percentages on them when values are entered as p...
Definition: setStatePropertiesDialog.h:39
Definition: setStatePropertiesDialog.h:224
bool myUsingGeneric
Definition: setStatePropertiesDialog.h:210
Contains makVrf::DtBaseTaskSetDialogInterface class. This is the interface for the dialog used by mos...
bool modified
Definition: setStatePropertiesDialog.h:234
This class is the base for setting state properties. In and of itself it does not populate itself wit...
Definition: setStatePropertiesDialog.h:77
bool myIgnoreMaximum
Definition: setStatePropertiesDialog.h:252
QLineEdit * sliderValue
Definition: setStatePropertiesDialog.h:69
bool alwaysUpdate
Definition: setStatePropertiesDialog.h:235
QComboBox * combo
Definition: setStatePropertiesDialog.h:228
bool myValuesArePercentages
Definition: setStatePropertiesDialog.h:72
QCheckBox * checkBox
Definition: setStatePropertiesDialog.h:220
PropertyItem(const PropertyItem &orig)
Definition: setStatePropertiesDialog.h:215
std::map< DtString, PropertyItem > PropertyItems
The key is the propertyItem root name.
Definition: setStatePropertiesDialog.h:110
class DtSimStatement:
Definition: simStatement.h:38
DtPropertySlider * propertySlider
Definition: setStatePropertiesDialog.h:229
bool initiallyChecked
Definition: setStatePropertiesDialog.h:233
DtPropertyInterface * properties
Definition: setStatePropertiesDialog.h:237
A list of properties. A DtPropertyInterface object that is a specialized version of DtRwVariableBindi...
Definition: rwProperties.h:122
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
PropertyItems myPropertyItems
Definition: setStatePropertiesDialog.h:242
QToolButton * revertButton
Definition: setStatePropertiesDialog.h:236
DtRwProperties myParameterData
Definition: setStatePropertiesDialog.h:254
#define DT_DLL_VRFGUITASKSETQT
Definition: vrfGuiTaskSetQt.h:22
QWidget * widget
Definition: setStatePropertiesDialog.h:226
bool added
Definition: setStatePropertiesDialog.h:238
PropertyItems children
Definition: setStatePropertiesDialog.h:239
std::map< DtString, std::set< DtString > > myIgnorePropertyMapColumns
If there are property maps, and you wish to ignore columns in those maps when they are set up...
Definition: setStatePropertiesDialog.h:258

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)