VR-Forces 4.1 Class Documentation
List of all members | Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtOverlaySegmentedLineModelInstance Class Reference

Model instance to draw a 3D line with styleable segments onto the 2D overlay. More...

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

Classes

struct  SegmentAttributes

Public Types

typedef std::vector
< SegmentAttributes
SegmentAttributesVector
 Vector of segment information.

Public Member Functions

 DtOverlaySegmentedLineModelInstance (DtDe &de)
 CTOR.
virtual ~DtOverlaySegmentedLineModelInstance ()
 DTOR.
virtual void setPosition (int vtx, const DtVector &position)
 Set the position of one endpoint of the line.
virtual void removePosition (int vtx)
 Remove the vertex at position vtx.
virtual void setWidth (float width)
 Set the width of the line.
virtual void setColor (float r, float g, float b, float a)
 Set the color of the line.
virtual void setStipplePattern (unsigned int pattern, int repeatFactor)
 Set a stipple pattern for the line.
virtual void setStyleSegments (const std::vector< double > &segmentPercentages)
 Set the style segments to percentages of the total line length The values in segmentPercentages must add up to 1.0.
virtual void setSegmentColor (unsigned int segmentIndex, float r, float g, float b, float a)
 Set the color of a particular segment.
virtual void setSegmentLightningStyle (unsigned int segmentIndex, bool enableLightningStyle)
 Turn on or off lightning bolt style for a particular segment.
virtual void setSegmentStartArrow (unsigned int segmentIndex, bool enableArrow)
 Turn on or off the arrow at a segment's start point.
virtual void setSegmentEndArrow (unsigned int segmentIndex, bool enableArrow)
 Turn on or off the arrow at a segment's end point.
virtual void setSegmentStipplePattern (unsigned int segmentIndex, unsigned int stipplePattern, int repeatFactor)
 Set the line stipple pattern for a segment, according to the OpenGL line stippling specification.
virtual void setSegmentWidth (unsigned int segmentIndex, double width)
 Set the line width of a segment.
virtual void setSegmentStartColor (unsigned int segmentIndex, float r, float g, float b, float a)
 Set the color of the firt vertex in a segment.
virtual void setSegmentEndColor (unsigned int segmentIndex, float r, float g, float b, float a)
 Set the color of the end vertex in a segment.
virtual void setModelSet (int modelSet)
 Set the model set this model instance uses (needed for doing intersections).
virtual bool realize (DtModelDefinition &definition)
 Attempt to realize a definition.
virtual void setVisible (bool isVisible)
 Set the line visible or invisible; maintains state.
virtual void setEventsEnabled (bool enabled, unsigned long long userData)
 Turn on or off the ability to pick the line. Off by default.
virtual void setEventWidth (float width)
 Sets the width of the segment (in pixels), for picking and mouse-over.
virtual void update ()
 Indicate that its time to prepare actual scene graph data to be rendered.
virtual void setRotation (const osg::Quat &quat)
 rotate the points about the origin
virtual void setArrowSize (double)
 Sets the size of the arrow (in pixels)
virtual void setLineStyle (vrvTacticalGraphicUtilities::LineStyle)
 Sets the line style (see DtTacticalGraphicUtilities.h for types)
virtual void setArrowStyle (vrvTacticalGraphicUtilities::ArrowStyle)
 Sets the style of the arrow (see DtTacticalGraphicUtilities.h for types)
virtual void setTexture (osg::Texture *)
 Sets a pattern to apply to the line and recreates line object.
virtual bool isTextured () const
 Returns true if this instance has a textured line.
virtual void setFixedWidthSizing (bool)
 For those lines that support it, whether or not the lines sizes when zooming to pixel space (fixed width) or to the database (non-fixed width).
virtual void setChannelInstance (DtChannel *, int modelSet)
 Set to make this model channel specific.
virtual const std::vector
< DtVector > & 
points () const
 Returns the points of the line.
virtual void setPoints (const std::vector< DtVector > &)
 Sets the points on the line.
