VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgTrackHistoryRibbon.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 <vrvOsg/DtOsgRibbon.h>
16 
18 
19 #include <osg/Geometry>
20 
21 namespace osg
22 {
23  class DrawElementsUInt;
24 }
25 
26 namespace makVrv
27 {
28  class DtGeom3dLinesComponent;
29  class DtSceneObject;
30 
34  {
35  protected:
42  DtOsgTrackHistoryRibbon(DtDe& de, float segmentSpacing,
43  const osg::Vec4& color, float maxLength, float timeout);
44 
46 
47  public:
49  virtual ~DtOsgTrackHistoryRibbon();
50 
51  private:
53  DtOsgTrackHistoryRibbon() = delete;;
57  DtOsgTrackHistoryRibbon &operator=(const DtOsgTrackHistoryRibbon&) = delete;;
58 
59  public:
61  virtual void traverse(osg::NodeVisitor& nv) override;
62 
66  virtual void setMaxSegments(long segments) override;
67 
69  virtual void setSegmentTimeout(float duration) override;
70 
72  virtual void setHeightLinesEnabled(bool enabled) override;
73 
75  virtual void setHeightLinesModelSetId(DtModelSetId modelSetId);
76 
77  protected:
78 
80  virtual void addParticle(osg::Vec3d const& left,
81  osg::Vec3d const& right, double simTime);
82 
84  virtual float currentSegmentLength();
86  virtual void setCurrentSegmentLength( float len );
87 
89  virtual void extendCurrentSegment(osg::Vec3d const& left,
90  osg::Vec3d const& right, double simTime);
91 
95  virtual void cleanupOldSegments(double simTime);
96 
100  virtual osg::Drawable* getDrawable();
101 
103  virtual int particleIndexAtOffset(int offset);
104 
107  virtual void update() override;
108 
110  virtual void setColor(const osg::Vec4& color);
111 
116  virtual void updateBounds(const osg::Vec3& point);
117 
118  protected:
122  class TrackHistoryGeometry : public osg::Geometry
123  {
128  {
129  public:
132 
136  const osg::CopyOp& copyop);
137 
139  virtual ~ComputeBoundsCallback();
140 
148  virtual osg::BoundingBox computeBound(const osg::Drawable& g) const;
149 
152  void dirtyBound();
153 
154  private:
155  mutable bool myDirtyBound;
156  };
157 
158  friend class ComputeBoundsCallback;
159 
160  public:
163 
166  const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
167 
169  virtual ~TrackHistoryGeometry();
170 
173  virtual void expandBoundBy(const osg::Vec3d& point);
174  };
175 
176  protected:
177 
179 
183 
185 
187  {
189  float myLength;
190  };
191  std::vector<SegementInfo> mySegmentInfoVector;
192 
195 
197  };
198 
199  //
200  // Creator for DtOsgTrackHistoryRibbons
201  //
203  {
204  public:
205 
208 
209 
212 
215  static DtOsgTrackHistoryRibbonCreator& instance(DtDe& de);
216 
219  static void registerInstance(DtDe& de, DtOsgTrackHistoryRibbonCreator* creator);
220 
222  virtual DtOsgTrackHistoryRibbon* create(DtDe& de, float segmentSpacing,
223  const osg::Vec4& color, float maxLength, float timeout);
224  };
225 }
osg::ref_ptr< DtSharedDrawElementsUInt > myTopLine
Definition: DtOsgTrackHistoryRibbon.h:182
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
Contains makVrv::DtSharedDrawElementsUInt class.
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
double mySegmentCreationTime
Definition: DtOsgTrackHistoryRibbon.h:188
int myParticleStartIndex
Definition: DtOsgTrackHistoryRibbon.h:194
Definition: DtOsgTrackHistoryRibbon.h:202
Contains makVrv::DtVirtualBaseClass class.
Bounding box computation callback. Calculates the bounding box of the current track history ribbon...
Definition: DtOsgTrackHistoryRibbon.h:126
A class which represents a component for a set of 3d lines.
Definition: DtGeom3dLinesComponent.h:51
Geometry for the track history. Allows expansion of the geometry&#39;s bounding box as the ribbon grows w...
Definition: DtOsgTrackHistoryRibbon.h:122
float myLength
Definition: DtOsgTrackHistoryRibbon.h:189
Definition: DtOsgTrackHistoryRibbon.h:186
osg::ref_ptr< DtSharedDrawElementsUInt > myRibbon
Definition: DtOsgTrackHistoryRibbon.h:180
Base class for OSG ribbon implementations.
Definition: DtOsgRibbon.h:27
DtGeom3dLinesComponent * myLinesComponent
Definition: DtOsgTrackHistoryRibbon.h:196
osg::ref_ptr< DtSharedDrawElementsUInt > myBottomLine
Definition: DtOsgTrackHistoryRibbon.h:181
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
Base class for ribbons.
DtModelSetId
Definition: DtModelSetEnums.h:19
voidpf uLong offset
Definition: ioapi.h:42
OSG implementation of a track history ribbon.
Definition: DtOsgTrackHistoryRibbon.h:33
osg::ref_ptr< TrackHistoryGeometry > myGeometry
Definition: DtOsgTrackHistoryRibbon.h:184
std::vector< SegementInfo > mySegmentInfoVector
Definition: DtOsgTrackHistoryRibbon.h:191
Contains various enum classes relating to model sets.
osg::ref_ptr< osg::Vec3Array > myPoints
Definition: DtOsgTrackHistoryRibbon.h:178
int myParticleIndex
Definition: DtOsgTrackHistoryRibbon.h:193

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)