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

Base class for OSG ribbon implementations.

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

Public Member Functions

 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 void traverse (osg::NodeVisitor &nv)
 
virtual osg::Node * node ()
 
virtual void setColor (const osg::Vec4 &color)
 
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 void update ()
 
virtual void setMaxSegments (long segments)
 
virtual long maxSegments () const
 
virtual void setSegmentSpacing (float spacing)
 
virtual void setSegmentTimeout (float duration)
 
virtual float segmentSpacing () const
 
virtual void setStippled (bool stippled)
 
virtual bool isStippled () const
 
virtual void setLightingEnabled (bool enable)
 
virtual bool lightingEnabled ()
 

Protected Member Functions

virtual void addParticle (osg::Vec3d const &left, osg::Vec3d const &right, double simTime)=0
 
virtual float currentSegmentLength ()=0
 
virtual void cleanupOldSegments (double simTime)=0
 
virtual void extendCurrentSegment (osg::Vec3d const &left, osg::Vec3d const &right, double simTime)=0
 
virtual osg::Drawable * getDrawable ()=0
 
virtual osg::Geode * createGeode ()
 
virtual void setDrawable ()
 

Protected Attributes

osg::ref_ptr
< osg::MatrixTransform > 
myPositionNode
 
osg::ref_ptr< osg::Geode > myGeode
 
osg::Matrixd myWorldTransformInv
 
osg::Matrixd myLastLocalToWork
 
int myLastUpdatedFrame
 
double myLastUpdateTime
 
long myMaxSegments
 
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
 

Private Member Functions

 DtOsgRibbon ()=delete
 
 DtOsgRibbon (const DtOsgRibbon &)=delete
 
DtOsgRibbonoperator= (const DtOsgRibbon &)=delete
 

Constructor & Destructor Documentation

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 
)

CTOR.

Parameters
segmentSpacingthe distance between samples points (in meters).
colorthe color of the ribbon.
maxLengththe max length of the ribbon (in samples).
virtual makVrv::DtOsgRibbon::~DtOsgRibbon ( )
virtual

DTOR.

makVrv::DtOsgRibbon::DtOsgRibbon ( )
privatedelete

unimplemented private default constructor

makVrv::DtOsgRibbon::DtOsgRibbon ( const DtOsgRibbon )
privatedelete

Copy Constructor not implemented – Copy not allowed.

Member Function Documentation

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

Assignment Operator not implemented – Copy not allowed.

virtual void makVrv::DtOsgRibbon::traverse ( osg::NodeVisitor &  nv)
virtual

Interrupt CullVisitors by updating the ribbon.

Reimplemented in makVrv::DtOsgTrackHistoryRibbon.

virtual osg::Node* makVrv::DtOsgRibbon::node ( )
virtual

Get the osg geometry node associated with the ribbon.

Reimplemented in makVrv::DtOsgMultiRibbon.

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

Set the ribbon's color.

Reimplemented in makVrv::DtOsgTrackHistoryRibbon.

virtual const osg::Vec4& makVrv::DtOsgRibbon::color ( void  ) const
inlinevirtual

Get the ribbon's color.

virtual void makVrv::DtOsgRibbon::setDroppedPoints ( const osg::Vec3d &  pointA,
const osg::Vec3d &  pointB 
)
virtual

Set the points to drop in local coordinates.

virtual void makVrv::DtOsgRibbon::setDroppedPointsPositionOffset ( const osg::Vec3d &  posOffset)
virtual

Provide an offset to the dropped points so the entity can shift around the points specified in the model definition ex. 5 ton truck can offset so front wheels leave tracks.

Reimplemented in makVrv::DtOsgMultiRibbon.

virtual void makVrv::DtOsgRibbon::update ( double  dt,
double  simTime 
)
virtual

Update the ribbon with the current position.

Reimplemented in makVrv::DtOsgMultiRibbon, and makVrv::DtOsgParticleRibbon.

virtual void makVrv::DtOsgRibbon::update ( )
virtual

Optional time independent update method.

nop for now

Reimplemented in makVrv::DtOsgTrackHistoryRibbon.

virtual void makVrv::DtOsgRibbon::setMaxSegments ( long  segments)
virtual

Sets the maximum number of segments allowed in the ribbon.

Reimplemented in makVrv::DtOsgTrackHistoryRibbon.

virtual long makVrv::DtOsgRibbon::maxSegments ( ) const
inlinevirtual

Gets the maximum number of segments allowed in the ribbon.

virtual void makVrv::DtOsgRibbon::setSegmentSpacing ( float  spacing)
virtual

Sets the maximum length of ribbon segments.

