VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgOverlayDirectionLineModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
17 
18 namespace makVrv
19 {
20  class DtLineSegment;
21  enum class DtModelSetId;
22 
25 
28 
30  template <>
31  inline const char* creatorTypeName<DtOsgOverlayDirectionLineModelInstance>(void) { return "DtOsgOverlayDirectionLineModelInstanceCreator"; }
32 
36  : public DtOsgModelInstance
37  {
39 
40  public:
41 
44 
47 
50  const DtOsgOverlayDirectionLineModelInstance &other) = delete;
51 
54  const DtOsgOverlayDirectionLineModelInstance &other) = delete;
55 
56  public:
57 
59  virtual void setVisible(bool);
60 
62  virtual void setModelSet( DtModelSetId modelSet );
63 
70  virtual void addPoint(const DtVector& position, int index = -1);
71 
73  virtual void setPosition(int index, const DtVector& position);
74 
76  virtual void setStipplePattern(unsigned int stipple);
77 
79  virtual void setColor(float r, float g, float b, float a);
80 
82  virtual void setWidth(float width);
83 
85  virtual void setEventsEnabled(bool, unsigned long long userData);
86 
88  virtual const std::vector<DtVector>& points() const;
89 
91  bool eventsEnabled() const;
92 
94  virtual void setPositionOffset(const DtVector&);
95 
97  virtual void setDirection( int index, const DtVector& direction );
98 
102  virtual void setScale(int index, float scale);
103 
106  virtual void setLength( int index, float length );
107 
109  virtual void setAltitudeBasedConfigurations(
111 
116  virtual void clearAltitudeBasedConfigurations();
117 
127  virtual void setIsUseForcedAltitudeEnabled(bool enabled);
128 
133  virtual void setForcedAltitudeToUse(double minimumAltitudeForUse);
134 
137  virtual void setLodOutAltitude(double lodOutAltitude);
138 
140  virtual void setIsLodOutAltitudeEnabled(bool isLodOutAltitudeEnabled);
141 
143  virtual void setIsArrowHeadEnabled(bool isArrowHeadEnabled);
144 
147  virtual void setLineOutlined(bool isOutlined, float r, float g, float b, float a);
148 
150  virtual void update();
151 
155  virtual void setGroup( int );
156 
159  virtual bool realize(const DtModelDefinition& definition);
160 
161 
162  protected:
166 
168  virtual void createLineIfNecessary();
169 
172  virtual void createArrowSpokesIfNecessary();
173 
176  virtual void createOutlineSegmentsIfNecessary();
177 
179  void deleteOutlineSegments();
180 
182  virtual void updateAttributes();
183 
185  virtual void updateGeometry();
186 
188  virtual void updateArrowHeadSpokes();
189 
191  virtual void updateAltitudeSpecificConfigurations();
192 
194  virtual void set3DVertexPosition( unsigned int index, double x, double y, double z );
195 
196  protected:
197 
199  {
201  : direction()
202  , length(0.0f)
203  {
204  }
205 
206  DtVector direction;
207  float length;
208  };
209 
210  std::vector<DtVector> myPoints;
211  DirectionAttributes myDirections[2];
215 
217  DtLineSegment* myArrowSpokes[2];
218 
221 
225  DtLineSegment* myOutlineArrowSpokes[2];
227  osg::Vec4 myOutlineColor;
228 
229  osg::Vec4 myColor;
230  float myWidth;
231  unsigned int myStipplePattern;
232 
236 
239  unsigned long long myUserData;
240 
242  int myGroup;
243 
246  };
247 }
248 
249 
Model instance to draw a 2D line with styleable segments.
Definition: DtOsgOverlayDirectionLineModelInstance.h:35
std::vector< DtDirectionLineAltitudeBasedConfiguration > DtDirectionLineAltitudeBasedConfigurationCollection
A collection of altitude-based configurations.
Definition: DtOverlayDirectionLineModel.h:87
DtLineSegment * myLine
Definition: DtOsgOverlayDirectionLineModelInstance.h:214
double length(const dvec3 &theVec)
Definition: DtVecUtils.h:20
DtModelSetId myModelSet
Definition: DtOsgOverlayDirectionLineModelInstance.h:213
DtVector myPositionOffset
Definition: DtOsgOverlayDirectionLineModelInstance.h:241
DtVector direction
Definition: DtOsgOverlayDirectionLineModelInstance.h:206
DtLineSegment * myOutlineLine
Outline duplicates drawn slightly wider one group behind the line and arrow head spokes.
Definition: DtOsgOverlayDirectionLineModelInstance.h:224
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
double myLodOutAltitude
Definition: DtOsgOverlayDirectionLineModelInstance.h:244
bool myIsLodOutAltitudeEnabled
Definition: DtOsgOverlayDirectionLineModelInstance.h:245
osg::Vec4 myColor
Definition: DtOsgOverlayDirectionLineModelInstance.h:229
bool myVisibleFlag
Definition: DtOsgOverlayDirectionLineModelInstance.h:238
bool myAttributesDirty
Definition: DtOsgOverlayDirectionLineModelInstance.h:234
bool myIsArrowHeadEnabled
Whether the arrow head spokes are drawn at the tip of the line.
Definition: DtOsgOverlayDirectionLineModelInstance.h:220
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:44
osg::Vec4 myOutlineColor
Definition: DtOsgOverlayDirectionLineModelInstance.h:227
Contains makVrv::DtOsgModelInstance class.
std::vector< DtVector > myPoints
Definition: DtOsgOverlayDirectionLineModelInstance.h:210
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
bool myEventsEnabled
Definition: DtOsgOverlayDirectionLineModelInstance.h:237
float myWidth
Definition: DtOsgOverlayDirectionLineModelInstance.h:230
A class which represents a single line segment.
Definition: DtLineSegment.h:23
The base class for simple OSG based model instances. This call can&#39;t be instantiated itself...
Definition: DtOsgModelInstance.h:77
DirectionAttributes()
Definition: DtOsgOverlayDirectionLineModelInstance.h:200
const char * creatorTypeName< DtOsgOverlayDirectionLineModelInstance >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtOsgOverlayDirectionLineModelInstance.h:31
unsigned long long myUserData
Definition: DtOsgOverlayDirectionLineModelInstance.h:239
bool myGeometryDirty
Definition: DtOsgOverlayDirectionLineModelInstance.h:233
Contains declaration of DtOverlayDirectionLineModel, which draws direction lines in an overlay layer ...
DtOverlayDirectionLineModel::DtDirectionLineAltitudeBasedConfigurationCollection myAltitudeSpecificConfigurations
Definition: DtOsgOverlayDirectionLineModelInstance.h:212
unsigned int myStipplePattern
Definition: DtOsgOverlayDirectionLineModelInstance.h:231
Contains DLL export macros.
bool myIsLineOutlined
Definition: DtOsgOverlayDirectionLineModelInstance.h:226
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
DtModelSetId
Definition: DtModelSetEnums.h:19
float length
Definition: DtOsgOverlayDirectionLineModelInstance.h:207
Definition: DtOsgOverlayDirectionLineModelInstance.h:198
friend DtOsgOverlayDirectionLineModelInstanceCreator
Definition: DtOsgOverlayDirectionLineModelInstance.h:38
int myGroup
Definition: DtOsgOverlayDirectionLineModelInstance.h:242
DtVirtualBaseClassCreator< DtOsgOverlayDirectionLineModelInstance > DtOsgOverlayDirectionLineModelInstanceCreator
creator
Definition: DtOsgOverlayDirectionLineModelInstance.h:24
bool myAltitudeSpecificConfigurationsDirty
Definition: DtOsgOverlayDirectionLineModelInstance.h:235

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)