VR-Forces 4.6.1 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 
257  osg::ref_ptr<osg::Texture> myTexture;
258 
261  std::vector<int> mySegmentsToErase;
262 
264  int myGroup;
265  };
266 }

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)