virtual const
SegmentAttributesVector
segmentInformation () const
 Returns segment information.
virtual void setSegmentInformation (const SegmentAttributesVector &)
 Sets segment information.
- Public Member Functions inherited from makVrv::DtOsgModelInstance
virtual ~DtOsgModelInstance ()
 DTOR.
virtual void addToConnector (DtOsgSceneConnector *connector)
 Brief Tell the model instance to add itself to the provided node.
virtual bool removeFromConnector (DtOsgSceneConnector *connector)
 Brief Tell the model instance to remove itself from the provided node.
virtual bool saveModelToFile (const std::string &filename) const
 Attempt to save the model to a file.
virtual void enableColorBlending (bool b)
 Enable / disable coloring on all models in the scene object.
virtual void setBlendColor (float r, float g, float b, float a)
 set the model's color
virtual void enableTexture (bool onOff)
virtual osg::Node * rootNode ()
 Get the model instance's root node.
virtual const osg::Node * rootNode () const
 Get the model instance's root node.
- Public Member Functions inherited from makVrv::DtModelInstance
 DtModelInstance (DtDe &de)
 CTOR.
virtual ~DtModelInstance ()
 DTOR.
const std::string & realizedDefinitionName () const
 Get the name of the definition that this model instance was realized with.
const DtVectorboundingBoxExtents () const
 Get the bounding box extents of the model instance.
void getBoundingBoxExtents (double &x, double &y, double &z) const
 Get the bounding box extents of the model instance.
const DtVectorboundingBoxCenter () const
 Get the bounding box center of the model instance.
void getBoundingBoxCenter (double &x, double &y, double &z) const
 Get the bounding box center of the model instance.
void getBoundingBoxComponents (DtVector &minimum, DtVector &maximum)
virtual void setContributesToBound (bool trueOrFalse)
 Set whether this model instance contributes to an object's overall bounding volume.
bool contributesToBound () const
 Get whether this model instance contributes to an object's overall bounding volume.

Protected Types

typedef std::vector< DtVectorPoints

Protected Member Functions

virtual void updateSegmentsWithArrows (const std::vector< DtVector > &pts, std::vector< DtVector > &drawPoints, std::vector< DtVector > &twodOffsets)
 Updates segments with arrows as appropriate (beginning or end)
virtual void createLineIfNecessary ()
 Creates the line model.
virtual void updateSegments ()
 Updates the segment information.
virtual void updateGeometry ()
 Updates the lines geometry.
virtual void updateGeometryForLineStyle ()
 Calculates vertices to draw for updating line style.
virtual void resizeSegmentAttributes (int size)
 Add segments to the segments attribute vector.
virtual void set3DVertexPosition (unsigned int index, double x, double y, double z)
 Sets a lines vertex's position.
virtual void set3DPositionAux (double x, double y, double z, float tempPackedCoords[4])
 Utility function for transforming a vertex and setting it on the line.
virtual void channelUpdated (DtTacticalGraphicModelUpdaterManager::ChannelUpdateData)
 Called to effect zoom level if textured to make sure textures keep proper aspect.
void updatePointsForLineStyle (const std::vector< DtVector > &, std::vector< DtVector > &drawPoints, std::vector< DtVector > &twodOffsets, std::vector< int > &segmentsToErase) const
 Creates the points for the line given the line style.
- Protected Member Functions inherited from makVrv::DtOsgModelInstance
virtual void updateColorBlending ()
 calls update color blending with the model root.
virtual void updateColorBlending (osg::Node *node)
virtual void enableTexture (osg::Node *root, bool onOff)
virtual void updateBoundingBoxViaContents ()
 DtOsgModelInstance (DtDe &de)
 CTOR.
virtual void setRootNode (osg::Node *node)
 Set the model instance's root node.

Protected Attributes

