VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
newTacticalGraphicEntryWidget.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 
17 #include <matrix/vlVector.h>
18 
20 #include <QtWidgets/QWidget>
21 #include <QtWidgets/QBoxLayout>
22 #include <QtWidgets/QPushButton>
23 #include <QtWidgets/QLabel>
24 #include <QtWidgets/QLineEdit>
25 
26 #include <QtDesigner/QExtensionFactory>
27 #include <QtDesigner/QDesignerTaskMenuExtension>
28 
29 class DtEntityType;
30 class QToolButton;
31 
32 namespace makVrf
33 {
34  class DtNewTacticalGraphicEntryWidgetLogic;
35 
37  {
38  Q_OBJECT
39  Q_PROPERTY(QString entityType READ variableData WRITE setVariableData)
40 
41  public:
42 
44  {
47  DtObjectBeingDefined
48  };
49 
52  QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
53 
56 
59  void init();
60 
62  virtual void setObjectDefined(DtObjectDefinitionState state);
63 
65  virtual DtObjectDefinitionState objectDefined() const;
66 
69  virtual DtReaderWriter* createBoundVariable(const std::string& variableName);
70 
72  virtual void setupFromBoundVariable(const DtReaderWriter* variableName);
73 
76  virtual DtTaskSetVariableWidgetExtensionInterface* parameterContents(
77  QWidget* parent, const Qt::WindowFlags& flags = 0) const;
78 
81  bool isValid() const;
82 
84  virtual void setEntityTypeToCreate(const DtEntityType&);
85 
88  virtual const DtEntityType& entityTypeCreated() const;
89 
91  static bool canBeUsedAsWidget()
92  {
93  return true;
94  }
95 
97  {
98  return makVrv::DtUnicode::tr("List of Location3Ds");
99  }
100 
101  static std::string designerGroup()
102  {
103  return tr("VR-Forces Object Creation").toUtf8().constData();
104  }
105 
106  static std::string headerFile()
107  {
108  return tr("<vrfGuiCoreQt/newTacticalGraphicEntryWidget.h>").toUtf8().constData();
109  }
110 
111  static std::string variableName()
112  {
113  return tr("tacticalGraphic").toUtf8().constData();
114  }
115 
117  static void initializeForQtDesignerExtension(makVrv::DtDe&, QDesignerFormEditorInterface*);
118 
121  virtual void setVariableData(const QString&);
122 
123  virtual void setButtonTexts(const std::string& objectDefinedText, const std::string& objectBeingDefinedText, const std::string& objectNotDefinedText);
124  virtual void setStatusTexts(const std::string& objectDefinedText, const std::string& objectBeingDefinedText, const std::string& objectNotDefinedText);
125 
126  virtual void setVertices(const std::vector<DtVector>& positions);
127 
129  boost::signals2::signal<void()> signal_statusChanged;
130 
131  protected:
134  virtual DtNewTacticalGraphicEntryWidgetLogic* createLogic();
135 
137  virtual void setupGui();
138 
140  virtual void setupConnections();
141 
143  virtual void setRange(double top, double bottom);
144 
146  virtual void setDefaultValue(const std::string&);
147 
149  virtual void closeEvent(QCloseEvent* event);
150 
152  virtual void hideEvent(QHideEvent* event);
153 
154  virtual std::string variableDataFromUiDesigner(const QDomElement& element, const DtScriptedTaskVariableLayoutConverter& converter) const;
155 
156  protected slots:
157 
158  virtual void slot_onDefineButtonClicked();
159 
160  public:
161  QWidget* myWidget;
162  QHBoxLayout* myLayout;
165 
166  protected:
170 
174 
177  };
178 
182  {
183  Q_OBJECT
184 
185  public:
186  DtNewTacticalGraphicEntryVariableWidgetExtension(makVrv::DtDe&, QWidget* w, const Qt::WindowFlags& f = 0);
187 
189 
190  virtual int setFrom(const DtScriptedTaskVariable&, QGridLayout* parentLayout, int startRow);
191  virtual void setTo(DtScriptedTaskVariable&) const;
192 
193  virtual void setReadOnly(bool);
194 
195  protected slots:
196  virtual void onSelectEntityType();
197 
198  public:
199  QHBoxLayout* myLayout;
203  };
204 
206  {
207  public:
210 
212  {
213  }
214 
216  makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const DtTaskSetVariableWidgetInterface::CreationFlags& cflags = DtTaskSetVariableWidgetInterface::NormalMode)
217  {
219  new DtNewTacticalGraphicEntryWidget(de, parent, flags, cflags);
220  w->init();
221  return w;
222  }
223 
225  virtual bool canBeUsedAsWidget() const
226  {
228  }
229 
231  {
233  }
234 
235  virtual std::string className() const
236  {
237  return DtNewTacticalGraphicEntryWidget::staticMetaObject.className();
238  }
239 
240  virtual std::string designerGroup() const
241  {
243  }
244 
245  virtual std::string headerFile() const
246  {
248  }
249 
250  virtual bool includeInDesigner() const
251  {
252  return true;
253  }
254 
255  virtual std::string variableName() const
256  {
258  }
259 
262  virtual void initializeForQtDesignerExtension(makVrv::DtDe& de, QDesignerFormEditorInterface* core)
263  {
265  }
266  };
267 
270  {
271  Q_OBJECT
272 
273  public:
274  explicit DtNewTacticalGraphicEntryWidgetMenuFactory(makVrv::DtDe&, QExtensionManager *parent = 0);
275 
276  protected:
277  QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
278 
279  protected:
281  };
282 
284  {
285  Q_OBJECT
286  Q_INTERFACES(QDesignerTaskMenuExtension)
287 
288  public:
290 
291  virtual QAction *preferredEditAction() const;
292  virtual QList<QAction *> taskActions() const;
293 
294  protected slots:
295  virtual void editState();
296 
297  protected:
301  };
302 }
DtObjectDefinitionState myObjectDefinitionState
Definition: newTacticalGraphicEntryWidget.h:175
QToolButton * myEntityTypeEditButton
Definition: newTacticalGraphicEntryWidget.h:202
DtNewTacticalGraphicEntryWidgetLogic * myLogic
Definition: newTacticalGraphicEntryWidget.h:176
virtual DtTaskSetVariableWidgetInterface * create(makVrv::DtDe &de, QWidget *parent, const Qt::WindowFlags &flags=0, const DtTaskSetVariableWidgetInterface::CreationFlags &cflags=DtTaskSetVariableWidgetInterface::NormalMode)
Definition: newTacticalGraphicEntryWidget.h:215
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
std::string myButtonObjectNotDefinedText
Definition: newTacticalGraphicEntryWidget.h:169
std::string myButtonObjectBeingDefinedText
Definition: newTacticalGraphicEntryWidget.h:168
CreationFlags
Definition: taskSetVariableWidget.h:119
makVrv::DtDe & myDe
Definition: newTacticalGraphicEntryWidget.h:280
virtual makVrv::DtUnicode codeVariableType() const
Definition: newTacticalGraphicEntryWidget.h:230
virtual std::string designerGroup() const
The designer group that this is going into.
Definition: newTacticalGraphicEntryWidget.h:240
#define DT_DLL_VRFGUICOREQT
Definition: vrfGuiCoreQt.h:26
DtObjectDefinitionState
Definition: newTacticalGraphicEntryWidget.h:43
Definition: newTacticalGraphicEntryWidget.h:45
Definition: newTacticalGraphicEntryWidget.h:283
This class will parse the UI file for known scripted task variable types and pull out specified scrip...
Definition: scriptedTaskVariableLayoutConverter.h:32
Definition: taskSetVariableWidget.h:121
Definition: readerWriter.h:85
static makVrv::DtUnicode codeVariableType()
Definition: newTacticalGraphicEntryWidget.h:96
void init()
Creates the object, sets up the GUI, and sets up the signal/slot connections for this widget...
QWidget * myWidget
Definition: newTacticalGraphicEntryWidget.h:161
QHBoxLayout * myLayout
Definition: newTacticalGraphicEntryWidget.h:199
DtNewTacticalGraphicEntryWidgetCreator()
Definition: newTacticalGraphicEntryWidget.h:208
boost::signals2::signal< void()> signal_statusChanged
Signals.
Definition: newTacticalGraphicEntryWidget.h:129
virtual ~DtNewTacticalGraphicEntryWidgetCreator()
Definition: newTacticalGraphicEntryWidget.h:211
QPushButton * myDefineButton
Definition: newTacticalGraphicEntryWidget.h:163
virtual bool canBeUsedAsWidget() const
Whether or not this shows up as a usable variable widget.
Definition: newTacticalGraphicEntryWidget.h:225
static std::string headerFile()
Definition: newTacticalGraphicEntryWidget.h:106
QLineEdit * myEntityType
Definition: newTacticalGraphicEntryWidget.h:201
Basic implementation that has a label at the top.
Definition: taskSetVariableWidget.h:233
std::string myButtonObjectDefinedText
Definition: newTacticalGraphicEntryWidget.h:167
virtual std::string headerFile() const
The header file to include when generating code.
Definition: newTacticalGraphicEntryWidget.h:245
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
static std::string variableName()
Definition: newTacticalGraphicEntryWidget.h:111
static bool canBeUsedAsWidget()
Whether or not this shows up as a usable variable widget.
Definition: newTacticalGraphicEntryWidget.h:91
Definition: newTacticalGraphicEntryWidget.h:46
std::string myStatusObjectNotDefinedText
Definition: newTacticalGraphicEntryWidget.h:173
QLabel * myLabel
Definition: newTacticalGraphicEntryWidget.h:200
Definition: newTacticalGraphicEntryWidget.h:36
This class will define the interface needed for being a task set variable that can be used in task di...
Definition: taskSetVariableWidget.h:116
static std::string designerGroup()
Definition: newTacticalGraphicEntryWidget.h:101
A class for keeping track of meta data for variables of scripted tasks. The information is currently ...
Definition: scriptedTaskVariable.h:34
QLabel * myStatusLabel
Definition: newTacticalGraphicEntryWidget.h:164
Private to this class.
Definition: newTacticalGraphicEntryWidgetLogic.h:35
virtual std::string variableName() const
The default variable nameto initially assign to this object.
Definition: newTacticalGraphicEntryWidget.h:255
QAction * myEditStateAction
Definition: newTacticalGraphicEntryWidget.h:298
Definition: newTacticalGraphicEntryWidget.h:205
std::string myStatusObjectBeingDefinedText
Definition: newTacticalGraphicEntryWidget.h:172
QHBoxLayout * myLayout
Definition: newTacticalGraphicEntryWidget.h:162
Qt designer extensions.
Definition: newTacticalGraphicEntryWidget.h:269
makVrv::DtDe & myDe
Definition: newTacticalGraphicEntryWidget.h:300
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
Creator class to be used when creating instances of task/set variables.
Definition: taskSetVariableWidget.h:382
std::string myStatusObjectDefinedText
Definition: newTacticalGraphicEntryWidget.h:171
Definition: translator.h:58
DtNewTacticalGraphicEntryWidget * myWidget
Definition: newTacticalGraphicEntryWidget.h:299
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:72
virtual bool includeInDesigner() const
Include this class in the designer plugin.
Definition: newTacticalGraphicEntryWidget.h:250
virtual std::string className() const
Definition: newTacticalGraphicEntryWidget.h:235
virtual void initializeForQtDesignerExtension(makVrv::DtDe &de, QDesignerFormEditorInterface *core)
Called when initializing widget for potential Qt Designer plugin usage. Please refer to Qt documentat...
Definition: newTacticalGraphicEntryWidget.h:262
Extension interface for contents for definition of variables in the scripted task meta data variable ...
Definition: taskSetVariableWidget.h:84
Extension widget which allows the entity type of the tactical graphic to be created.
Definition: newTacticalGraphicEntryWidget.h:181
static void initializeForQtDesignerExtension(makVrv::DtDe &, QDesignerFormEditorInterface *)
Add custom menu item to task menu to be able to edit the entity type created by this object...

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)