VR-Forces 4.10 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) 2020 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  {
33  osg::Vec4 color[2];
34  bool startArrow;
35  bool endArrow;
36  bool lightning;
37  double width;
38  unsigned int stipplePattern;
40  };
41 
42  public:
43 
46 
49 
50  private:
51 
54 
57 
60 
61  public:
62 
64  virtual void setPosition( int vtx, const DtVector& position );
65 
68  virtual DtVector removePosition( int vtx );
69 
71  virtual void setWidth(float width);
72 
74  virtual void setColor(float r, float g, float b, float a);
75 
77  virtual void setStipplePattern( unsigned int pattern, int repeatFactor );
78 
81  virtual void setStyleSegments(const std::vector<double>& segmentPercentages);
82 
84  virtual void setSegmentColor(unsigned int segmentIndex,
85  float r, float g, float b, float a);
86 
88  virtual void setSegmentLightningStyle(unsigned int segmentIndex,
89  bool enableLightningStyle);
90 
92  virtual void setSegmentStartArrow(unsigned int segmentIndex,
93  bool enableArrow);
94 
96  virtual void setSegmentEndArrow(unsigned int segmentIndex,
97  bool enableArrow);
98 
101  virtual void setSegmentStipplePattern(unsigned int segmentIndex,
102  unsigned int stipplePattern, int repeatFactor);
103 
105  virtual void setSegmentWidth(unsigned int segmentWidth, double width);
106 
109  virtual void setSegmentStartColor( unsigned int segmentIndex, float r,
110  float g, float b, float a );
111 
114  virtual void setSegmentEndColor( unsigned int segmentIndex, float r,
115  float g, float b, float a );
116 
118  virtual void setTerrainIntersect(bool enabled);
119 
121  virtual void setModelSet( int modelSet );
122 
126  virtual bool realize(DtModelDefinition& definition);
127 
129  virtual void addToConnector( DtOsgSceneConnector* connector );
130 
132  virtual bool removeFromConnector( DtOsgSceneConnector* connector );
133 
135  virtual void setDepthTestEnabled(bool enabled);
136 
138  virtual void setVisible(bool isVisible);
139 
141  virtual void setPickable( bool pickable );
142 
144  bool pickable() const;
145 
147  virtual void update();
148 
150  virtual const std::vector<DtVector>& points() const;
151 
152  protected:
153 
155  virtual Dt3DLineModelInstanceSegmentInterface* createSegment();
156 
158  Dt3DLineModelInstanceSegment& lineSegment( int i);
159 
161  const Dt3DLineModelInstanceSegment& lineSegment(int i) const;
162 
164  virtual void updatePickableSegments();
165 
168  virtual void adjustSegmentVisibility( int vtx, bool visible );
169 
171  virtual void resizeSegments(int size);
172 
174  virtual void resizeSegmentAttributes(int size);
175 
177  virtual void updateGeometry();
178 
180  virtual void updateAllSegmentAttributes();
181 
182  protected:
183 
184  // These are in database coordinates - the segments are in local (line coordinates)
185  std::vector<DtVector> myVertices;
186 
189  bool myVisible;
190 
191  std::vector<double> mySegmentPercentages;
192  std::vector<Dt3DLineModelInstanceSegmentInterface*> mySegments;
193 
195 
196  // These are for use with DtOsgSegmentPickable
198 
199  double myWidth;
200  osg::Vec4 myColor;
201  unsigned int myStipplePattern;
203 
206  std::vector<SegmentAttributes> mySegmentAttributes;
207  };
208 }
DtOsgSegmentPickable * myPickable
Definition: Dt3DSegmentedLineModelInstance.h:197
std::vector< SegmentAttributes > mySegmentAttributes
Definition: Dt3DSegmentedLineModelInstance.h:206
std::vector< DtVector > myVertices
Definition: Dt3DSegmentedLineModelInstance.h:185
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:188
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
bool mySegmentAttributesDirty
Definition: Dt3DSegmentedLineModelInstance.h:204
std::vector< Dt3DLineModelInstanceSegmentInterface * > mySegments
Definition: Dt3DSegmentedLineModelInstance.h:192
bool startArrow
Definition: Dt3DSegmentedLineModelInstance.h:34
voidpf void uLong size
Definition: ioapi.h:39
double width
Definition: Dt3DSegmentedLineModelInstance.h:37
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:38
bool lightning
Definition: Dt3DSegmentedLineModelInstance.h:36
int stippleRepeat
Definition: Dt3DSegmentedLineModelInstance.h:39
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:38
unsigned int myStipplePattern
Definition: Dt3DSegmentedLineModelInstance.h:201
std::vector< double > mySegmentPercentages
Definition: Dt3DSegmentedLineModelInstance.h:191
int myStippleRepeat
Definition: Dt3DSegmentedLineModelInstance.h:202
bool endArrow
Definition: Dt3DSegmentedLineModelInstance.h:35
The base class for simple OSG based model instances.
Definition: DtOsgModelInstance.h:76
Model instance to draw a 3D line with styleable segments.
Definition: Dt3DSegmentedLineModelInstance.h:25
osg::ref_ptr< osg::Group > myGroup
Definition: Dt3DSegmentedLineModelInstance.h:194
double myWidth
Definition: Dt3DSegmentedLineModelInstance.h:199
osg::Vec4 myColor
Definition: Dt3DSegmentedLineModelInstance.h:200
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:189
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
bool myTerrainIntersectMode
Definition: Dt3DSegmentedLineModelInstance.h:187
Structure to contain the line segments&#39; attributes.
Definition: Dt3DSegmentedLineModelInstance.h:31
bool myGeometryDirty
Definition: Dt3DSegmentedLineModelInstance.h:205
Dt3DLineModelInstanceSegmentInterface is an abstract class providing a common interface for line mode...
Definition: Dt3DLineModelInstanceSegmentInterface.h:30

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)