VR-Forces 4.1 Class Documentation
DtOverlaySegmentedLineModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
16 
17 #include <osg/Texture>
18 
19 namespace makVrv
20 {
21  class DtSegmentedLine;
22  class DtChannelManager;
23  class DtChannel;
24 
29  {
30  public:
32  {
33  float width;
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 
156  virtual void setChannelInstance(DtChannel*, int modelSet);
157 
159  virtual const std::vector<DtVector>& points() const;
160 
162  virtual void setPoints(const std::vector<DtVector>&);
163 
165  virtual const SegmentAttributesVector& segmentInformation() const;
166 
170  virtual void setSegmentInformation(const SegmentAttributesVector&);
171 
172  protected:
174  virtual void updateSegmentsWithArrows(const std::vector<DtVector>& pts,
175  std::vector<DtVector>& drawPoints, std::vector<DtVector>& twodOffsets);
176 
177  private:
178 
181 
184 
187 
188  protected:
189 
191  virtual void createLineIfNecessary();
192 
194  virtual void updateSegments();
195 
197  virtual void updateGeometry();
198 
200  virtual void updateGeometryForLineStyle();
201 
203  virtual void resizeSegmentAttributes( int size );
204 
206  virtual void set3DVertexPosition( unsigned int index, double x, double y,
207  double z );
208 
210  virtual void set3DPositionAux( double x, double y, double z,
211  float tempPackedCoords[4] );
212 
214  virtual void channelUpdated(DtTacticalGraphicModelUpdaterManager::ChannelUpdateData);
215 
217  void updatePointsForLineStyle(const std::vector<DtVector>&, std::vector<DtVector>& drawPoints,
218  std::vector<DtVector>& twodOffsets, std::vector<int>& segmentsToErase) const;
219 
220  protected:
221 
223 
224  typedef std::vector<DtVector> Points;
225 
226  // These are the points as set by the model
230 
232  unsigned int myModelSet;
234  bool myVisible;
235 
236  osg::Vec4 myColor;
237  float myWidth;
238  unsigned int myStipplePattern;
240  std::vector<double> mySegmentPercentages;
242 
246 
247  osg::Vec3d myOrigin;
248  osg::Quat myRotation;
249 
250  double myArrowSize;
252 
253  osg::ref_ptr<osg::Texture> myTexture;
254 
257  std::vector<int> mySegmentsToErase;
258 
260  };
261 }

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)