VR-Forces 5.0.1 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) 2022 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 
27  : public DtOsgModelInstance
28  {
29  public:
30 
33  {
34  osg::Vec4 color[2];
35  bool startArrow;
36  bool endArrow;
37  bool lightning;
38  double width;
39  unsigned int stipplePattern;
41  };
42 
43  public:
44 
47 
50 
51  private:
52 
55 
58 
61 
62  public:
63 
65  virtual void setPosition( int vtx, const DtVector& position );
66 
69  virtual DtVector removePosition( int vtx );
70 
72  virtual void setWidth(float width);
73 
75  virtual void setColor(float r, float g, float b, float a);
76 
78  virtual void setStipplePattern( unsigned int pattern, int repeatFactor );
79 
82  virtual void setStyleSegments(const std::vector<double>& segmentPercentages);
83 
85  virtual void setSegmentColor(unsigned int segmentIndex,
86  float r, float g, float b, float a);
87 
89  virtual void setSegmentLightningStyle(unsigned int segmentIndex,
90  bool enableLightningStyle);
91 
93  virtual void setSegmentStartArrow(unsigned int segmentIndex,
94  bool enableArrow);
95 
97  virtual void setSegmentEndArrow(unsigned int segmentIndex,
98  bool enableArrow);
99 
102  virtual void setSegmentStipplePattern(unsigned int segmentIndex,
103  unsigned int stipplePattern, int repeatFactor);
104 
106  virtual void setSegmentWidth(unsigned int segmentWidth, double width);
107 
110  virtual void setSegmentStartColor( unsigned int segmentIndex, float r,
111  float g, float b, float a );
112 
115  virtual void setSegmentEndColor( unsigned int segmentIndex, float r,
116  float g, float b, float a );
117 
119  virtual void setTerrainIntersect(bool enabled);
120 
122  virtual void setModelSet( int modelSet );
123 
127  virtual bool realize(DtModelDefinition& definition);
128 
130  virtual void addToConnector( DtOsgSceneConnector* connector );
131 
133  virtual bool removeFromConnector( DtOsgSceneConnector* connector );
134 
136  virtual void setDepthTestEnabled(bool enabled);
137 
139  virtual void setVisible(bool isVisible);
140 
142  virtual void setPickable( bool pickable );
143 
145  bool pickable() const;
146 
148  virtual void update();
149 
151  virtual const std::vector<DtVector>& points() const;
152 
153  protected:
154 
156  virtual Dt3DLineModelInstanceSegmentInterface* createSegment();
157 
159  Dt3DLineModelInstanceSegment& lineSegment( int i);
160 
162  const Dt3DLineModelInstanceSegment& lineSegment(int i) const;
163 
165  virtual void updatePickableSegments();
166 
169  virtual void adjustSegmentVisibility( int vtx, bool visible );
170 
172  virtual void resizeSegments(int size);
173 
175  virtual void resizeSegmentAttributes(int size);
176 
178  virtual void updateGeometry();
179 
181  virtual void updateAllSegmentAttributes();
182 
183  protected:
184 
185  // These are in database coordinates - the segments are in local (line coordinates)
186  std::vector<DtVector> myVertices;
187 
190  bool myVisible;
191 
192  std::vector<double> mySegmentPercentages;
193  std::vector<Dt3DLineModelInstanceSegmentInterface*> mySegments;
194 
196 
197  // These are for use with DtOsgSegmentPickable
199 
200  double myWidth;
201  osg::Vec4 myColor;
202  unsigned int myStipplePattern;
204 
207  std::vector<SegmentAttributes> mySegmentAttributes;
208 
209  DtIntersectorsContainer* myIntersectors = nullptr;
210  };
211 }
DtOsgSegmentPickable * myPickable
Definition: Dt3DSegmentedLineModelInstance.h:198
std::vector< SegmentAttributes > mySegmentAttributes
Definition: Dt3DSegmentedLineModelInstance.h:207
std::vector< DtVector > myVertices
Definition: Dt3DSegmentedLineModelInstance.h:186
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:189
#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:36
bool mySegmentAttributesDirty
Definition: Dt3DSegmentedLineModelInstance.h:205
std::vector< Dt3DLineModelInstanceSegmentInterface * > mySegments
Definition: Dt3DSegmentedLineModelInstance.h:193
bool startArrow
Definition: Dt3DSegmentedLineModelInstance.h:35
voidpf void uLong size
Definition: ioapi.h:39
double width
Definition: Dt3DSegmentedLineModelInstance.h:38
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:37
int stippleRepeat
Definition: Dt3DSegmentedLineModelInstance.h:40
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:39
unsigned int myStipplePattern
Definition: Dt3DSegmentedLineModelInstance.h:202
std::vector< double > mySegmentPercentages
Definition: Dt3DSegmentedLineModelInstance.h:192
int myStippleRepeat
Definition: Dt3DSegmentedLineModelInstance.h:203
bool endArrow
Definition: Dt3DSegmentedLineModelInstance.h:36
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:26
osg::ref_ptr< osg::Group > myGroup
Definition: Dt3DSegmentedLineModelInstance.h:195
double myWidth
Definition: Dt3DSegmentedLineModelInstance.h:200
osg::Vec4 myColor
Definition: Dt3DSegmentedLineModelInstance.h:201
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:190
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:70
bool myTerrainIntersectMode
Definition: Dt3DSegmentedLineModelInstance.h:188
Structure to contain the line segments&#39; attributes.
Definition: Dt3DSegmentedLineModelInstance.h:32
bool myGeometryDirty
Definition: Dt3DSegmentedLineModelInstance.h:206
Dt3DLineModelInstanceSegmentInterface is an abstract class providing a common interface for line mode...
Definition: Dt3DLineModelInstanceSegmentInterface.h:30

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)