VR-Forces Developer's Guide
 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 DtSmallRangeEntryWidget;
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() override;
39 
44  virtual void setRange(double bottom, double top) override;
45 
47  virtual void setDefaultValue(const std::string&) override;
48 
51  virtual void setVariableData(const QString&) override;
53 
55  virtual double radius() const;
56 
58  virtual void setRadius(double);
59 
61  virtual DtReaderWriter* createBoundVariable(const std::string& variableName) override;
62 
64  virtual void setupFromBoundVariable(const DtReaderWriter* variableName) override;
65 
68  virtual DtTaskSetVariableWidgetExtensionInterface* parameterContents(
69  QWidget* parent, const Qt::WindowFlags& flags = 0) const override;
70 
71  virtual void setRadiusLabel(const QString&);
72  virtual QString radiusLabel() const;
73 
74  virtual void setDefaultRadius(double);
75  virtual double defaultRadius() const;
76 
77  static makVrv::DtUnicode codeVariableType()
78  {
79  return makVrv::DtUnicode::tr("Sphere: variable.center (Location3D), variable.radius (radius in meters)");
80  }
81 
82  virtual void refreshLabels();
83 
85  virtual void setShowSphere(bool);
86  bool showSphere() const { return myShowSphere; };
87 
89  virtual void setupSphere();
90 
93  virtual void setHasMapFocus(bool) override;
94 
96  virtual void setMaintainCurrentAltitude(bool) override;
97 
99  virtual void setProcessMouseEvents(bool) override;
100 
101  virtual void setHasBeenPlaced(bool b);
102  bool hasBeenPlaced() const { return myHasBeenPlaced; };
103 
104  boost::signals2::signal<void ()> signal_radiusChanged;
105  boost::signals2::signal<void (bool)> signal_hasBeenPlaced;
106 
107  static std::string designerGroup()
108  {
109  return tr("VR-Forces Object Creation").toUtf8().constData();
110  }
111 
112  static std::string headerFile()
113  {
114  return tr("<vrfGuiDataEntryWidgets/sphereEntryWidget.h>").toUtf8().constData();
115  }
116 
117  static std::string variableName()
118  {
119  return tr("sphere").toUtf8().constData();
120  }
121 
122  protected:
123 
124  virtual void canTakeMapFocusChanged() override;
125  virtual void radiusChanged();
126 
127  virtual void slot_onPositionChanged() override;
128 
129  virtual void updateSphereLocation();
130 
131  virtual std::string variableDataFromUiDesigner(
132  const QDomElement& element, const DtScriptedTaskVariableLayoutConverter& converter) const override;
133 
135  virtual void selectionChanged(const std::set<makVrv::DtUniqueID>& oldSelection) override;
136 
137  public:
139 
140  protected:
145  double myBottom;
146  double myTop;
147  QGridLayout* mySphereLayout;
148  };
149 
153  {
154  Q_OBJECT
155 
156  public:
157  DtSphereEntryVariableWidgetExtension(makVrv::DtDe&, QWidget* w, const Qt::WindowFlags& f = 0);
158  virtual ~DtSphereEntryVariableWidgetExtension() override;
159 
160  virtual int setFrom(const DtScriptedTaskVariable&, QGridLayout* parentLayout, int startRow) override;
161  virtual void setTo(DtScriptedTaskVariable&) const override;
162 
163  virtual void setReadOnly(bool) override;
164 
165  public:
170  };
171 
173 }
DtSphereEditor * mySphereEditor
Definition: sphereEntryWidget.h:142
Extension widget which simply contains three turn rate variable widgets to allow for reuse of existin...
Definition: sphereEntryWidget.h:152
static std::string variableName()
Definition: sphereEntryWidget.h:117
CreationFlags
Definition: taskSetVariableWidget.h:118
Editor for sphere objects. Will also create the visualizers (and manage) for the editing.
Definition: sphereEditor.h:38
Simple line text entry widget that will allow the user to enter a small range value.
Definition: smallRangeEntryWidget.h:27
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:167
QLineEdit * myDefaultValue
Definition: sphereEntryWidget.h:166
double myTop
Definition: sphereEntryWidget.h:146
Definition: readerWriter.h:85
DtTaskSetVariableWidgetCreator< DtSphereEntryWidget > DtSphereEntryWidgetCreator
Definition: sphereEntryWidget.h:172
Widget that will allow the user to enter a sphere (center and radius). If enabled (which is true...
Definition: sphereEntryWidget.h:27
DtSmallRangeEntryWidget * myRadius
Definition: sphereEntryWidget.h:138
static std::string designerGroup()
Definition: sphereEntryWidget.h:107
static std::string headerFile()
Definition: sphereEntryWidget.h:112
bool myHasMapFocus
Definition: sphereEntryWidget.h:144
static DtUnicode tr(const char *ascii)
Ascii translation function, used to be compatible with Qt&#39;s translation tools. This will simply call ...
Definition: DtUnicode.h:92
bool myHasBeenPlaced
Definition: sphereEntryWidget.h:143
Definition: taskSetVariableWidget.h:422
double myBottom
Definition: sphereEntryWidget.h:145
QGridLayout * mySphereLayout
Definition: sphereEntryWidget.h:147
A class for keeping track of meta data for variables of scripted tasks. The information is currently ...
Definition: scriptedTaskVariable.h:34
#define DT_DLL_VRFGUIDATAENTRYWIDGETS
Definition: vrfGuiDataEntryWidgets.h:22
boost::signals2::signal< void(bool)> signal_hasBeenPlaced
Definition: sphereEntryWidget.h:105
DtSmallRangeEntryWidget * myRangeTop
Definition: sphereEntryWidget.h:169
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
Definition: locationEntryWidget.h:47
bool myShowSphere
Definition: sphereEntryWidget.h:141
DtSmallRangeEntryWidget * myRangeBottom
Definition: sphereEntryWidget.h:168
bool showSphere() const
Definition: sphereEntryWidget.h:86
Extension interface for contents for definition of variables in the scripted task meta data variable ...
Definition: taskSetVariableWidget.h:83

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)