VR-Forces 4.3.1 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/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:
91  class TrackHistoryGeometry : public osg::Geometry
92  {
96  : public osg::Drawable::ComputeBoundingBoxCallback
97  {
98  public:
101 
104  const osg::Drawable::ComputeBoundingBoxCallback& cb,
105  const osg::CopyOp& copyop);
106 
108  virtual ~ComputeBoundsCallback();
109 
117  virtual osg::BoundingBox computeBound(const osg::Drawable& g) const;
118 
121  void dirtyBound();
122 
123  private:
124  mutable bool myDirtyBound;
125  };
126 
127  friend class ComputeBoundsCallback;
128 
129  public:
132 
135  const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
136 
138  virtual ~TrackHistoryGeometry();
139 
142  virtual void expandBoundBy(const osg::Vec3d& point);
143  };
144 
145  protected:
146 
148 
149  osg::ref_ptr<osg::Vec3Array> myPoints;
150 
151  osg::ref_ptr<DtSharedDrawElementsUInt> myRibbon;
152  osg::ref_ptr<DtSharedDrawElementsUInt> myBottomLine;
153  osg::ref_ptr<DtSharedDrawElementsUInt> myTopLine;
154 
155  osg::ref_ptr<TrackHistoryGeometry> myGeometry;
156 
158  };
159 
160 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)