VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
makVrv::DtOsgTrackHistoryRibbon Class Reference

OSG implementation of a track history ribbon.

Inheritance diagram for makVrv::DtOsgTrackHistoryRibbon:
Inheritance graph
[legend]

Classes

struct  SegementInfo
 
class  TrackHistoryGeometry
 

Public Member Functions

virtual ~DtOsgTrackHistoryRibbon ()
 
virtual void traverse (osg::NodeVisitor &nv) override
 
virtual void setMaxSegments (long segments) override
 
virtual void setSegmentTimeout (float duration) override
 
virtual void setHeightLinesEnabled (bool enabled) override
 
virtual void setHeightLinesModelSetId (DtModelSetId modelSetId)
 
- Public Member Functions inherited from makVrv::DtOsgRibbon
 DtOsgRibbon (DtDe &de, float segmentSpacing=1.0, const osg::Vec4 &color=osg::Vec4d(0.5, 0.5, 0.5, 1.0), float maxLength=2000, float timeout=3600.0)
 
virtual ~DtOsgRibbon ()
 
virtual osg::Node * node ()
 
virtual const osg::Vec4 & color () const
 
virtual void setDroppedPoints (const osg::Vec3d &pointA, const osg::Vec3d &pointB)
 
virtual void setDroppedPointsPositionOffset (const osg::Vec3d &posOffset)
 
virtual void update (double dt, double simTime)
 
virtual long maxSegments () const
 
virtual void setSegmentSpacing (float spacing)
 
virtual float segmentSpacing () const
 
virtual void setStippled (bool stippled)
 
virtual bool isStippled () const
 
virtual void setLightingEnabled (bool enable)
 
virtual bool lightingEnabled ()
 
virtual void setHeightLinesColor (float r, float g, float b, float a)
 
virtual void setHeightLinesSpacing (float spacing)
 

Protected Member Functions

 DtOsgTrackHistoryRibbon (DtDe &de, float segmentSpacing, const osg::Vec4 &color, float maxLength, float timeout)
 
virtual void addParticle (osg::Vec3d const &left, osg::Vec3d const &right, double simTime)
 
virtual float currentSegmentLength ()
 
virtual void setCurrentSegmentLength (float len)
 
virtual void extendCurrentSegment (osg::Vec3d const &left, osg::Vec3d const &right, double simTime)
 
virtual void cleanupOldSegments (double simTime)
 
virtual osg::Drawable * getDrawable ()
 
virtual int particleIndexAtOffset (int offset)
 
virtual void update () override
 
virtual void setColor (const osg::Vec4 &color)
 
virtual void updateBounds (const osg::Vec3 &point)
 
- Protected Member Functions inherited from makVrv::DtOsgRibbon
virtual osg::Geode * createGeode ()
 
virtual void setDrawable ()
 

Protected Attributes

osg::ref_ptr< osg::Vec3Array > myPoints
 
osg::ref_ptr
< DtSharedDrawElementsUInt
myRibbon
 
osg::ref_ptr
< DtSharedDrawElementsUInt
myBottomLine
 
osg::ref_ptr
< DtSharedDrawElementsUInt
myTopLine
 
osg::ref_ptr
< TrackHistoryGeometry
myGeometry
 
std::vector< SegementInfomySegmentInfoVector
 
int myParticleIndex
 
int myParticleStartIndex
 
DtGeom3dLinesComponentmyLinesComponent
 
- Protected Attributes inherited from makVrv::DtOsgRibbon
osg::ref_ptr
< osg::MatrixTransform > 
myPositionNode
 
osg::ref_ptr< osg::Geode > myGeode
 
osg::Matrixd myWorldTransformInv
 
osg::Matrixd myLastLocalToWork
 
int myLastUpdatedFrame
 
double myLastUpdateTime
 
double myRibbonLengthSquared
 
long myMaxSegments
 
int myActiveSegmentCount
 
float mySegmentSpacingSquared
 
float mySegmentSpacing
 
float mySegmentTimeout
 
osg::Vec3d myLocalPointA
 
osg::Vec3d myLocalPointB
 
osg::Vec3d myLocalPosOffset
 
osg::Vec4 myColor
 
bool myFirstUpdate
 
bool myStippled
 
DtDemyDe
 
bool myLightingEnabled
 
bool myShaderSet
 
bool myHeightLinesEnabled
 
float myHeightLinesColor [4]
 
float myHeightLinesSpacing
 
DtModelSetId myHeightLinesModelSetId
 

Private Member Functions

 DtOsgTrackHistoryRibbon ()=delete
 
 DtOsgTrackHistoryRibbon (const DtOsgTrackHistoryRibbon &)=delete
 
DtOsgTrackHistoryRibbonoperator= (const DtOsgTrackHistoryRibbon &)=delete
 

Friends

class DtOsgTrackHistoryRibbonCreator
 

Constructor & Destructor Documentation

makVrv::DtOsgTrackHistoryRibbon::DtOsgTrackHistoryRibbon ( DtDe de,
float  segmentSpacing,
const osg::Vec4 &  color,
float  maxLength,
float  timeout 
)
protected

CTOR (create through DtOsgDecalRibbonCreator method)