virtual void makVrv::DtOsgRibbon::setSegmentTimeout ( float  duration)
virtual

Sets the timeout of a ribbon segment.

virtual float makVrv::DtOsgRibbon::segmentSpacing ( ) const
inlinevirtual

Gets the maximum length of the ribbon segments.

virtual void makVrv::DtOsgRibbon::setStippled ( bool  stippled)
virtual
Parameters
[in]stippledis a flag to use a stipple pattern instead of alpha blending. When true, the ribbon is considered opaque and the stipple pattern allows see through. When false, the ribbon is considered transparent and alpha blending allows see through.
virtual bool makVrv::DtOsgRibbon::isStippled ( ) const
inlinevirtual

Get the stipple setting for this ribbon.

Return values
trueif stippled.
falseotherwise.
See Also
setStippled(bool)
virtual void makVrv::DtOsgRibbon::setLightingEnabled ( bool  enable)
virtual

set to true the lighting enabled flag to turn lighting on for the ribbon

virtual bool makVrv::DtOsgRibbon::lightingEnabled ( )
virtual

get the lighting enabled flag

virtual void makVrv::DtOsgRibbon::addParticle ( osg::Vec3d const &  left,
osg::Vec3d const &  right,
double  simTime 
)
protectedpure virtual
virtual float makVrv::DtOsgRibbon::currentSegmentLength ( )
protectedpure virtual

Find the length of the current ribbon segment.

Implemented in makVrv::DtOsgParticleRibbon, makVrv::DtOsgTrackHistoryRibbon, makVrv::DtOsgMultiRibbon, and makVrv::DtOsgDecalRibbon.

virtual void makVrv::DtOsgRibbon::cleanupOldSegments ( double  simTime)
protectedpure virtual

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.

Implemented in makVrf::DtVrfOsgTrackHistoryRibbon, makVrv::DtOsgParticleRibbon, makVrv::DtOsgTrackHistoryRibbon, makVrv::DtOsgMultiRibbon, and makVrv::DtOsgDecalRibbon.

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

Extend the current segment to left and right points.

Implemented in makVrv::DtOsgParticleRibbon, makVrv::DtOsgMultiRibbon, makVrv::DtOsgTrackHistoryRibbon, and makVrv::DtOsgDecalRibbon.

virtual osg::Drawable* makVrv::DtOsgRibbon::getDrawable ( )
protectedpure virtual

Get the drawable responsible for drawing the ribbon.

Implemented in makVrv::DtOsgParticleRibbon, makVrv::DtOsgTrackHistoryRibbon, makVrv::DtOsgMultiRibbon, and makVrv::DtOsgDecalRibbon.

virtual osg::Geode* makVrv::DtOsgRibbon::createGeode ( )
protectedvirtual

Create function for creating the geode for drawing this ribbon.

Reimplemented in makVrv::DtOsgParticleRibbon, and makVrv::DtOsgDecalRibbon.

virtual void makVrv::DtOsgRibbon::setDrawable ( )
protectedvirtual

Removes any existing drawables and add the drawable returned from getDrawable.

Member Data Documentation

osg::ref_ptr<osg::MatrixTransform> makVrv::DtOsgRibbon::myPositionNode
protected
osg::ref_ptr<osg::Geode> makVrv::DtOsgRibbon::myGeode
protected
osg::Matrixd makVrv::DtOsgRibbon::myWorldTransformInv
protected
osg::Matrixd makVrv::DtOsgRibbon::myLastLocalToWork
protected
int makVrv::DtOsgRibbon::myLastUpdatedFrame
protected
double makVrv::DtOsgRibbon::myLastUpdateTime
protected
long makVrv::DtOsgRibbon::myMaxSegments
protected
float makVrv::DtOsgRibbon::mySegmentSpacingSquared
protected
float makVrv::DtOsgRibbon::mySegmentSpacing
protected
float makVrv::DtOsgRibbon::mySegmentTimeout
protected
osg::Vec3d makVrv::DtOsgRibbon::myLocalPointA
protected
osg::Vec3d makVrv::DtOsgRibbon::myLocalPointB
protected
osg::Vec3d makVrv::DtOsgRibbon::myLocalPosOffset
protected
osg::Vec4 makVrv::DtOsgRibbon::myColor
protected
bool makVrv::DtOsgRibbon::myFirstUpdate
protected
bool makVrv::DtOsgRibbon::myStippled
protected
DtDe& makVrv::DtOsgRibbon::myDe
protected
bool makVrv::DtOsgRibbon::myLightingEnabled
protected
bool makVrv::DtOsgRibbon::myShaderSet
protected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)