VR-Forces 4.1 Class Documentation
DtOsgTrackHistoryRibbon.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2012 MAK Technologies, Inc.
3 * All rights reserved.
4 *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 #include <vrvOsg/DtOsgRibbon.h>
15 
16 #include <osg/Geometry>
17 
18 namespace osg
19 {
20  class DrawElementsUInt;
21 }
22 
23 namespace makVrv
24 {
25 
26  class DtSceneObject;
27 
31  {
32  public:
33 
39  DtOsgTrackHistoryRibbon( DtDe& de, float segmentSpacing,
40  const osg::Vec4& color, float maxLength );
41 
43  virtual ~DtOsgTrackHistoryRibbon();
44 
46  virtual void traverse( osg::NodeVisitor& nv );
47 
51  virtual void setMaxSegments( long segments );
52 
53  protected:
54 
56  virtual void addParticle( osg::Vec3d const& left,
57  osg::Vec3d const& right, double simTime );
58 
60  virtual float currentSegmentLength();
61 
63  virtual void extendCurrentSegment( osg::Vec3d const& left,
64  osg::Vec3d const& right, double simTime );
65 
69  virtual osg::Drawable* getDrawable();
70 
72  virtual int particleIndexAtOffset( int offset );
73 
76  virtual void update();
77 
79  virtual void setColor( const osg::Vec4& color );
80 
85  virtual void updateBounds(const osg::Vec3& point);
86 
87  protected:
92  class TrackHistoryGeometry : public osg::Geometry
93  {
94  public:
95  virtual ~TrackHistoryGeometry() {}
96 
97  virtual void expandBoundBy(const osg::Vec3d& point)
98  {
99  _boundingBox.expandBy(point);
100  }
101  };
102 
103  protected:
104 
106 
107  osg::ref_ptr<osg::Vec3Array> myPoints;
108 
109  osg::ref_ptr<DtSharedDrawElementsUInt> myRibbon;
110  osg::ref_ptr<DtSharedDrawElementsUInt> myBottomLine;
111  osg::ref_ptr<DtSharedDrawElementsUInt> myTopLine;
112 
113  osg::ref_ptr<TrackHistoryGeometry> myGeometry;
114 
116 
117  };
118 
119 }

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)