VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOverlayManeuverByFireModel.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2023 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
13 #include <vrvCore/DtModel.h>
14 #include <vrvCore/DtUniqueID.h>
15 
16 #include <vrvMath/DtVector2.h>
17 #include <vrvMath/DtVector3.h>
18 #include <vrvMath/DtVector4.h>
19 
21 
22 #include <matrix/vlDcm.h>
23 
24 namespace makVrv
25 {
26  class DtDe;
27  class DtSegmentedLineInterface;
28  class DtCoordinateSystem;
29 
73  {
74  public:
75 
76 
78  {
79  DtSegmentedLineInterface* myArrowShaft = nullptr;
80  DtSegmentedLineInterface* myArrowTip = nullptr;
81  };
82 
83  enum class ManeuverMode
84  {
85  NONE,
86  ATTACK,
87  SUPPORT
88  };
89 
92 
95 
98 
100  // @{
101  virtual void setOrigin(const DtVector& position);
102  virtual DtVector origin() const;
103  // @}
104 
106  virtual void setOrientation(const DtTaitBryan& orientation);
107 
109  // @{
110  virtual void setScale(float scale);
111  virtual float scale() const;
112  // @}
113 
115  // @{
116  virtual void setVisible(bool isVisible);
117  virtual bool isVisible() const;
118  // @}
119 
121  // @{
122  virtual void setStipplePattern(unsigned int stipplePattern);
123  virtual unsigned int stipplePattern() const;
124  // @}
125 
127  // @{
128  virtual void setLineWidth(float);
129  virtual float lineWidth() const;
130  // @}
131 
133  virtual void setColor(float r, float g, float b, float a);
134  virtual bool getColor(float& r, float& g, float& b, float& a) const;
135 
137  // @{
138  virtual void setEventsEnabled(bool enabled);
139  virtual bool eventsEnabled() const;
140  // @}
141 
146  // @{
147  virtual void setGroup(int groupNum);
148  virtual int group() const;
149  // @}
150 
158  virtual void setManeuverMode(DtOverlayManeuverByFireModel::ManeuverMode mode);
159  virtual DtOverlayManeuverByFireModel::ManeuverMode maneuverMode();
161 
163 
164  // @name Inherited DtModel methods
165  // @{
166 
168  virtual void setPosition(int vtx, const DtVector& position) override;
169 
172  virtual void setOrientation(int vtx, const DtTaitBryan& orientation) override;
173 
175  virtual void setModelDefinition(const std::string& str) override;
176 
177  // @}
178 
179  protected:
180 
181  // @name Inherited DtModel methods
182  // @{
183 
185  virtual void addToScene(const DtUniqueID& sceneObjectId,
186  DtModelSetId modelSet, int visualizerType) override;
187 
189  virtual void removeFromScene() override;
190 
194  virtual void setIsSupportModel(bool isSupport) override;
195 
196  // @}
197 
199  virtual void needsUpdate();
200 
202  virtual void update();
203 
205  virtual void createManeuverByFireIfNecessary();
206 
208  virtual void clearGeometry();
209 
211  virtual void set3DPositionAux(double x, double y, double z, float tempPackedCoords[4]);
212 
213  // Position the maneuver by fire position arrow
214  virtual void setManeuverByFirePositions();
215 
217  virtual void updateColors();
218 
220  virtual void updateLineColor(DtSegmentedLineInterface* seg, float r, float g, float b, float a);
221 
223  virtual void updateLineWidth(DtSegmentedLineInterface* seg, float width);
224 
226  virtual void setEventsEnabledLine(DtSegmentedLineInterface* seg, bool b, unsigned long long userData);
227 
229  virtual void updateLineStipple(DtSegmentedLineInterface* seg, unsigned int stipple);
230 
232  virtual void updateArrowTip(DtSegmentedLineInterface* arrowTip, const DtVector& start, const DtVector& end);
233 
235  virtual void updateBaseLine(DtSegmentedLineInterface* baseLine, const DtVector& start, const DtVector& end);
236 
238  virtual DtDcm calcOrientationDcm(const DtTaitBryan& orientation);
239 
242  virtual void set3DPositionAuxDcm(DtDcm dcmOri, DtVector posOffset,
243  double x, double y, double z, float packedCoords[4]);
244 
246  virtual void slot_coordinateSystemChanged();
247 
249  virtual void updateVertices();
250 
251  virtual void setDimensions(float x, float y);
252  virtual bool getDimensions(float& x, float& y) const;
253 
254  void setPositionOfVertex(int vtx, const DtVector& position);
255 
256  protected:
257  std::vector<DtVector> myDefinedVertices;
258 
260 
261  boost::signalslib::connection mySignalPostUpdateConnection;
262 
266 
269  float myScale;
270 
271  float myLineWidth;
273  unsigned long long myUserData;
274 
275  bool myVisible;
276  unsigned int myLineStipplePattern;
277  int myGroup;
278 
280 
281  // The base line (3 segments)
283 
284  // 2 arrows if mode is support by fire position
285  // 1 arrow if mode is attack by fire position
286  std::vector<ManeuverArrow> myArrows;
287 
288  // The vertices representing the maneuver by fire tactical graphic
289  std::vector<DtVector> myVertices;
290  // An overall position
292 
293  // Based on the maneuver mode, there will be 1 or 2 arrows
294  // If the mode = "Attack" by fire position there is 1 line from the
295  // center of the base line with myArrow index 0
296  // If the mode = "Support" by fire position there are 2 lines with
297  // myArrow index 0 as the left and 1 as the right
299 
300  // local clone of the system wide coordinate system.
301  // for thread safety.
304  private:
305 
307  DtOverlayManeuverByFireModel() = delete;
308 
311 
313  DtOverlayManeuverByFireModel& operator=(const DtOverlayManeuverByFireModel &) = delete;
314  };
315 
316 }
Interface class for an Overlay Maneuver By Fire Position Model An overlay model is positioned in 3D s...
Definition: DtOverlayManeuverByFireModel.h:72
Definition: DtOverlayManeuverByFireModel.h:77
DtVector2< double > myDimensions
Definition: DtOverlayManeuverByFireModel.h:268
DtModelSetId myModelSet
Definition: DtOverlayManeuverByFireModel.h:263
int myGroup
Definition: DtOverlayManeuverByFireModel.h:277
std::vector< DtVector > myDefinedVertices
Definition: DtOverlayManeuverByFireModel.h:257
2 dimensional vector
voidpf uLong int origin
Definition: ioapi.h:42
int myOverlayId
Definition: DtOverlayManeuverByFireModel.h:279
DtSegmentedLineInterface * myBaseLine
Definition: DtOverlayManeuverByFireModel.h:282
ManeuverMode myManeuverMode
Definition: DtOverlayManeuverByFireModel.h:298
boost::signalslib::connection mySignalPostUpdateConnection
Definition: DtOverlayManeuverByFireModel.h:261
DtVector4< double > myColor
Definition: DtOverlayManeuverByFireModel.h:267
4 dimensional vector
3 dimensional vector
DtCoordinateSystem * myCoordinateSystem
Definition: DtOverlayManeuverByFireModel.h:303
An interface for a convex polygon drawn using lines.
Definition: DtSegmentedLineInterface.h:25
Definition: DtTemplatedModelInstanceCreator.h:28
DtTaitBryan myOrientationTaitBryan
Definition: DtOverlayManeuverByFireModel.h:265
DtVector myOrigin
Definition: DtOverlayManeuverByFireModel.h:291
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
ManeuverMode
Definition: DtOverlayManeuverByFireModel.h:83
bool myNeedsUpdate
Definition: DtOverlayManeuverByFireModel.h:259
std::vector< ManeuverArrow > myArrows
Definition: DtOverlayManeuverByFireModel.h:286
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
bool myEventsEnabled
Definition: DtOverlayManeuverByFireModel.h:272
Contains makVrv::DtModel class.
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
Base class to provide boost signal/slot management.
unsigned int myLineStipplePattern
Definition: DtOverlayManeuverByFireModel.h:276
unsigned long long myUserData
Definition: DtOverlayManeuverByFireModel.h:273
const char int mode
Definition: ioapi.h:38
A model which owns a single model instance. A DtModel is a managing container for a single DtModelIns...
Definition: DtModel.h:56
Contains makVrv::DtUniqueID type.
std::vector< DtVector > myVertices
Definition: DtOverlayManeuverByFireModel.h:289
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
DtSignalConnectionManager myConnections
Definition: DtOverlayManeuverByFireModel.h:302
DtModelSetId
Definition: DtModelSetEnums.h:19
float myScale
Definition: DtOverlayManeuverByFireModel.h:269
bool myVisible
Definition: DtOverlayManeuverByFireModel.h:275
DtDcm myOrientationDcm
Definition: DtOverlayManeuverByFireModel.h:264
float myLineWidth
Definition: DtOverlayManeuverByFireModel.h:271
Contains DLL export macros.

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)