VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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/DtOsgRibbon.h>
14 
15 #include <osg/Geometry>
16 
17 namespace osg
18 {
19  class DrawElementsUInt;
20 }
21 
22 namespace makVrv
23 {
24 
25  class DtSceneObject;
26 
30  {
31  public:
32 
38  DtOsgTrackHistoryRibbon( DtDe& de, float segmentSpacing,
39  const osg::Vec4& color, float maxLength );
40 
42  virtual ~DtOsgTrackHistoryRibbon();
43 
45  virtual void traverse( osg::NodeVisitor& nv );
46 
50  virtual void setMaxSegments( long segments );
51 
52  protected:
53 
55  virtual void addParticle( osg::Vec3d const& left,
56  osg::Vec3d const& right, double simTime );
57 
59  virtual float currentSegmentLength();
60 
62  virtual void extendCurrentSegment( osg::Vec3d const& left,
63  osg::Vec3d const& right, double simTime );
64 
68  virtual osg::Drawable* getDrawable();
69 
71  virtual int particleIndexAtOffset( int offset );
72 
75  virtual void update();
76 
78  virtual void setColor( const osg::Vec4& color );
79 
84  virtual void updateBounds(const osg::Vec3& point);
85 
86  protected:
90  class TrackHistoryGeometry : public osg::Geometry
91  {
95  : public osg::Drawable::ComputeBoundingBoxCallback
96  {
97  public:
100 
103  const osg::Drawable::ComputeBoundingBoxCallback& cb,
104  const osg::CopyOp& copyop);
105 
107  virtual ~ComputeBoundsCallback();
108 
116  virtual osg::BoundingBox computeBound(const osg::Drawable& g) const;
117 
120  void dirtyBound();
121 
122  private:
123  mutable bool myDirtyBound;
124  };
125 
126  friend class ComputeBoundsCallback;
127 
128  public:
131 
134  const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
135 
137  virtual ~TrackHistoryGeometry();
138 
141  virtual void expandBoundBy(const osg::Vec3d& point);
142  };
143 
144  protected:
145 
147 
148  osg::ref_ptr<osg::Vec3Array> myPoints;
149 
150  osg::ref_ptr<DtSharedDrawElementsUInt> myRibbon;
151  osg::ref_ptr<DtSharedDrawElementsUInt> myBottomLine;
152  osg::ref_ptr<DtSharedDrawElementsUInt> myTopLine;
153 
154  osg::ref_ptr<TrackHistoryGeometry> myGeometry;
155 
157  };
158 
159 }

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)