VR-Forces 4.8 Class Documentation
 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) 2015 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  public:
51 
54 
57 
59  virtual void setPosition( int vtx, const DtVector& position );
60 
62  virtual void removePosition( int vtx );
63 
65  virtual void setWidth(float width);
66 
68  virtual void setColor(float r, float g, float b, float a);
69 
71  virtual void setStipplePattern( unsigned int pattern, int repeatFactor );
72 
75  virtual void setStyleSegments(const std::vector<double>& segmentPercentages);
76 
78  virtual void setSegmentColor(unsigned int segmentIndex,
79  float r, float g, float b, float a);
80 
82  virtual void setSegmentLightningStyle(unsigned int segmentIndex,
83  bool enableLightningStyle);
84 
86  virtual void setSegmentStartArrow(unsigned int segmentIndex,
87  bool enableArrow);
88 
90  virtual void setSegmentEndArrow(unsigned int segmentIndex,
91  bool enableArrow);
92 
95  virtual void setSegmentStipplePattern(unsigned int segmentIndex,
96  unsigned int stipplePattern, int repeatFactor);
97 
99  virtual void setSegmentWidth(unsigned int segmentIndex, double width);
100 
103  virtual void setSegmentStartColor( unsigned int segmentIndex, float r,
104  float g, float b, float a );
105 
108  virtual void setSegmentEndColor( unsigned int segmentIndex, float r,
109  float g, float b, float a );
110 
113  virtual void setModelSet( int modelSet );
114 
117  virtual bool realize(DtModelDefinition& definition);
118 
120  virtual void setVisible(bool isVisible);
121 
123  virtual void setEventsEnabled( bool enabled, unsigned long long userData );
124 
126  virtual void setEventWidth(float width);
127 
129  virtual void update();
130 
132  virtual void setRotation(const osg::Quat& quat);
133 
135  virtual void setArrowSize(double);
136 
138  virtual void setLineStyle(vrvTacticalGraphicUtilities::LineStyle);
139 
141  virtual void setArrowStyle(vrvTacticalGraphicUtilities::ArrowStyle);
142 
144  virtual void setTexture(osg::Texture*);
145 
147  virtual bool isTextured() const;
148 
151  virtual void setFixedWidthSizing(bool);
152 
155  virtual void setGroup( int );
156 
160  virtual void setChannelInstance(DtChannel*, int modelSet);
161 
163  virtual const std::vector<DtVector>& points() const;
164 
166  virtual void setPoints(const std::vector<DtVector>&);
167 
169  virtual const SegmentAttributesVector& segmentInformation() const;
170 
174  virtual void setSegmentInformation(const SegmentAttributesVector&);
175 
177  virtual void updateGeometry();
178 
179  protected:
181  virtual void updateSegmentsWithArrows(const std::vector<DtVector>& pts,
182  std::vector<DtVector>& drawPoints, std::vector<DtVector>& twodOffsets);
183 
184  private:
185 
188 
191 
194 
195  protected:
196 
198  virtual void createLineIfNecessary();
199 
201  virtual void updateSegments();
202 
204  virtual void updateGeometryForLineStyle();
205 
207  virtual void resizeSegmentAttributes( int size );
208 
210  virtual void set3DVertexPosition( unsigned int index, double x, double y,
211  double z );
212 
214  virtual void set3DPositionAux( double x, double y, double z,
215  float tempPackedCoords[4] );
216 
218  virtual void channelUpdated(const DtTacticalGraphicModelUpdaterManager::ChannelUpdateData&);
219 
221  void updatePointsForLineStyle(const std::vector<DtVector>&, std::vector<DtVector>& drawPoints,
222  std::vector<DtVector>& twodOffsets, std::vector<int>& segmentsToErase) const;
223 
224  protected:
225 
227 
228  typedef std::vector<DtVector> Points;
229 
230  // These are the points as set by the model
234 
236  unsigned int myModelSet;
238  bool myVisible;
239 
240  osg::Vec4 myColor;
241  float myWidth;
242  unsigned int myStipplePattern;
244  std::vector<double> mySegmentPercentages;
246 
250 
251  osg::Vec3d myOrigin;
252  osg::Quat myRotation;
253 
254  double myArrowSize;
256 
258 
261  std::vector<int> mySegmentsToErase;
262 
264  int myGroup;
265  };
266 }
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
Points myVertices
Definition: DtOverlaySegmentedLineModelInstance.h:232
osg::ref_ptr< osg::Texture > myTexture
Definition: DtOverlaySegmentedLineModelInstance.h:257
std::vector< double > mySegmentPercentages
Definition: DtOverlaySegmentedLineModelInstance.h:244
float width
Definition: DtOverlaySegmentedLineModelInstance.h:32
unsigned int myModelSet
Definition: DtOverlaySegmentedLineModelInstance.h:236
double myArrowSize
Definition: DtOverlaySegmentedLineModelInstance.h:254
Points myPoints
Definition: DtOverlaySegmentedLineModelInstance.h:231
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
unsigned int myStipplePattern
Definition: DtOverlaySegmentedLineModelInstance.h:242
DtSegmentedLine * myLine
Definition: DtOverlaySegmentedLineModelInstance.h:237
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:245
bool myVisible
Definition: DtOverlaySegmentedLineModelInstance.h:238
Contains makVrv:DtTacticalGraphicModelUpdaterManager.
bool myFixedWidthSizing
Definition: DtOverlaySegmentedLineModelInstance.h:260
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:33
Contains makVrv::DtOsgModelInstance class.
vrvTacticalGraphicUtilities::LineStyle myLineStyle
Definition: DtOverlaySegmentedLineModelInstance.h:259
The abstract Channel Class.
Definition: DtChannel.h:29
bool myGeometryDirty
Definition: DtOverlaySegmentedLineModelInstance.h:247
Structure used to supply data to callback.
Definition: DtTacticalGraphicModelUpdaterManager.h:35
bool endArrow
Definition: DtOverlaySegmentedLineModelInstance.h:35
osg::Quat myRotation
Definition: DtOverlaySegmentedLineModelInstance.h:252
The base class for simple OSG based model instances.
Definition: DtOsgModelInstance.h:72
int startArrowSegments
Definition: DtOverlaySegmentedLineModelInstance.h:44
osg::Vec3d myOrigin
Definition: DtOverlaySegmentedLineModelInstance.h:251
vrvTacticalGraphicUtilities::ArrowStyle myArrowStyle
Definition: DtOverlaySegmentedLineModelInstance.h:255
ArrowStyle
Definition: DtTacticalGraphicUtilities.h:43
bool startArrow
Definition: DtOverlaySegmentedLineModelInstance.h:34
std::vector< int > mySegmentsToErase
Definition: DtOverlaySegmentedLineModelInstance.h:261
Points my2DOffsets
Definition: DtOverlaySegmentedLineModelInstance.h:233
int myStippleRepeat
Definition: DtOverlaySegmentedLineModelInstance.h:243
bool lightning
Definition: DtOverlaySegmentedLineModelInstance.h:36
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
int group
Definition: DtOverlaySegmentedLineModelInstance.h:33
osg::Vec4 myColor
Definition: DtOverlaySegmentedLineModelInstance.h:240
unsigned int stipplePattern
Definition: DtOverlaySegmentedLineModelInstance.h:37
int myGroup
Definition: DtOverlaySegmentedLineModelInstance.h:264
int endArrowSegments
Number of start and end arrow segments.
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:263
std::vector< DtVector > Points
Definition: DtOverlaySegmentedLineModelInstance.h:228
bool myEventsEnabled
Definition: DtOverlaySegmentedLineModelInstance.h:249
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
A convex polygon drawn using lines.
Definition: DtSegmentedLine.h:24
bool mySegmentsDirty
Definition: DtOverlaySegmentedLineModelInstance.h:248
int stippleRepeat
Definition: DtOverlaySegmentedLineModelInstance.h:38
SegmentAttributesVector mySegmentAttributes
Definition: DtOverlaySegmentedLineModelInstance.h:235
float myWidth
Definition: DtOverlaySegmentedLineModelInstance.h:241
DtUniqueID mySceneObjectId
Definition: DtOverlaySegmentedLineModelInstance.h:226

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)