VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOverlaySegmentedLineModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
15 
16 #include <osg/Texture>
17 
18 namespace makVrv
19 {
20  class DtSegmentedLine;
21  class DtChannelManager;
22  class DtChannel;
23 
28  {
29  public:
31  {
32  float width;
33  int group;
34  bool startArrow;
35  bool endArrow;
36  bool lightning;
37  unsigned int stipplePattern;
39  osg::Vec4 color[2];
40 
45  };
46 
48  typedef std::vector<SegmentAttributes> SegmentAttributesVector;
49 
50  typedef std::vector<DtVector> Points;
51 
52  public:
53 
56 
59 
60  private:
61 
64 
67 
70 
71  public:
72 
74  virtual void setPosition( int vtx, const DtVector& position );
75 
77  virtual void removePosition( int vtx );
78 
80  virtual void setWidth(float width);
81 
83  virtual void setColor(float r, float g, float b, float a);
84 
86  virtual void setStipplePattern( unsigned int pattern, int repeatFactor );
87 
90  virtual void setStyleSegments(const std::vector<double>& segmentPercentages);
91 
93  virtual void setSegmentColor(unsigned int segmentIndex,
94  float r, float g, float b, float a);
95 
97  virtual void setSegmentLightningStyle(unsigned int segmentIndex,
98  bool enableLightningStyle);
99 
101  virtual void setSegmentStartArrow(unsigned int segmentIndex,
102  bool enableArrow);
103 
105  virtual void setSegmentEndArrow(unsigned int segmentIndex,
106  bool enableArrow);
107 
110  virtual void setSegmentStipplePattern(unsigned int segmentIndex,
111  unsigned int stipplePattern, int repeatFactor);
112 
114  virtual void setSegmentWidth(unsigned int segmentIndex, double width);
115 
118  virtual void setSegmentStartColor( unsigned int segmentIndex, float r,
119  float g, float b, float a );
120 
123  virtual void setSegmentEndColor( unsigned int segmentIndex, float r,
124  float g, float b, float a );
125 
128  virtual void setModelSet( int modelSet );
129 
133  virtual bool realize(DtModelDefinition& definition);
134 
136  virtual void setVisible(bool isVisible);
137 
139  virtual void setEventsEnabled( bool enabled, unsigned long long userData );
140 
142  virtual void setEventWidth(float width);
143 
145  virtual void update();
146 
148  virtual void setRotation(const osg::Quat& quat);
149 
151  virtual void setArrowSize(double);
152 
154  virtual void setLineStyle(vrvTacticalGraphicUtilities::LineStyle);
155 
157  virtual void setArrowStyle(vrvTacticalGraphicUtilities::ArrowStyle);
158 
160  virtual void setTexture(osg::Texture*);
161 
163  virtual bool isTextured() const;
164 
167  virtual void setFixedWidthSizing(bool);
168 
171  virtual void setGroup( int );
172 
176  virtual void setChannelInstance(DtChannel*, int modelSet);
177 
179  virtual const std::vector<DtVector>& points() const;
180 
182  virtual void setPoints(const std::vector<DtVector>&);
183 
185  virtual const SegmentAttributesVector& segmentInformation() const;
186 
190  virtual void setSegmentInformation(const SegmentAttributesVector&);
191 
193  virtual void updateGeometry();
194 
195  protected:
197  virtual void updateSegmentsWithArrows(const std::vector<DtVector>& pts,
198  std::vector<DtVector>& drawPoints, std::vector<DtVector>& twodOffsets);
199 
200  protected:
201 
203  virtual void createLineIfNecessary();
204 
206  virtual void updateSegments();
207 
209  virtual void updateGeometryForLineStyle();
210 
212  virtual void resizeSegmentAttributes( int size );
213 
215  virtual void set3DVertexPosition( unsigned int index, double x, double y,
216  double z );
217 
219  virtual void set3DPositionAux( double x, double y, double z,
220  float tempPackedCoords[4] );
221 
223  virtual void channelUpdated(const DtTacticalGraphicModelUpdaterManager::ChannelUpdateData&);
224 
226  void updatePointsForLineStyle(const std::vector<DtVector>&, std::vector<DtVector>& drawPoints,
227  std::vector<DtVector>& twodOffsets, std::vector<int>& segmentsToErase) const;
228 
229  protected:
230 
232 
233  // These are the points as set by the model
237 
239  unsigned int myModelSet;
241  bool myVisible;
242 
243  osg::Vec4 myColor;
244  float myWidth;
245  unsigned int myStipplePattern;
247  std::vector<double> mySegmentPercentages;
249 
253 
254  osg::Vec3d myOrigin;
255  osg::Quat myRotation;
256 
257  double myArrowSize;
259 
261 
264  std::vector<int> mySegmentsToErase;
265 
267  int myGroup;
268  };
269 }
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
Points myVertices
Definition: DtOverlaySegmentedLineModelInstance.h:235
osg::ref_ptr< osg::Texture > myTexture
Definition: DtOverlaySegmentedLineModelInstance.h:260
std::vector< double > mySegmentPercentages
Definition: DtOverlaySegmentedLineModelInstance.h:247
float width
Definition: DtOverlaySegmentedLineModelInstance.h:32
unsigned int myModelSet
Definition: DtOverlaySegmentedLineModelInstance.h:239
double myArrowSize
Definition: DtOverlaySegmentedLineModelInstance.h:257
Points myPoints
Definition: DtOverlaySegmentedLineModelInstance.h:234
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
unsigned int myStipplePattern
Definition: DtOverlaySegmentedLineModelInstance.h:245
DtSegmentedLine * myLine
Definition: DtOverlaySegmentedLineModelInstance.h:240
Model instance to draw a 3D line with styleable segments onto the 2D overlay.
Definition: DtOverlaySegmentedLineModelInstance.h:27
voidpf void uLong size
Definition: ioapi.h:39
float myEventWidth
Definition: DtOverlaySegmentedLineModelInstance.h:248
bool myVisible
Definition: DtOverlaySegmentedLineModelInstance.h:241
Contains makVrv:DtTacticalGraphicModelUpdaterManager.
bool myFixedWidthSizing
Definition: DtOverlaySegmentedLineModelInstance.h:263
LineStyle
Default line Styles.
Definition: DtTacticalGraphicUtilities.h:26
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:38
Contains makVrv::DtOsgModelInstance class.
vrvTacticalGraphicUtilities::LineStyle myLineStyle
Definition: DtOverlaySegmentedLineModelInstance.h:262
The abstract Channel Class.
Definition: DtChannel.h:35
bool myGeometryDirty
Definition: DtOverlaySegmentedLineModelInstance.h:250
Structure used to supply data to callback. Provided as structure as contents could change over time...
Definition: DtTacticalGraphicModelUpdaterManager.h:37
bool endArrow
Definition: DtOverlaySegmentedLineModelInstance.h:35
osg::Quat myRotation
Definition: DtOverlaySegmentedLineModelInstance.h:255
The base class for simple OSG based model instances. This call can&#39;t be instantiated itself...
Definition: DtOsgModelInstance.h:77
int startArrowSegments
Definition: DtOverlaySegmentedLineModelInstance.h:44
osg::Vec3d myOrigin
Definition: DtOverlaySegmentedLineModelInstance.h:254
vrvTacticalGraphicUtilities::ArrowStyle myArrowStyle
Definition: DtOverlaySegmentedLineModelInstance.h:258
ArrowStyle
Definition: DtTacticalGraphicUtilities.h:43
bool startArrow
Definition: DtOverlaySegmentedLineModelInstance.h:34
std::vector< int > mySegmentsToErase
Definition: DtOverlaySegmentedLineModelInstance.h:264
Points my2DOffsets
Definition: DtOverlaySegmentedLineModelInstance.h:236
int myStippleRepeat
Definition: DtOverlaySegmentedLineModelInstance.h:246
bool lightning
Definition: DtOverlaySegmentedLineModelInstance.h:36
int group
Definition: DtOverlaySegmentedLineModelInstance.h:33
osg::Vec4 myColor
Definition: DtOverlaySegmentedLineModelInstance.h:243
unsigned int stipplePattern
Definition: DtOverlaySegmentedLineModelInstance.h:37
int myGroup
Definition: DtOverlaySegmentedLineModelInstance.h:267
int endArrowSegments
Number of start and end arrow segments. Calculated during geometry creation.
Definition: DtOverlaySegmentedLineModelInstance.h:43
std::vector< SegmentAttributes > SegmentAttributesVector
Vector of segment information.
Definition: DtOverlaySegmentedLineModelInstance.h:48
Definition: DtOverlaySegmentedLineModelInstance.h:30
DtChannel * myChannelInstance
Definition: DtOverlaySegmentedLineModelInstance.h:266
std::vector< DtVector > Points
Definition: DtOverlaySegmentedLineModelInstance.h:50
bool myEventsEnabled
Definition: DtOverlaySegmentedLineModelInstance.h:252
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:70
A convex polygon drawn using lines.
Definition: DtSegmentedLine.h:24
bool mySegmentsDirty
Definition: DtOverlaySegmentedLineModelInstance.h:251
int stippleRepeat
Definition: DtOverlaySegmentedLineModelInstance.h:38
SegmentAttributesVector mySegmentAttributes
Definition: DtOverlaySegmentedLineModelInstance.h:238
float myWidth
Definition: DtOverlaySegmentedLineModelInstance.h:244
DtUniqueID mySceneObjectId
Definition: DtOverlaySegmentedLineModelInstance.h:231

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)