VR-Forces 4.1 Class Documentation
DtOsgRibbon.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 
14 #include <osg/MatrixTransform>
15 #include <osg/Group>
16 #include <osg/Geode>
17 
18 namespace makVrv
19 {
20 
23  class DT_DLL_VRVOSG DtOsgRibbon : public osg::Group
24  {
25  public:
26 
28  DtOsgRibbon();
29 
34  DtOsgRibbon( float segmentSpacing, const osg::Vec4& color,
35  float maxLength = 2000 );
36 
38  virtual ~DtOsgRibbon();
39 
41  virtual void traverse( osg::NodeVisitor& nv );
42 
44  virtual osg::Node* node();
45 
47  virtual void setColor( const osg::Vec4& color );
48 
50  const osg::Vec4& color() const { return myColor; }
51 
53  virtual void setDroppedPoints( const osg::Vec3d& pointA, const osg::Vec3d& pointB );
54 
56  virtual void update( double dt, double simTime );
57 
59  virtual void update() {};
60 
62  virtual void setMaxSegments( long segments );
63 
65  inline long maxSegments() const { return myMaxSegments; }
66 
68  virtual void setSegmentSpacing( float spacing );
69 
71  inline float segmentSpacing() const { return mySegmentSpacing; }
72 
73  protected:
74 
76  virtual void addParticle( osg::Vec3d const& left, osg::Vec3d const& right,
77  double simTime ) = 0;
78 
80  virtual float currentSegmentLength() = 0;
81 
83  virtual void extendCurrentSegment( osg::Vec3d const& left,
84  osg::Vec3d const& right, double simTime ) = 0;
85 
87  virtual osg::Drawable* getDrawable() = 0;
88 
90  virtual osg::Geode* createGeode();
91 
93  virtual void setDrawable();
94 
95  private:
96 
97  osg::ref_ptr<osg::MatrixTransform> myPositionNode;
98  osg::ref_ptr<osg::Geode> myGeode;
99  osg::Matrixd myWorldTransformInv;
100  osg::Matrixd myLastLocalToWork;
101 
104 
108 
109  osg::Vec3d myLocalPointA;
110  osg::Vec3d myLocalPointB;
111 
112  osg::Vec4 myColor;
114 
115  };
116 
117 }

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)