DtUniqueID mySceneObjectId
Points myPoints
Points myVertices
Points my2DOffsets
SegmentAttributesVector mySegmentAttributes
unsigned int myModelSet
DtSegmentedLinemyLine
bool myVisible
osg::Vec4 myColor
float myWidth
unsigned int myStipplePattern
int myStippleRepeat
std::vector< double > mySegmentPercentages
float myEventWidth
bool myGeometryDirty
bool mySegmentsDirty
bool myEventsEnabled
osg::Vec3d myOrigin
osg::Quat myRotation
double myArrowSize
vrvTacticalGraphicUtilities::ArrowStyle myArrowStyle
osg::ref_ptr< osg::Texture > myTexture
vrvTacticalGraphicUtilities::LineStyle myLineStyle
bool myFixedWidthSizing
std::vector< int > mySegmentsToErase
DtChannelmyChannelInstance
- Protected Attributes inherited from makVrv::DtOsgModelInstance
osg::ref_ptr< osg::Node > myModelRoot
osg::ref_ptr< osg::StateSet > myCachedState
- Protected Attributes inherited from makVrv::DtModelInstance
DtDemyDe
std::string myRealizedModelDefinitionName
DtVector myBoundingBoxCenter
DtVector myBoundingBoxExtents
DtVector myBoundingBoxMinimum
DtVector myBoundingBoxMaximum
bool myContributesToBound
bool myColorBlendingEnabled
float myBlendRed
float myBlendBlue
float myBlendGreen
float myBlendAlpha

Private Member Functions

 DtOverlaySegmentedLineModelInstance ()
 Default, unimplemented constructor.
 DtOverlaySegmentedLineModelInstance (const DtOverlaySegmentedLineModelInstance &)
 Unimplemented copy constructor.
DtOverlaySegmentedLineModelInstanceoperator= (const DtOverlaySegmentedLineModelInstance &)
 Unimplemented assignment operator.

Additional Inherited Members

- Static Public Member Functions inherited from makVrv::DtOsgModelInstance
static osg::Vec4 readVec4 (const std::string &paramName, const DtModelDefinition &definition)
static osg::Vec3 readVec3 (const std::string &paramName, const DtModelDefinition &definition)
- Public Attributes inherited from makVrv::DtModelInstance
boost::signal< void(DtModelInstance *)> signal_modelInstanceChanged

Detailed Description

Model instance to draw a 3D line with styleable segments onto the 2D overlay.

Member Typedef Documentation

Vector of segment information.

Constructor & Destructor Documentation

makVrv::DtOverlaySegmentedLineModelInstance::DtOverlaySegmentedLineModelInstance ( DtDe de)

CTOR.

virtual makVrv::DtOverlaySegmentedLineModelInstance::~DtOverlaySegmentedLineModelInstance ( )
virtual

DTOR.

makVrv::DtOverlaySegmentedLineModelInstance::DtOverlaySegmentedLineModelInstance ( )
private

Default, unimplemented constructor.

makVrv::DtOverlaySegmentedLineModelInstance::DtOverlaySegmentedLineModelInstance ( const DtOverlaySegmentedLineModelInstance )
private

Unimplemented copy constructor.

Member Function Documentation

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setPosition ( int  vtx,
const DtVector position 
)
virtual

Set the position of one endpoint of the line.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::removePosition ( int  vtx)
virtual

Remove the vertex at position vtx.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setWidth ( float  width)
virtual

Set the width of the line.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color of the line.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setStipplePattern ( unsigned int  pattern,
int  repeatFactor 
)
virtual

Set a stipple pattern for the line.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setStyleSegments ( const std::vector< double > &  segmentPercentages)
virtual

Set the style segments to percentages of the total line length The values in segmentPercentages must add up to 1.0.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setSegmentColor ( unsigned int  segmentIndex,
float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color of a particular segment.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setSegmentLightningStyle ( unsigned int  segmentIndex,
bool  enableLightningStyle 
)
virtual

Turn on or off lightning bolt style for a particular segment.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setSegmentStartArrow ( unsigned int  segmentIndex,
bool  enableArrow 
)
virtual

Turn on or off the arrow at a segment's start point.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setSegmentEndArrow ( unsigned int  segmentIndex,
bool  enableArrow 
)
virtual

