VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
sphereEntryWidget.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 #include <boost/signals2.hpp>
16 
17 class QGridLayout;
18 class QLineEdit;
19 
20 namespace makVrf
21 {
22  class DtRangeEntryWidget;
23  class DtSphereEditor;
24 
28  {
29  Q_OBJECT
30  Q_PROPERTY(QString radiusLabel READ radiusLabel WRITE setRadiusLabel)
31  Q_PROPERTY(bool showSphere READ showSphere WRITE setShowSphere)
32  Q_PROPERTY(double defaultRadius READ defaultRadius WRITE setDefaultRadius)
33 
34  public:
35  DtSphereEntryWidget(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
36 
37  //DTOR
38  virtual ~DtSphereEntryWidget();
39 
44  virtual void setRange(double bottom, double top);
45 
47  virtual void setDefaultValue(const std::string&);
48 
51  virtual void setVariableData(const QString&);
53 
55  virtual double radius() const;
56 
58  virtual void setRadius(double);
59 
61  virtual DtReaderWriter* createBoundVariable(const std::string& variableName);
62 
64  virtual void setupFromBoundVariable(const DtReaderWriter* variableName);
65 
68  virtual DtTaskSetVariableWidgetExtensionInterface* parameterContents(QWidget* parent, const Qt::WindowFlags& flags = 0) const;
69 
70  virtual void setRadiusLabel(const QString&);
71  virtual QString radiusLabel() const;
72 
73  virtual void setDefaultRadius(double);
74  virtual double defaultRadius() const;
75 
76  static makVrv::DtUnicode codeVariableType()
77  {
78  return makVrv::DtUnicode::tr("Sphere: variable.center (Location3D), variable.radius (radius in meters)");
79  }
80 
81  virtual void refreshLabels();
82 
84  virtual void setShowSphere(bool);
85  bool showSphere() const { return myShowSphere; };
86 
88  virtual void setupSphere();
89 
92  virtual void setHasMapFocus(bool);
93 
95  virtual void setMaintainCurrentAltitude(bool);
96 
98  virtual void setProcessMouseEvents(bool);
99 
100  virtual void setHasBeenPlaced(bool b);
101  bool hasBeenPlaced() const { return myHasBeenPlaced; };
102 
103  boost::signals2::signal<void ()> signal_radiusChanged;
104  boost::signals2::signal<void (bool)> signal_hasBeenPlaced;
105 
106  static std::string designerGroup()
107  {
108  return tr("VR-Forces Object Creation").toUtf8().constData();
109  }
110 
111  static std::string headerFile()
112  {
113  return tr("<vrfGuiDataEntryWidgets/sphereEntryWidget.h>").toUtf8().constData();
114  }
115 
116  static std::string variableName()
117  {
118  return tr("sphere").toUtf8().constData();
119  }
120 
121  protected:
122 
123  virtual void canTakeMapFocusChanged();
124  virtual void radiusChanged();
125 
126  virtual void slot_onPositionChanged();
127 
128  virtual void updateSphereLocation();
129 
130  virtual std::string variableDataFromUiDesigner(const QDomElement& element, const DtScriptedTaskVariableLayoutConverter& converter) const;
131 
133  virtual void selectionChanged(const std::set<makVrv::DtUniqueID>& oldSelection);
134 
135  public:
137 
138  protected:
143  double myBottom;
144  double myTop;
145  QGridLayout* mySphereLayout;
146  };
147 
151  {
152  Q_OBJECT
153 
154  public:
155  DtSphereEntryVariableWidgetExtension(makVrv::DtDe&, QWidget* w, const Qt::WindowFlags& f = 0);
157 
158  virtual int setFrom(const DtScriptedTaskVariable&, QGridLayout* parentLayout, int startRow);
159  virtual void setTo(DtScriptedTaskVariable&) const;
160 
161  virtual void setReadOnly(bool);
162 
163  public:
168  };
169 
171 }
DtSphereEditor * mySphereEditor
Definition: sphereEntryWidget.h:140
Extension widget which simply contains three turn rate variable widgets to allow for reuse of existin...
Definition: sphereEntryWidget.h:150
Simple line text entry widget that will allow the user to enter a range value.
Definition: rangeEntryWidget.h:26
static std::string variableName()
Definition: sphereEntryWidget.h:116
CreationFlags
Definition: taskSetVariableWidget.h:118
Editor for sphere objects. Will also create the visualizers (and manage) for the editing.
Definition: sphereEditor.h:42
This class will parse the UI file for known scripted task variable types and pull out specified scrip...
Definition: scriptedTaskVariableLayoutConverter.h:32
QLabel * myDefaultValueLabel
Definition: sphereEntryWidget.h:165
QLineEdit * myDefaultValue
Definition: sphereEntryWidget.h:164
double myTop
Definition: sphereEntryWidget.h:144
Definition: readerWriter.h:85
DtTaskSetVariableWidgetCreator< DtSphereEntryWidget > DtSphereEntryWidgetCreator
Definition: sphereEntryWidget.h:170
Widget that will allow the user to enter a sphere (center and radius).
Definition: sphereEntryWidget.h:27
static std::string designerGroup()
Definition: sphereEntryWidget.h:106
static std::string headerFile()
Definition: sphereEntryWidget.h:111
bool myHasMapFocus
Definition: sphereEntryWidget.h:142
static DtUnicode tr(const char *ascii)
Ascii translation function, used to be compatible with Qt&#39;s translation tools.
Definition: DtUnicode.h:92
bool myHasBeenPlaced
Definition: sphereEntryWidget.h:141
Definition: taskSetVariableWidget.h:419
double myBottom
Definition: sphereEntryWidget.h:143
QGridLayout * mySphereLayout
Definition: sphereEntryWidget.h:145
A class for keeping track of meta data for variables of scripted tasks.
Definition: scriptedTaskVariable.h:31
#define DT_DLL_VRFGUIDATAENTRYWIDGETS
Definition: vrfGuiDataEntryWidgets.h:23
boost::signals2::signal< void(bool)> signal_hasBeenPlaced
Definition: sphereEntryWidget.h:104
DtRangeEntryWidget * myRadius
Definition: sphereEntryWidget.h:136
DtRangeEntryWidget * myRangeBottom
Definition: sphereEntryWidget.h:166
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Definition: locationEntryWidget.h:44
bool myShowSphere
Definition: sphereEntryWidget.h:139
bool showSphere() const
Definition: sphereEntryWidget.h:85
Extension interface for contents for definition of variables in the scripted task meta data variable ...
Definition: taskSetVariableWidget.h:83
DtRangeEntryWidget * myRangeTop
Definition: sphereEntryWidget.h:167

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)