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 
141  protected:
142  virtual bool wantsSpacer() const;
143  virtual void setupStatement(const DtSimStatement*) override;
144  virtual DtRwProperties modifiedProperties() const;
145  virtual bool modifiedProperties(const PropertyItem&, DtReaderWriter* rw, bool parentItList = false) const;
146  virtual void setupStateProperties(DtSetStateProperties* col);
147 
148  virtual const DtReaderWriter* baseValueFor(const DtString& pathSoFar) const;
149 
151  virtual bool hasValue(const DtRwProperties& props, const DtString& val) const;
152 
154  virtual void extract(std::vector<DtReaderWriter*>& allCounts, const DtString& extractionType, DtReaderWriter* curItem,
155  const DtString& pathSoFar) const;
156 
158  virtual void extractItemsFor(DtReaderWriter*, const DtString& extractionType,
159  const DtString& title, DtRwProperties* container) const;
160 
161  virtual void addDataEntryIfModifiableValue(PropertyItem& item, const DtReaderWriter* rw, const DtString& pathSoFar,
162  int level, bool updateExistingValue, int row);
163 
165  virtual void valueFromWidget(const PropertyItem& item, DtReaderWriter* rw) const;
166 
168  virtual DtString properties() const;
169 
173  virtual bool replace() const;
174 
176  virtual DtString translationModule() const;
177 
179  virtual bool valuesArePercentages(const std::set<makVrv::DtUniqueID>& data) const;
180 
183  virtual bool sendValuesAsPercentages() const;
184 
186  virtual bool isValid() const;
187 
188  virtual void checkHasNoItems();
189  virtual bool updateProperty(QObject*, PropertyItems&);
190  virtual bool revertValue(QObject*, PropertyItems&);
191  virtual void revertValue(PropertyItem&);
192  virtual void propertiesUpdated(PropertyItem&);
193 
194  public:
195  QWidget* myCanvas = nullptr;
196  QVBoxLayout* myMainLayout = nullptr;
197  QScrollArea* myScrollArea = nullptr;
198  QWidget* myScrollAreaCanvas = nullptr;
199  QGridLayout* myGridLayout = nullptr;
200  QLabel* myNoItems = nullptr;
201 
202  protected:
207 
209  {
210  PropertyItem() : labelLayout(0), label(0), validator(0), modified(false), alwaysUpdate(false), revertButton(0), properties(0), added(false) { widgets.widget = 0; };
211  PropertyItem(const PropertyItem& orig) : label(orig.label), validator(orig.validator), alwaysUpdate(orig.alwaysUpdate),
212  labelLayout(orig.labelLayout), modified(orig.modified), properties(orig.properties), revertButton(orig.revertButton),
213  children(orig.children), added(orig.added) { widgets.widget = orig.widgets.widget; };
214 
215  QHBoxLayout* labelLayout;
218 
219  union Widgets
220  {
221  QWidget* widget;
225  };
226 
228  bool modified;
232  bool added;
234  };
235 
238 
241 
245 
249 
252  std::map<DtString, std::set<DtString> > myIgnorePropertyMapColumns;
253  };
254 }
QLineEdit * lineEdit
Definition: setStatePropertiesDialog.h:222
const DtString & defaultPlatformFile() const
Definition: setStatePropertiesDialog.h:98
QValidator * validator
Definition: setStatePropertiesDialog.h:217
bool myValuesArePercentages
Definition: setStatePropertiesDialog.h:239
File: setStateProperties.h.
Definition: setStateProperties.h:40
DtString myProperty
Definition: setStatePropertiesDialog.h:237
Definition: baseTaskSetDialogInterface.h:35
QSlider * slider
Definition: setStatePropertiesDialog.h:68
Widgets widgets
Definition: setStatePropertiesDialog.h:227
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:244
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:216
Definition: readerWriter.h:85
PropertyItem()
Definition: setStatePropertiesDialog.h:210
Definition: setStatePropertiesDialog.h:208
DtString myDefaultPlatformFile
If specified, and there is no data because the item that wants to be set does not exist...
Definition: setStatePropertiesDialog.h:205
DtRwProperties myStateProperties
Definition: setStatePropertiesDialog.h:247
Interface class used to define minimal interface for a property. The DtPropertyInterface class provid...
Definition: propertyInterface.h:53
bool myCreatePropertySlider
Definition: setStatePropertiesDialog.h:240
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:219
bool myUsingGeneric
Definition: setStatePropertiesDialog.h:206
Contains makVrf::DtBaseTaskSetDialogInterface class. This is the interface for the dialog used by mos...
bool modified
Definition: setStatePropertiesDialog.h:228
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:246
QLineEdit * sliderValue
Definition: setStatePropertiesDialog.h:69
bool alwaysUpdate
Definition: setStatePropertiesDialog.h:229
QComboBox * combo
Definition: setStatePropertiesDialog.h:223
bool myValuesArePercentages
Definition: setStatePropertiesDialog.h:72
PropertyItem(const PropertyItem &orig)
Definition: setStatePropertiesDialog.h:211
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:224
DtPropertyInterface * properties
Definition: setStatePropertiesDialog.h:231
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:236
QToolButton * revertButton
Definition: setStatePropertiesDialog.h:230
DtRwProperties myParameterData
Definition: setStatePropertiesDialog.h:248
#define DT_DLL_VRFGUITASKSETQT
Definition: vrfGuiTaskSetQt.h:22
QWidget * widget
Definition: setStatePropertiesDialog.h:221
bool added
Definition: setStatePropertiesDialog.h:232
PropertyItems children
Definition: setStatePropertiesDialog.h:233
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:252

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)