VR-Forces 4.8 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 
132  public:
134 
135  protected:
140  double myBottom;
141  double myTop;
142  QGridLayout* mySphereLayout;
143  };
144 
148  {
149  Q_OBJECT
150 
151  public:
152  DtSphereEntryVariableWidgetExtension(makVrv::DtDe&, QWidget* w, const Qt::WindowFlags& f = 0);
154 
155  virtual int setFrom(const DtScriptedTaskVariable&, QGridLayout* parentLayout, int startRow);
156  virtual void setTo(DtScriptedTaskVariable&) const;
157 
158  virtual void setReadOnly(bool);
159 
160  public:
165  };
166 
168 }
DtSphereEditor * mySphereEditor
Definition: sphereEntryWidget.h:137
Extension widget which simply contains three turn rate variable widgets to allow for reuse of existin...
Definition: sphereEntryWidget.h:147
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:115
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:162
QLineEdit * myDefaultValue
Definition: sphereEntryWidget.h:161
double myTop
Definition: sphereEntryWidget.h:141
Definition: readerWriter.h:85
DtTaskSetVariableWidgetCreator< DtSphereEntryWidget > DtSphereEntryWidgetCreator
Definition: sphereEntryWidget.h:167
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:139
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:138
Definition: taskSetVariableWidget.h:393
double myBottom
Definition: sphereEntryWidget.h:140
QGridLayout * mySphereLayout
Definition: sphereEntryWidget.h:142
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:133
DtRangeEntryWidget * myRangeBottom
Definition: sphereEntryWidget.h:163
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Definition: locationEntryWidget.h:44
bool myShowSphere
Definition: sphereEntryWidget.h:136
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:80
DtRangeEntryWidget * myRangeTop
Definition: sphereEntryWidget.h:164

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)