Turn on or off the arrow at a segment's end point.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setSegmentStipplePattern ( unsigned int  segmentIndex,
unsigned int  stipplePattern,
int  repeatFactor 
)
virtual

Set the line stipple pattern for a segment, according to the OpenGL line stippling specification.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setSegmentWidth ( unsigned int  segmentIndex,
double  width 
)
virtual

Set the line width of a segment.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setSegmentStartColor ( unsigned int  segmentIndex,
float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color of the firt vertex in a segment.

This can be used for color blending between vertices.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setSegmentEndColor ( unsigned int  segmentIndex,
float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color of the end vertex in a segment.

This can be used for color blending between vertices.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setModelSet ( int  modelSet)
virtual

Set the model set this model instance uses (needed for doing intersections).

Will clear out channelInstance if set

virtual bool makVrv::DtOverlaySegmentedLineModelInstance::realize ( DtModelDefinition definition)
virtual

Attempt to realize a definition.

If the model instance can't realize the definition it should return false.

Reimplemented from makVrv::DtModelInstance.

Reimplemented in makVrv::DtOverlayGreatCircleArcModelInstance.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setVisible ( bool  isVisible)
virtual

Set the line visible or invisible; maintains state.

Implements makVrv::DtModelInstance.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setEventsEnabled ( bool  enabled,
unsigned long long  userData 
)
virtual

Turn on or off the ability to pick the line. Off by default.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setEventWidth ( float  width)
virtual

Sets the width of the segment (in pixels), for picking and mouse-over.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::update ( )
virtual

Indicate that its time to prepare actual scene graph data to be rendered.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setRotation ( const osg::Quat &  quat)
virtual

rotate the points about the origin

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setArrowSize ( double  )
virtual

Sets the size of the arrow (in pixels)

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setLineStyle ( vrvTacticalGraphicUtilities::LineStyle  )
virtual

Sets the line style (see DtTacticalGraphicUtilities.h for types)

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setArrowStyle ( vrvTacticalGraphicUtilities::ArrowStyle  )
virtual

Sets the style of the arrow (see DtTacticalGraphicUtilities.h for types)

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setTexture ( osg::Texture *  )
virtual

Sets a pattern to apply to the line and recreates line object.

virtual bool makVrv::DtOverlaySegmentedLineModelInstance::isTextured ( ) const
virtual

Returns true if this instance has a textured line.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setFixedWidthSizing ( bool  )
virtual

For those lines that support it, whether or not the lines sizes when zooming to pixel space (fixed width) or to the database (non-fixed width).

Default is fixed width. If changing modes, be sure to change the arrow size

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setChannelInstance ( DtChannel ,
int  modelSet 
)
virtual

Set to make this model channel specific.

This means it will only update itself when the channel it is assigned to is updated for the specified model set

virtual const std::vector<DtVector>& makVrv::DtOverlaySegmentedLineModelInstance::points ( ) const
virtual

Returns the points of the line.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setPoints ( const std::vector< DtVector > &  )
virtual

Sets the points on the line.

virtual const SegmentAttributesVector& makVrv::DtOverlaySegmentedLineModelInstance::segmentInformation ( ) const
virtual

Returns segment information.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::setSegmentInformation ( const SegmentAttributesVector )
virtual

Sets segment information.

If number of segments is less than the information provided, only set up to the number of segments that represents this line.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::updateSegmentsWithArrows ( const std::vector< DtVector > &  pts,
std::vector< DtVector > &  drawPoints,
std::vector< DtVector > &  twodOffsets 
)
protectedvirtual

Updates segments with arrows as appropriate (beginning or end)

DtOverlaySegmentedLineModelInstance& makVrv::DtOverlaySegmentedLineModelInstance::operator= ( const DtOverlaySegmentedLineModelInstance )
private

Unimplemented assignment operator.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::createLineIfNecessary ( )
protectedvirtual

Creates the line model.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::updateSegments ( )
protectedvirtual

Updates the segment information.

Reimplemented in makVrv::DtOverlayGreatCircleArcModelInstance.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::updateGeometry ( )
protectedvirtual

Updates the lines geometry.

Reimplemented in makVrv::DtOverlayGreatCircleArcModelInstance.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::updateGeometryForLineStyle ( )
protectedvirtual

Calculates vertices to draw for updating line style.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::resizeSegmentAttributes ( int  size)
protectedvirtual

Add segments to the segments attribute vector.

Reimplemented in makVrv::DtOverlayGreatCircleArcModelInstance.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::set3DVertexPosition ( unsigned int  index,
double  x,
double  y,
double  z 
)
protectedvirtual

Sets a lines vertex's position.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::set3DPositionAux ( double  x,
double  y,
double  z,
float  tempPackedCoords[4] 
)
protectedvirtual

Utility function for transforming a vertex and setting it on the line.

virtual void makVrv::DtOverlaySegmentedLineModelInstance::channelUpdated ( DtTacticalGraphicModelUpdaterManager::ChannelUpdateData  )
protectedvirtual

Called to effect zoom level if textured to make sure textures keep proper aspect.

void makVrv::DtOverlaySegmentedLineModelInstance::updatePointsForLineStyle ( const std::vector< DtVector > &  ,
std::vector< DtVector > &  drawPoints,
std::vector< DtVector > &  twodOffsets,
std::vector< int > &  segmentsToErase 
) const
protected

Creates the points for the line given the line style.

Member Data Documentation

DtUniqueID makVrv::DtOverlaySegmentedLineModelInstance::mySceneObjectId
protected
Points makVrv::DtOverlaySegmentedLineModelInstance::myPoints
protected
Points makVrv::DtOverlaySegmentedLineModelInstance::myVertices
protected
Points makVrv::DtOverlaySegmentedLineModelInstance::my2DOffsets
protected
SegmentAttributesVector makVrv::DtOverlaySegmentedLineModelInstance::mySegmentAttributes
protected
unsigned int makVrv::DtOverlaySegmentedLineModelInstance::myModelSet
protected
DtSegmentedLine* makVrv::DtOverlaySegmentedLineModelInstance::myLine
protected
bool makVrv::DtOverlaySegmentedLineModelInstance::myVisible
protected
osg::Vec4 makVrv::DtOverlaySegmentedLineModelInstance::myColor
protected
float makVrv::DtOverlaySegmentedLineModelInstance::myWidth
protected
unsigned int makVrv::DtOverlaySegmentedLineModelInstance::myStipplePattern
protected
int makVrv::DtOverlaySegmentedLineModelInstance::myStippleRepeat
protected
std::vector<double> makVrv::DtOverlaySegmentedLineModelInstance::mySegmentPercentages
protected
float makVrv::DtOverlaySegmentedLineModelInstance::myEventWidth
protected
bool makVrv::DtOverlaySegmentedLineModelInstance::myGeometryDirty
protected
bool makVrv::DtOverlaySegmentedLineModelInstance::mySegmentsDirty
protected
bool makVrv::DtOverlaySegmentedLineModelInstance::myEventsEnabled
protected
osg::Vec3d makVrv::DtOverlaySegmentedLineModelInstance::myOrigin
protected
osg::Quat makVrv::DtOverlaySegmentedLineModelInstance::myRotation
protected
double makVrv::DtOverlaySegmentedLineModelInstance::myArrowSize
protected
vrvTacticalGraphicUtilities::ArrowStyle makVrv::DtOverlaySegmentedLineModelInstance::myArrowStyle
protected
osg::ref_ptr<osg::Texture> makVrv::DtOverlaySegmentedLineModelInstance::myTexture
protected
vrvTacticalGraphicUtilities::LineStyle makVrv::DtOverlaySegmentedLineModelInstance::myLineStyle
protected
bool makVrv::DtOverlaySegmentedLineModelInstance::myFixedWidthSizing
protected
std::vector<int> makVrv::DtOverlaySegmentedLineModelInstance::mySegmentsToErase
protected
DtChannel* makVrv::DtOverlaySegmentedLineModelInstance::myChannelInstance
protected

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

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)