VR-Forces Development_Version 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 
13 
14 #include <osg/Geode>
15 #include <osg/MatrixTransform>
16 
17 namespace makVrv
18 {
19  class Dt3DLineModelInstanceSegmentInterface;
20  class Dt3DLineModelInstanceSegment;
21  class DtOsgSegmentPickable;
22 
26  : public DtOsgModelInstance
27  {
28  public:
29 
32 
35 
37  virtual void setPosition( int vtx, const DtVector& position );
38 
41  virtual DtVector removePosition( int vtx );
42 
44  virtual void setWidth(float width);
45 
47  virtual void setColor(float r, float g, float b, float a);
48 
50  virtual void setStipplePattern( unsigned int pattern, int repeatFactor );
51 
54  virtual void setStyleSegments(const std::vector<double>& segmentPercentages);
55 
57  virtual void setSegmentColor(unsigned int segmentIndex,
58  float r, float g, float b, float a);
59 
61  virtual void setSegmentLightningStyle(unsigned int segmentIndex,
62  bool enableLightningStyle);
63 
65  virtual void setSegmentStartArrow(unsigned int segmentIndex,
66  bool enableArrow);
67 
69  virtual void setSegmentEndArrow(unsigned int segmentIndex,
70  bool enableArrow);
71 
74  virtual void setSegmentStipplePattern(unsigned int segmentIndex,
75  unsigned int stipplePattern, int repeatFactor);
76 
78  virtual void setSegmentWidth(unsigned int segmentWidth, double width);
79 
82  virtual void setSegmentStartColor( unsigned int segmentIndex, float r,
83  float g, float b, float a );
84 
87  virtual void setSegmentEndColor( unsigned int segmentIndex, float r,
88  float g, float b, float a );
89 
91  virtual void setTerrainIntersect(bool enabled);
92 
94  virtual void setModelSet( int modelSet );
95 
98  virtual bool realize(DtModelDefinition& definition);
99 
101  virtual void addToConnector( DtOsgSceneConnector* connector );
102 
104  virtual bool removeFromConnector( DtOsgSceneConnector* connector );
105 
107  virtual void setDepthTestEnabled(bool enabled);
108 
110  virtual void setVisible(bool isVisible);
111 
113  virtual void setPickable( bool pickable );
114 
116  bool pickable() const;
117 
119  virtual void update();
120 
122  virtual const std::vector<DtVector>& points() const;
123 
124  private:
125 
128 
131 
134 
135  protected:
136 
138  virtual Dt3DLineModelInstanceSegmentInterface* createSegment();
139 
141  Dt3DLineModelInstanceSegment& lineSegment( int i);
142 
144  const Dt3DLineModelInstanceSegment& lineSegment(int i) const;
145 
147  virtual void updatePickableSegments();
148 
151  virtual void adjustSegmentVisibility( int vtx, bool visible );
152 
154  virtual void resizeSegments(int size);
155 
157  virtual void resizeSegmentAttributes(int size);
158 
160  virtual void updateGeometry();
161 
163  virtual void updateAllSegmentAttributes();
164 
165  protected:
166  // These are in database coordinates - the segments are in local (line coordinates)
167  std::vector<DtVector> myVertices;
168 
171  bool myVisible;
172 
173  std::vector<double> mySegmentPercentages;
174  std::vector<Dt3DLineModelInstanceSegmentInterface*> mySegments;
175 
176  osg::ref_ptr<osg::Group> myGroup;
177 
178  // These are for use with DtOsgSegmentPickable
181 
182  double myWidth;
183  osg::Vec4 myColor;
184  unsigned int myStipplePattern;
186 
188  {
189  osg::Vec4 color[2];
191  bool endArrow;
192  bool lightning;
193  double width;
194  unsigned int stipplePattern;
196  };
197 
200  std::vector<SegmentAttributes> mySegmentAttributes;
201  };
202 }

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)