Parameters
dethe DtDe the ribbon belongs to.
segmentSpacingthe spacing between segments (in meters).
colorthe color of the ribbon.
maxLengththe max length of the ribbon (in segments).
virtual makVrv::DtOsgTrackHistoryRibbon::~DtOsgTrackHistoryRibbon ( )
virtual

DTOR.

makVrv::DtOsgTrackHistoryRibbon::DtOsgTrackHistoryRibbon ( )
privatedelete

unimplemented private default constructor

makVrv::DtOsgTrackHistoryRibbon::DtOsgTrackHistoryRibbon ( const DtOsgTrackHistoryRibbon )
privatedelete

Copy Constructor not implemented – Copy not allowed.

Member Function Documentation

DtOsgTrackHistoryRibbon& makVrv::DtOsgTrackHistoryRibbon::operator= ( const DtOsgTrackHistoryRibbon )
privatedelete

Assignment Operator not implemented – Copy not allowed.

virtual void makVrv::DtOsgTrackHistoryRibbon::traverse ( osg::NodeVisitor &  nv)
overridevirtual

Override default traverse to remove update behavior.

Reimplemented from makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgTrackHistoryRibbon::setMaxSegments ( long  segments)
overridevirtual

Sets the max number of segments in the ribbon. Overridden from DtOsgRibbon to destroy the ribbon geometry and force re-creation when the max segment count changes.

Reimplemented from makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgTrackHistoryRibbon::setSegmentTimeout ( float  duration)
overridevirtual

Sets the timeout of a ribbon segment.

Reimplemented from makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgTrackHistoryRibbon::setHeightLinesEnabled ( bool  enabled)
overridevirtual

Enables or disables height lines along the ribbon path.

Reimplemented from makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgTrackHistoryRibbon::setHeightLinesModelSetId ( DtModelSetId  modelSetId)
virtual

Sets the model set that the height lines should be used with.

Reimplemented from makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgTrackHistoryRibbon::addParticle ( osg::Vec3d const &  left,
osg::Vec3d const &  right,
double  simTime 
)
protectedvirtual

Add a particle to the ribbon.

Implements makVrv::DtOsgRibbon.

virtual float makVrv::DtOsgTrackHistoryRibbon::currentSegmentLength ( )
protectedvirtual

Find the squared length of the current ribbon segment.

Implements makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgTrackHistoryRibbon::setCurrentSegmentLength ( float  len)
protectedvirtual

Set the length of the current ribbon segment.

Reimplemented from makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgTrackHistoryRibbon::extendCurrentSegment ( osg::Vec3d const &  left,
osg::Vec3d const &  right,
double  simTime 
)
protectedvirtual

Extend the current segment to left and right points.

Implements makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgTrackHistoryRibbon::cleanupOldSegments ( double  simTime)
protectedvirtual

Check to see if any segments have reached their timeout if so remove them from the list to be rendered. currently only implemented for track histories.

Implements makVrv::DtOsgRibbon.

virtual osg::Drawable* makVrv::DtOsgTrackHistoryRibbon::getDrawable ( )
protectedvirtual

Create or get the ribbon drawable. Overridden from DtOsgRibbon to create the ribbon geometry.

Returns
the ribbon geometry (creating it on first call).

Implements makVrv::DtOsgRibbon.

virtual int makVrv::DtOsgTrackHistoryRibbon::particleIndexAtOffset ( int  offset)
protectedvirtual

Get index of particle at offset from current particle.

virtual void makVrv::DtOsgTrackHistoryRibbon::update ( )
overrideprotectedvirtual

Calls DtOsgRibbon::update(double,double). Passes zero for dt and de.simulationTime as parameters.

Reimplemented from makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgTrackHistoryRibbon::setColor ( const osg::Vec4 &  color)
protectedvirtual

Change the geometry color.

Reimplemented from makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgTrackHistoryRibbon::updateBounds ( const osg::Vec3 &  point)
protectedvirtual

Update the ribbon's bounding box with a new point.

This is usually cheap, but at random intervals will do a full re-computation of the bounds, which costs O(# points).

Friends And Related Function Documentation

friend class DtOsgTrackHistoryRibbonCreator
friend

Member Data Documentation

osg::ref_ptr<osg::Vec3Array> makVrv::DtOsgTrackHistoryRibbon::myPoints
protected
osg::ref_ptr<DtSharedDrawElementsUInt> makVrv::DtOsgTrackHistoryRibbon::myRibbon
protected
osg::ref_ptr<DtSharedDrawElementsUInt> makVrv::DtOsgTrackHistoryRibbon::myBottomLine
protected
osg::ref_ptr<DtSharedDrawElementsUInt> makVrv::DtOsgTrackHistoryRibbon::myTopLine
protected
osg::ref_ptr<TrackHistoryGeometry> makVrv::DtOsgTrackHistoryRibbon::myGeometry
protected
std::vector<SegementInfo> makVrv::DtOsgTrackHistoryRibbon::mySegmentInfoVector
protected
int makVrv::DtOsgTrackHistoryRibbon::myParticleIndex
protected
int makVrv::DtOsgTrackHistoryRibbon::myParticleStartIndex
protected
DtGeom3dLinesComponent* makVrv::DtOsgTrackHistoryRibbon::myLinesComponent
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)