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 update();
150 
152  virtual const std::vector<DtVector>& points() const;
153 
154  protected:
155 
157  virtual Dt3DLineModelInstanceSegmentInterface* createSegment();
158 
160  Dt3DLineModelInstanceSegment& lineSegment( int i);
161 
163  const Dt3DLineModelInstanceSegment& lineSegment(int i) const;
164 
166  virtual void updatePickableSegments();
167 
170  virtual void adjustSegmentVisibility( int vtx, bool visible );
171 
173  virtual void resizeSegments(int size);
174 
176  virtual void resizeSegmentAttributes(int size);
177 
179  virtual void updateGeometry();
180 
182  virtual void updateAllSegmentAttributes();
183 
184  protected:
185 
186  // These are in database coordinates - the segments are in local (line coordinates)
187  std::vector<DtVector> myVertices;
188 
191  bool myVisible;
192 
193  std::vector<double> mySegmentPercentages;
194  std::vector<Dt3DLineModelInstanceSegmentInterface*> mySegments;
195 
197 
198  // These are for use with DtOsgSegmentPickable
200 
201  double myWidth;
202  osg::Vec4 myColor;
203  unsigned int myStipplePattern;
205 
208  std::vector<SegmentAttributes> mySegmentAttributes;
209 
210  DtIntersectorsContainer* myIntersectors = nullptr;
211  };
212 }
DtOsgSegmentPickable * myPickable
Definition: Dt3DSegmentedLineModelInstance.h:199
std::vector< SegmentAttributes > mySegmentAttributes
Definition: Dt3DSegmentedLineModelInstance.h:208
std::vector< DtVector > myVertices
Definition: Dt3DSegmentedLineModelInstance.h:187
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:190
#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:206
std::vector< Dt3DLineModelInstanceSegmentInterface * > mySegments
Definition: Dt3DSegmentedLineModelInstance.h:194
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:42
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:203
std::vector< double > mySegmentPercentages
Definition: Dt3DSegmentedLineModelInstance.h:193
int myStippleRepeat
Definition: Dt3DSegmentedLineModelInstance.h:204
bool endArrow
Definition: Dt3DSegmentedLineModelInstance.h:37
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:196
double myWidth
Definition: Dt3DSegmentedLineModelInstance.h:201
osg::Vec4 myColor
Definition: Dt3DSegmentedLineModelInstance.h:202
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:191
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:189
DtModelSetId
Definition: DtModelSetEnums.h:19
Structure to contain the line segments&#39; attributes.
Definition: Dt3DSegmentedLineModelInstance.h:33
bool myGeometryDirty
Definition: Dt3DSegmentedLineModelInstance.h:207
Dt3DLineModelInstanceSegmentInterface is an abstract class providing a common interface for line mode...
Definition: Dt3DLineModelInstanceSegmentInterface.h:30

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)