VR-Forces Developer's Guide
 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) 2023 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  class DtIntersectorsContainer;
23  enum class DtModelSetId;
24 
28  : public DtOsgModelInstance
29  {
30  public:
31 
34  {
35  osg::Vec4 color[2];
36  bool startArrow;
37  bool endArrow;
38  bool lightning;
39  double width;
40  unsigned int stipplePattern;
42  };
43 
44  public:
45 
48 
51 
52  private:
53 
56 
59 
62 
63  public:
64 
66  virtual void setPosition( int vtx, const DtVector& position );
67 
70  virtual DtVector removePosition( int vtx );
71 
73  virtual void setWidth(float width);
74 
76  virtual void setColor(float r, float g, float b, float a);
77 
79  virtual void setStipplePattern( unsigned int pattern, int repeatFactor );
80 
83  virtual void setStyleSegments(const std::vector<double>& segmentPercentages);
84 
86  virtual void setSegmentColor(unsigned int segmentIndex,
87  float r, float g, float b, float a);
88 
90  virtual void setSegmentLightningStyle(unsigned int segmentIndex,
91  bool enableLightningStyle);
92 
94  virtual void setSegmentStartArrow(unsigned int segmentIndex,
95  bool enableArrow);
96 
98  virtual void setSegmentEndArrow(unsigned int segmentIndex,
99  bool enableArrow);
100 
103  virtual void setSegmentStipplePattern(unsigned int segmentIndex,
104  unsigned int stipplePattern, int repeatFactor);
105 
107  virtual void setSegmentWidth(unsigned int segmentWidth, double width);
108 
111  virtual void setSegmentStartColor( unsigned int segmentIndex, float r,
112  float g, float b, float a );
113 
116  virtual void setSegmentEndColor( unsigned int segmentIndex, float r,
117  float g, float b, float a );
118 
120  virtual void setTerrainIntersect(bool enabled);
121 
123  virtual void setModelSet( DtModelSetId modelSet );
124 
128  virtual bool realize(const DtModelDefinition& definition);
129 
131  virtual void addToConnector( DtOsgSceneConnector* connector );
132 
134  virtual bool removeFromConnector( DtOsgSceneConnector* connector );
135 
137  virtual void setDepthTestEnabled(bool enabled);
138 
140  virtual void setVisible(bool isVisible);
141 
143  virtual void setPickable( bool pickable );
144 
146  bool pickable() const;
147 
149  virtual void setFadeOutDistance(float distance);
150 
152  virtual void update();
153 
155  virtual const std::vector<DtVector>& points() const;
156 
157  protected:
158 
160  virtual Dt3DLineModelInstanceSegmentInterface* createSegment();
161 
163  Dt3DLineModelInstanceSegment& lineSegment( int i);
164 
166  const Dt3DLineModelInstanceSegment& lineSegment(int i) const;
167 
169  virtual void updatePickableSegments();
170 
173  virtual void adjustSegmentVisibility( int vtx, bool visible );
174 
176  virtual void resizeSegments(int size);
177 
179  virtual void resizeSegmentAttributes(int size);
180 
182  virtual void updateGeometry();
183 
185  virtual void updateAllSegmentAttributes();
186 
187  protected:
188 
189  // These are in database coordinates - the segments are in local (line coordinates)
190  std::vector<DtVector> myVertices;
191 
194  bool myVisible;
195 
196  std::vector<double> mySegmentPercentages;
197  std::vector<Dt3DLineModelInstanceSegmentInterface*> mySegments;
198 
200 
201  // These are for use with DtOsgSegmentPickable
203 
204  double myWidth;
205  osg::Vec4 myColor;
206  unsigned int myStipplePattern;
209 
212  std::vector<SegmentAttributes> mySegmentAttributes;
213 
214  DtIntersectorsContainer* myIntersectors = nullptr;
215  };
216 }
DtOsgSegmentPickable * myPickable
Definition: Dt3DSegmentedLineModelInstance.h:202
std::vector< SegmentAttributes > mySegmentAttributes
Definition: Dt3DSegmentedLineModelInstance.h:212
std::vector< DtVector > myVertices
Definition: Dt3DSegmentedLineModelInstance.h:190
Create a series of cylinders that can be used as pickable on lines that only have osg width...
Definition: DtOsgSegmentPickable.h:23
DtModelSetId myModelSet
Definition: Dt3DSegmentedLineModelInstance.h:193
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Utility class that contains intersectors for all model sets in the system (3d, xr, 2d) Use an object of this class when all models sets can be possibly needed. When you know which model set you need, you can just use the DtIntersectorCreator to create an intersector for a model set Models sets corresponding to 3d, xr and 2d are created by default (these correspond to values of 0, 1 and 5) Additional model sets can be registered with DtIntersectorsContainer::registerModelSet.
Definition: DtIntersectorsContainer.h:37
bool mySegmentAttributesDirty
Definition: Dt3DSegmentedLineModelInstance.h:210
std::vector< Dt3DLineModelInstanceSegmentInterface * > mySegments
Definition: Dt3DSegmentedLineModelInstance.h:197
bool startArrow
Definition: Dt3DSegmentedLineModelInstance.h:36
voidpf void uLong size
Definition: ioapi.h:39
double width
Definition: Dt3DSegmentedLineModelInstance.h:39
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:44
bool lightning
Definition: Dt3DSegmentedLineModelInstance.h:38
int stippleRepeat
Definition: Dt3DSegmentedLineModelInstance.h:41
Contains makVrv::DtOsgModelInstance class.
DtOsgSceneConnector is used by models to create an OSG position/orientation transform so that it can ...
Definition: DtOsgSceneConnector.h:77
unsigned int stipplePattern
Definition: Dt3DSegmentedLineModelInstance.h:40
unsigned int myStipplePattern
Definition: Dt3DSegmentedLineModelInstance.h:206
std::vector< double > mySegmentPercentages
Definition: Dt3DSegmentedLineModelInstance.h:196
int myStippleRepeat
Definition: Dt3DSegmentedLineModelInstance.h:207
bool endArrow
Definition: Dt3DSegmentedLineModelInstance.h:37
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
The base class for simple OSG based model instances. This call can&#39;t be instantiated itself...
Definition: DtOsgModelInstance.h:77
Model instance to draw a 3D line with styleable segments.
Definition: Dt3DSegmentedLineModelInstance.h:27
osg::ref_ptr< osg::Group > myGroup
Definition: Dt3DSegmentedLineModelInstance.h:199
float myFadeDistance
Definition: Dt3DSegmentedLineModelInstance.h:208
double myWidth
Definition: Dt3DSegmentedLineModelInstance.h:204
osg::Vec4 myColor
Definition: Dt3DSegmentedLineModelInstance.h:205
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:194
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
bool myTerrainIntersectMode
Definition: Dt3DSegmentedLineModelInstance.h:192
DtModelSetId
Definition: DtModelSetEnums.h:19
Structure to contain the line segments&#39; attributes.
Definition: Dt3DSegmentedLineModelInstance.h:33
bool myGeometryDirty
Definition: Dt3DSegmentedLineModelInstance.h:211
Dt3DLineModelInstanceSegmentInterface is an abstract class providing a common interface for line mode...
Definition: Dt3DLineModelInstanceSegmentInterface.h:30

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)