VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOverlayAmbushLineModel.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 <matrix/vlDcm.h>
17 
18 #include <vrvMath/DtVector2.h>
19 #include <vrvMath/DtVector3.h>
20 #include <vrvMath/DtVector4.h>
21 
22 #define SKIRT_LINE_VERTS 9
23 #define SKIRT_LINES 6
24 
25 namespace makVrv
26 {
27  class DtDe;
28  class DtSegmentedLineInterface;
29 
54 
55 
65  {
66  public:
67 
70 
72  DtOverlayAmbushLineModel() = delete;
73 
76 
78  DtOverlayAmbushLineModel& operator=(const DtOverlayAmbushLineModel&) = delete;
79 
81  virtual ~DtOverlayAmbushLineModel();
82 
83  public:
84 
87 
89  // @{
90  virtual void setOrigin(const DtVector& position);
91  virtual DtVector origin() const;
92  // @}
93 
95  // @{
96  virtual void setRelativePosition(double x, double y, double z);
97  virtual DtVector relativePosition() const;
98  // @}
99 
101  virtual void setOrientation(const DtTaitBryan& orientation);
102 
104  // @{
105  virtual void setScale(float scale);
106  virtual float scale() const;
107  // @}
108 
110  // @{
111  virtual void setVisible(bool isVisible);
112  virtual bool isVisible() const;
113  // @}
114 
116  // @{
117  virtual void setStipplePattern(unsigned int stipplePattern);
118  virtual unsigned int stipplePattern() const;
119  // @}
120 
122  // @{
123  virtual void setLineWidth(float);
124  virtual float lineWidth() const;
125  // @}
126 
128  virtual void setColor(float r, float g, float b, float a);
129  virtual bool getColor(float& r, float& g, float& b, float& a) const;
130 
132  // @{
133  virtual void setEventsEnabled(bool enabled);
134  virtual bool eventsEnabled() const;
135  // @}
136 
141  // @{
142  virtual void setGroup(int groupNum);
143  virtual int group() const;
144  // @}
145 
147 
148  // @name Inherited DtModel methods
149  // @{
150 
152  virtual void setPosition(int vtx, const DtVector& position) override;
153 
156  virtual void setOrientation(int vtx, const DtTaitBryan& orientation) override;
157 
159  virtual void setModelDefinition(const std::string& str) override;
160  // @}
161 
162  protected:
163  // @name Inherited DtModel methods
164  // @{
165 
167  virtual void addToScene(const DtUniqueID& sceneObjectId,
168  DtModelSetId modelSet, int visualizerType) override;
169 
171  virtual void removeFromScene() override;;
172 
176  virtual void setIsSupportModel(bool isSupport) override;;
177 
178  // @}
179 
181  virtual void needsUpdate();
182 
184  virtual void update();
185 
187  virtual void createAmbushLineIfNecessary();
188 
190  virtual void set3DVertexPosition(unsigned int index, double x, double y, double z);
191 
193  virtual void set3DPositionAux(double x, double y, double z, float tempPackedCoords[4]);
194 
195  // Position the ambush line arrow
196  virtual void setAmbushLinePositions(double x, double y, double z);
197 
199  virtual void updateColors();
200 
202  virtual void updateLineColor(DtSegmentedLineInterface* seg, float r, float g, float b, float a);
203 
205  virtual void updateLineWidth(DtSegmentedLineInterface* seg, float width);
206 
208  virtual void setEventsEnabledLine(DtSegmentedLineInterface* seg, bool b, unsigned long long userData);
209 
211  virtual void updateLineStipple(DtSegmentedLineInterface* seg, unsigned int stipple);
212 
214  virtual void updateVertices();
215 
216  virtual void setPosition(const DtVector& position);
217 
219  // @{
220  virtual void setDimensions(float x, float y);
221  virtual bool getDimensions(float& x, float& y) const;
222  // @}
223  protected:
224  std::vector<DtVector> myDefinedVertices;
225 
227 
228  boost::signalslib::connection mySignalPostUpdateConnection;
229 
230 
233 
238  float myScale;
239 
241 
242  float myLineWidth;
244  unsigned long long myUserData;
245 
246  bool myVisible;
247  unsigned int myLineStipplePattern;
248  int myGroup;
249 
251 
252  // Arrow tip
254  // Arrow shaft
256  // Skirt top
258  // Skirt lines
260  };
261 
262 }
std::vector< DtVector > myDefinedVertices
Definition: DtOverlayAmbushLineModel.h:224
DtDcm myOrientationDcm
Definition: DtOverlayAmbushLineModel.h:232
2 dimensional vector
voidpf uLong int origin
Definition: ioapi.h:42
DtModelSetId myModelSet
Definition: DtOverlayAmbushLineModel.h:231
DtVector2< float > myDimensions
Definition: DtOverlayAmbushLineModel.h:235
float myLineWidth
Definition: DtOverlayAmbushLineModel.h:242
DtSegmentedLineInterface * myArrowShaft
Definition: DtOverlayAmbushLineModel.h:255
Interface class for an Overlay Ambush Line Model An overlay model is positioned in 3D space and drawn...
Definition: DtOverlayAmbushLineModel.h:64
4 dimensional vector
#define SKIRT_LINES
Definition: DtOverlayAmbushLineModel.h:23
3 dimensional vector
DtSegmentedLineInterface * myArrowTip
Definition: DtOverlayAmbushLineModel.h:253
An interface for a convex polygon drawn using lines.
Definition: DtSegmentedLineInterface.h:25
bool myVisible
Definition: DtOverlayAmbushLineModel.h:246
DtSegmentedLineInterface * mySkirtTop
Definition: DtOverlayAmbushLineModel.h:257
unsigned long long myUserData
Definition: DtOverlayAmbushLineModel.h:244
DtVector3< double > myRelativePosition
Definition: DtOverlayAmbushLineModel.h:236
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
unsigned int myLineStipplePattern
Definition: DtOverlayAmbushLineModel.h:247
boost::signalslib::connection mySignalPostUpdateConnection
Definition: DtOverlayAmbushLineModel.h:228
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
Contains makVrv::DtModel class.
float myScale
Definition: DtOverlayAmbushLineModel.h:238
int myOverlayId
Definition: DtOverlayAmbushLineModel.h:250
bool myEventsEnabled
Definition: DtOverlayAmbushLineModel.h:243
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.
bool myNeedsUpdate
Definition: DtOverlayAmbushLineModel.h:226
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
DtVector3< double > myPosition
Definition: DtOverlayAmbushLineModel.h:237
int myGroup
Definition: DtOverlayAmbushLineModel.h:248
DtModelSetId
Definition: DtModelSetEnums.h:19
DtVector4< float > myColor
Definition: DtOverlayAmbushLineModel.h:234
bool myPositionSetFlag
Definition: DtOverlayAmbushLineModel.h:240
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)