VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 
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 }
DtOsgSegmentPickable * myPickable
Definition: Dt3DSegmentedLineModelInstance.h:179
std::vector< SegmentAttributes > mySegmentAttributes
Definition: Dt3DSegmentedLineModelInstance.h:200
std::vector< DtVector > myVertices
Definition: Dt3DSegmentedLineModelInstance.h:167
Create a series of cylinders that can be used as pickable on lines that only have osg width...
Definition: DtOsgSegmentPickable.h:23
int myModelSet
Definition: Dt3DSegmentedLineModelInstance.h:170
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
bool mySegmentAttributesDirty
Definition: Dt3DSegmentedLineModelInstance.h:198
std::vector< Dt3DLineModelInstanceSegmentInterface * > mySegments
Definition: Dt3DSegmentedLineModelInstance.h:174
bool startArrow
Definition: Dt3DSegmentedLineModelInstance.h:190
voidpf void uLong size
Definition: ioapi.h:39
double width
Definition: Dt3DSegmentedLineModelInstance.h:193
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:33
bool lightning
Definition: Dt3DSegmentedLineModelInstance.h:192
int stippleRepeat
Definition: Dt3DSegmentedLineModelInstance.h:195
Contains makVrv::DtOsgModelInstance class.
DtOsgSceneConnector is used by models to create an OSG position/orientation transform so that it can ...
Definition: DtOsgSceneConnector.h:76
unsigned int stipplePattern
Definition: Dt3DSegmentedLineModelInstance.h:194
unsigned int myStipplePattern
Definition: Dt3DSegmentedLineModelInstance.h:184
std::vector< double > mySegmentPercentages
Definition: Dt3DSegmentedLineModelInstance.h:173
int myStippleRepeat
Definition: Dt3DSegmentedLineModelInstance.h:185
bool endArrow
Definition: Dt3DSegmentedLineModelInstance.h:191
The base class for simple OSG based model instances.
Definition: DtOsgModelInstance.h:72
Model instance to draw a 3D line with styleable segments.
Definition: Dt3DSegmentedLineModelInstance.h:25
osg::ref_ptr< osg::Group > myGroup
Definition: Dt3DSegmentedLineModelInstance.h:176
double myWidth
Structure to contain the line segments&#39; attributes.
Definition: Dt3DSegmentedLineModelInstance.h:182
osg::Vec4 myColor
Definition: Dt3DSegmentedLineModelInstance.h:183
Helper class to draw a styleable line segment; generates a geode containing the line segment geometry...
Definition: Dt3DLineModelInstanceSegment.h:24
bool myVisible
Definition: Dt3DSegmentedLineModelInstance.h:171
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
bool myTerrainIntersectMode
Definition: Dt3DSegmentedLineModelInstance.h:169
Definition: Dt3DSegmentedLineModelInstance.h:187
bool myGeometryDirty
Definition: Dt3DSegmentedLineModelInstance.h:199
Dt3DLineModelInstanceSegmentInterface is an abstract class providing a common interface for line mode...
Definition: Dt3DLineModelInstanceSegmentInterface.h:30

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)