VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtOverlaySegmentedLineModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 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  int group;
35  bool startArrow;
36  bool endArrow;
37  bool lightning;
38  unsigned int stipplePattern;
40  osg::Vec4 color[2];
41 
46  };
47 
49  typedef std::vector<SegmentAttributes> SegmentAttributesVector;
50 
51  public:
52 
55 
58 
60  virtual void setPosition( int vtx, const DtVector& position );
61 
63  virtual void removePosition( int vtx );
64 
66  virtual void setWidth(float width);
67 
69  virtual void setColor(float r, float g, float b, float a);
70 
72  virtual void setStipplePattern( unsigned int pattern, int repeatFactor );
73 
76  virtual void setStyleSegments(const std::vector<double>& segmentPercentages);
77 
79  virtual void setSegmentColor(unsigned int segmentIndex,
80  float r, float g, float b, float a);
81 
83  virtual void setSegmentLightningStyle(unsigned int segmentIndex,
84  bool enableLightningStyle);
85 
87  virtual void setSegmentStartArrow(unsigned int segmentIndex,
88  bool enableArrow);
89 
91  virtual void setSegmentEndArrow(unsigned int segmentIndex,
92  bool enableArrow);
93 
96  virtual void setSegmentStipplePattern(unsigned int segmentIndex,
97  unsigned int stipplePattern, int repeatFactor);
98 
100  virtual void setSegmentWidth(unsigned int segmentIndex, double width);
101 
104  virtual void setSegmentStartColor( unsigned int segmentIndex, float r,
105  float g, float b, float a );
106 
109  virtual void setSegmentEndColor( unsigned int segmentIndex, float r,
110  float g, float b, float a );
111 
114  virtual void setModelSet( int modelSet );
115 
118  virtual bool realize(DtModelDefinition& definition);
119 
121  virtual void setVisible(bool isVisible);
122 
124  virtual void setEventsEnabled( bool enabled, unsigned long long userData );
125 
127  virtual void setEventWidth(float width);
128 
130  virtual void update();
131 
133  virtual void setRotation(const osg::Quat& quat);
134 
136  virtual void setArrowSize(double);
137 
139  virtual void setLineStyle(vrvTacticalGraphicUtilities::LineStyle);
140 
142  virtual void setArrowStyle(vrvTacticalGraphicUtilities::ArrowStyle);
143 
145  virtual void setTexture(osg::Texture*);
146 
148  virtual bool isTextured() const;
149 
152  virtual void setFixedWidthSizing(bool);
153 
156  virtual void setGroup( int );
157 
161  virtual void setChannelInstance(DtChannel*, int modelSet);
162 
164  virtual const std::vector<DtVector>& points() const;
165 
167  virtual void setPoints(const std::vector<DtVector>&);
168 
170  virtual const SegmentAttributesVector& segmentInformation() const;
171 
175  virtual void setSegmentInformation(const SegmentAttributesVector&);
176 
177  protected:
179  virtual void updateSegmentsWithArrows(const std::vector<DtVector>& pts,
180  std::vector<DtVector>& drawPoints, std::vector<DtVector>& twodOffsets);
181 
182  private:
183 
186 
189 
192 
193  protected:
194 
196  virtual void createLineIfNecessary();
197 
199  virtual void updateSegments();
200 
202  virtual void updateGeometry();
203 
205  virtual void updateGeometryForLineStyle();
206 
208  virtual void resizeSegmentAttributes( int size );
209 
211  virtual void set3DVertexPosition( unsigned int index, double x, double y,
212  double z );
213 
215  virtual void set3DPositionAux( double x, double y, double z,
216  float tempPackedCoords[4] );
217 
219  virtual void channelUpdated(DtTacticalGraphicModelUpdaterManager::ChannelUpdateData);
220 
222  void updatePointsForLineStyle(const std::vector<DtVector>&, std::vector<DtVector>& drawPoints,
223  std::vector<DtVector>& twodOffsets, std::vector<int>& segmentsToErase) const;
224 
225  protected:
226 
228 
229  typedef std::vector<DtVector> Points;
230 
231  // These are the points as set by the model
235 
237  unsigned int myModelSet;
239  bool myVisible;
240 
241  osg::Vec4 myColor;
242  float myWidth;
243  unsigned int myStipplePattern;
245  std::vector<double> mySegmentPercentages;
247 
251 
252  osg::Vec3d myOrigin;
253  osg::Quat myRotation;
254 
255  double myArrowSize;
257 
258  osg::ref_ptr<osg::Texture> myTexture;
259 
262  std::vector<int> mySegmentsToErase;
263 
265  int myGroup;
266  };
267 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)