VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Dt3DSegmentedLineModelInstance.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>
14 
15 #include <osg/Geode>
16 #include <osg/MatrixTransform>
17 
18 #include <boost/unordered_map.hpp>
19 
20 namespace makVrv
21 {
22  class Dt3DLineModelInstanceSegmentInterface;
23  class Dt3DLineModelInstanceSegment;
24  class DtOsgSegmentPickable;
25 
29  : public DtOsgModelInstance
30  {
31  public:
32 
35 
38 
40  virtual void setPosition( int vtx, const DtVector& position );
41 
44  virtual DtVector removePosition( int vtx );
45 
47  virtual void setWidth(float width);
48 
50  virtual void setColor(float r, float g, float b, float a);
51 
53  virtual void setStipplePattern( unsigned int pattern, int repeatFactor );
54 
57  virtual void setStyleSegments(const std::vector<double>& segmentPercentages);
58 
60  virtual void setSegmentColor(unsigned int segmentIndex,
61  float r, float g, float b, float a);
62 
64  virtual void setSegmentLightningStyle(unsigned int segmentIndex,
65  bool enableLightningStyle);
66 
68  virtual void setSegmentStartArrow(unsigned int segmentIndex,
69  bool enableArrow);
70 
72  virtual void setSegmentEndArrow(unsigned int segmentIndex,
73  bool enableArrow);
74 
77  virtual void setSegmentStipplePattern(unsigned int segmentIndex,
78  unsigned int stipplePattern, int repeatFactor);
79 
81  virtual void setSegmentWidth(unsigned int segmentWidth, double width);
82 
85  virtual void setSegmentStartColor( unsigned int segmentIndex, float r,
86  float g, float b, float a );
87 
90  virtual void setSegmentEndColor( unsigned int segmentIndex, float r,
91  float g, float b, float a );
92 
94  virtual void setTerrainIntersect(bool enabled);
95 
97  virtual void setModelSet( int modelSet );
98 
101  virtual bool realize(DtModelDefinition& definition);
102 
104  virtual void addToConnector( DtOsgSceneConnector* connector );
105 
107  virtual bool removeFromConnector( DtOsgSceneConnector* connector );
108 
110  virtual void setDepthTestEnabled(bool enabled);
111 
113  virtual void setVisible(bool isVisible);
114 
116  virtual void setPickable( bool pickable );
117 
119  bool pickable() const;
120 
122  virtual void update();
123 
125  virtual const std::vector<DtVector>& points() const;
126 
127  private:
128 
131 
134 
137 
138  protected:
139 
141  virtual Dt3DLineModelInstanceSegmentInterface* createSegment();
142 
144  Dt3DLineModelInstanceSegment& lineSegment( int i);
145 
147  const Dt3DLineModelInstanceSegment& lineSegment(int i) const;
148 
150  virtual void updatePickableSegments();
151 
154  virtual void adjustSegmentVisibility( int vtx, bool visible );
155 
157  virtual void resizeSegments(int size);
158 
160  virtual void resizeSegmentAttributes(int size);
161 
163  virtual void updateGeometry();
164 
166  virtual void updateAllSegmentAttributes();
167 
168  protected:
169  // These are in database coordinates - the segments are in local (line coordinates)
170  std::vector<DtVector> myVertices;
171 
174  bool myVisible;
175 
176  std::vector<double> mySegmentPercentages;
177  std::vector<Dt3DLineModelInstanceSegmentInterface*> mySegments;
178 
179  osg::ref_ptr<osg::Group> myGroup;
180 
181  // These are for use with DtOsgSegmentPickable
184 
185  double myWidth;
186  osg::Vec4 myColor;
187  unsigned int myStipplePattern;
189 
191  {
192  osg::Vec4 color[2];
194  bool endArrow;
195  bool lightning;
196  double width;
197  unsigned int stipplePattern;
199  };
200 
203  std::vector<SegmentAttributes> mySegmentAttributes;
204  };
205 }

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)