![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /***************************************************************************** 00002 * Copyright (c) 2012 MAK Technologies, Inc. 00003 * All rights reserved. 00004 *****************************************************************************/ 00005 00009 00010 #pragma once 00011 00012 #include <vrvOsg/vrvOsg.h> 00013 00014 #include <vrvOsg/DtOsgRibbon.h> 00015 00016 #include <vrvOsg/DtSharedDrawElementsUInt.h> 00017 00018 namespace osg 00019 { 00020 class DrawElementsUInt; 00021 } 00022 00023 namespace makVrv 00024 { 00025 00026 class DtSceneObject; 00027 00030 class DT_DLL_VRVOSG DtOsgTrackHistoryRibbon : public DtOsgRibbon 00031 { 00032 public: 00033 00039 DtOsgTrackHistoryRibbon( DtDe& de, float segmentSpacing, 00040 const osg::Vec4& color, float maxLength ); 00041 00043 virtual ~DtOsgTrackHistoryRibbon(); 00044 00046 virtual void traverse( osg::NodeVisitor& nv ); 00047 00051 virtual void setMaxSegments( long segments ); 00052 00053 protected: 00054 00056 virtual void addParticle( osg::Vec3d const& left, 00057 osg::Vec3d const& right, double simTime ); 00058 00060 virtual float currentSegmentLength(); 00061 00063 virtual void extendCurrentSegment( osg::Vec3d const& left, 00064 osg::Vec3d const& right, double simTime ); 00065 00069 virtual osg::Drawable* getDrawable(); 00070 00072 virtual int particleIndexAtOffset( int offset ); 00073 00076 virtual void update(); 00077 00079 virtual void setColor( const osg::Vec4& color ); 00080 00081 protected: 00082 00083 DtDe& myDe; 00084 00085 osg::ref_ptr<osg::Vec3Array> myPoints; 00086 00087 osg::ref_ptr<DtSharedDrawElementsUInt> myRibbon; 00088 osg::ref_ptr<DtSharedDrawElementsUInt> myBottomLine; 00089 osg::ref_ptr<DtSharedDrawElementsUInt> myTopLine; 00090 00091 osg::ref_ptr<osg::Geometry> myGeometry; 00092 00093 int myParticleIndex; 00094 00095 }; 00096 00097 }