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:
41  DtOsgTrackHistoryRibbon(DtDe& de, float segmentSpacing,
42  const osg::Vec4& color, float maxLength, float timeout);
43 
45 
46  public:
48  virtual ~DtOsgTrackHistoryRibbon();
49 
50  private:
52  DtOsgTrackHistoryRibbon() = delete;;
56  DtOsgTrackHistoryRibbon &operator=(const DtOsgTrackHistoryRibbon&) = delete;;
57 
58  public:
60  virtual void traverse(osg::NodeVisitor& nv) override;
61 
65  virtual void setMaxSegments(long segments) override;
66 
68  virtual void setSegmentTimeout(float duration) override;
69 
71  virtual void setHeightLinesEnabled(bool enabled) override;
72 
74  virtual void setHeightLinesModelSetId(DtModelSetId modelSetId);
75 
76  protected:
77 
79  virtual void addParticle(osg::Vec3d const& left,
80  osg::Vec3d const& right, double simTime);
81 
83  virtual float currentSegmentLength();
85  virtual void setCurrentSegmentLength( float len );
86 
88  virtual void extendCurrentSegment(osg::Vec3d const& left,
89  osg::Vec3d const& right, double simTime);
90 
94  virtual void cleanupOldSegments(double simTime);
95 
99  virtual osg::Drawable* getDrawable();
100 
102  virtual int particleIndexAtOffset(int offset);
103 
106  virtual void update() override;
107 
109  virtual void setColor(const osg::Vec4& color);
110 
115  virtual void updateBounds(const osg::Vec3& point);
116 
117  protected:
121  class TrackHistoryGeometry : public osg::Geometry
122  {
127  {
128  public:
131 
135  const osg::CopyOp& copyop);
136 
138  virtual ~ComputeBoundsCallback();
139 
147  virtual osg::BoundingBox computeBound(const osg::Drawable& g) const;
148 
151  void dirtyBound();
152 
153  private:
154  mutable bool myDirtyBound;
155  };
156 
157  friend class ComputeBoundsCallback;
158 
159  public:
162 
165  const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
166 
168  virtual ~TrackHistoryGeometry();
169 
172  virtual void expandBoundBy(const osg::Vec3d& point);
173  };
174 
175  protected:
176 
178 
182 
184 
186  {
188  float myLength;
189  };
190  std::vector<SegementInfo> mySegmentInfoVector;
191 
194 
196  };
197 
198  //
199  // Creator for DtOsgTrackHistoryRibbons
200  //
202  {
203  public:
204 
207 
208 
211 
214  static DtOsgTrackHistoryRibbonCreator& instance(DtDe& de);
215 
218  static void registerInstance(DtDe& de, DtOsgTrackHistoryRibbonCreator* creator);
219 
221  virtual DtOsgTrackHistoryRibbon* create(DtDe& de, float segmentSpacing,
222  const osg::Vec4& color, float maxLength, float timeout);
223  };
224 }
osg::ref_ptr< DtSharedDrawElementsUInt > myTopLine
Definition: DtOsgTrackHistoryRibbon.h:181
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:187
int myParticleStartIndex
Definition: DtOsgTrackHistoryRibbon.h:193
Definition: DtOsgTrackHistoryRibbon.h:201
Contains makVrv::DtVirtualBaseClass class.
Bounding box computation callback. Calculates the bounding box of the current track history ribbon...
Definition: DtOsgTrackHistoryRibbon.h:125
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:121
float myLength
Definition: DtOsgTrackHistoryRibbon.h:188
Definition: DtOsgTrackHistoryRibbon.h:185
osg::ref_ptr< DtSharedDrawElementsUInt > myRibbon
Definition: DtOsgTrackHistoryRibbon.h:179
Base class for OSG ribbon implementations.
Definition: DtOsgRibbon.h:27
DtGeom3dLinesComponent * myLinesComponent
Definition: DtOsgTrackHistoryRibbon.h:195
osg::ref_ptr< DtSharedDrawElementsUInt > myBottomLine
Definition: DtOsgTrackHistoryRibbon.h:180
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:72
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:183
std::vector< SegementInfo > mySegmentInfoVector
Definition: DtOsgTrackHistoryRibbon.h:190
Contains various enum classes relating to model sets.
osg::ref_ptr< osg::Vec3Array > myPoints
Definition: DtOsgTrackHistoryRibbon.h:177
int myParticleIndex
Definition: DtOsgTrackHistoryRibbon.h:192

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)