VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtExtrudedModelInstance Class Reference

A prism controlled by control points. More...

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

Public Types

enum  LineExtrusionMode { LineOnly, ExtrudeWidth, ExtrudeHeight, FullExtrusion }
typedef std::vector< DtVectorPointVector
- Public Types inherited from makVrv::DtOsgModelInstance
typedef boost::unordered_map
< std::string, bool
SensorRegionStateMap
 Dynamic Sensor Region methods.

Public Member Functions

 DtExtrudedModelInstance (DtDe &de)
 CTOR.
virtual ~DtExtrudedModelInstance ()
 DTOR.
virtual const PointVectorpoints () const
 Returns the points associated with this model.
virtual void addPoint (const DtVector &, int index=-1)
 Add a control point to the end of the control point list if index is -1, or, at the specified index.
virtual void removePoint (int index)
 Remove a control point at the specified index.
virtual void setPosition (int index, const DtVector &)
 Move a control point at the specified index to a new position.
virtual void clearPoints ()
 Clears out positions and resets geometry.
virtual bool realize (DtModelDefinition &definition)
 Attempt to realize a definition.
virtual void addToConnector (DtOsgSceneConnector *connector)
 Tell the model instance to add itself to the provided node.
virtual bool removeFromConnector (DtOsgSceneConnector *connector)
 Tell the model instance to remove itself from the provided node.
virtual void setStipplePattern (unsigned int)
 Sets the stipple pattern of the line.
virtual void setColor (float r, float g, float b, float a)
 Set the color of the line.
virtual void setTextureHeight (double height)
 Set the height of the texture in meters.
virtual void setTextureWidth (double width)
 Set the width of the texture tiles in meters.
virtual void setTexture (osg::Texture *texture)
 Set the shape's texture.
virtual void setUpExtent (float height)
 Set the shape's upwards extrusion extent.
virtual void setDownExtent (float height)
 Set the shape's downwards extrusion extent.
virtual void setLeftExtent (float height)
 Set the shape's left extrusion extent.
virtual void setRightExtent (float heigh)
 Set the shape's right extrusion extent.
virtual void setWidth (float)
 Sets the width of the line. If there is height, will 0 out height.
virtual void setHeight (float)
 Sets the height of the line ("up/down" the origin point).
virtual void setDimensions (float width, float height)
 Sets the dimensions of the line.
virtual void setLineWidth (float width)
 Sets the width of the line in pixel space, not world.
virtual void setScribed (bool b)
 Sets the line to be scribed (default true)
virtual void setScribeColor (float r, float g, float b, float a)
 Sets the color of the scribe line.
virtual void setScribeOccluded (bool b)
 Sets the scribed line to be occluded by the terrain (default true)
virtual void setVisible (bool isVisible)
 no-op
int pointCount () const
 Returns the number of points.
const DtVectororigin () const
 Returns the origin point of the line.
const DtVectorpoint (int) const
 Returns the point at the given index. zero point if index is out of range.
virtual void setLockUpdates (bool)
 Sets whether or not updates are locked. If updates are locked, no changes made until they are unlocked.
bool updatesLocked () const
 Returns whether or not updates are locked.
virtual void setPickable (bool)
 Sets whether or not line is pickable.
bool pickable () const
 Returns whether or not line is pickable.
void setOrigin (const DtVector &origin)
virtual void updatePoints ()
 Create the point array based on extents and point list.
virtual void setSolid (bool)
 Sets shape solid or outlined only. If solid is false and scribed is false, line will be effectively invisible.
- Public Member Functions inherited from makVrv::DtOsgModelInstance
virtual ~DtOsgModelInstance ()
 DTOR.
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.
virtual osg::Node * sensorNode ()
 Get the model instance's sensor node, .
virtual const osg::Node * sensorNode () const
 Get the model instance's sensor node, .
virtual void addDynamicSensorRegion (const std::string &region)
 Add an active region state.
virtual void setDynamicSensorRegion (const std::string &region, bool state)
 Set the state of an active region.
virtual bool dynamicSensorRegion (const std::string &region)
 Get the current state of the specified sensor region.
SensorRegionStateMap const dynamicSensorRegionMap () const
 Get the map containing all regions and their current states.
- 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 Member Functions

virtual void updateMode ()
 Updates the line mode to a correct mode for the given extents.
virtual void updateGeometry ()
 Rebuild the geometry objects.
virtual void updateTextureCoordinates ()
 Recalculate the texture coordinates.
virtual void addPointsForExtentExtrusion (const DtVector &point)
 Add points for a height or width extrustion.
virtual void addFaceForRotation (const osg::Quat &rotation, const DtVector &point)
 Adds a face given the rotation matrix.
virtual void addPointsForFullExtrusion (const DtVector &from, const DtVector &to)
 Add points for full extrustion.
virtual void updateStippling ()
 Updates for stippling.
virtual void updateScribeLine ()
 Updates the scribe line for geometry and color.
virtual void updateColors ()
 Updates colors of line and scribe line.
virtual bool frontAndBackFaceRendered () const
 Returns true if the first and last face are part of the line. Default is true.
virtual void updatePointsForLineStrip ()
 Updates the points for the line strip mode (no extrusion)
virtual void updatePointsForTriangleStrip ()
 Updates points for width or height extrusion.
virtual void updatePointsForExtrusion ()
 Updates points for full extrusion.
virtual void createFaces ()
 Creates the front/back face per segment for full extrusion.
virtual void updateScribeForTriangleStrip ()
 Updates script line for triangle strip mode.
virtual void updateScribeForExtrusion (osg::Vec3Array *)
 Updates scribe line for full extrusion mode.
- 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

osg::ref_ptr< osg::Geode > myShapeGeode
osg::ref_ptr< osg::Geometry > myShapeGeometry
osg::ref_ptr< osg::Vec3Array > myShapePoints
osg::ref_ptr< osg::Geode > myScribeGeode
osg::ref_ptr< osg::Geometry > myScribeGeometry
osg::ref_ptr< osg::Vec3Array > myScribePoints
osg::ref_ptr< osg::Texture > myTexture
osg::ref_ptr< osg::Vec2Array > myTextureCoordinates
osg::ref_ptr< osg::LineWidth > myLineWidth
osg::ref_ptr< osg::Group > myMainTransform
osg::ref_ptr< osg::Vec3Array > myFaces
 If the line has width and height, the list of faces that make up the junction points of the boxes.
osg::Vec4 myColor
double myTextureWidth
double myTextureHeight
float myUpExtent
float myDownExtent
float myLeftExtent
float myRightExtent
PointVector myLinePoints
DtVector myOrigin
bool myGeometryDirty
bool myShapePointsDirty
bool myColorsDirty
bool myUpdatesLocked
bool myScribeOccluded
bool myScribed
bool mySolid
int myStipplePattern
LineExtrusionMode myMode
DtOsgSegmentPickablemyPickable
 If drawing as line use this pointer to create the pickable segments of that line, else geometry will not support it.
bool myIsPickable
osg::Vec4 myScribeColor
bool myScribeColorSet
- Protected Attributes inherited from makVrv::DtOsgModelInstance
osg::ref_ptr< osg::Node > myModelRoot
osg::ref_ptr< osg::StateSet > myCachedState
SensorRegionStateMap mySensorRegionMap
- 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

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::DtOsgModelInstance
boost::signal< void(const
std::string &) > 
signal_dynamicSensorRegionAdded
 Signal raised when a dynamic sensor region is added.
boost::signal< void(const
std::string &, bool) > 
signal_dynamicSensorRegionChanged
 Signal raised when a dynamic sensor region's state changes.
- Public Attributes inherited from makVrv::DtModelInstance
boost::signal< void(DtModelInstance *)> signal_modelInstanceChanged

Detailed Description

A prism controlled by control points.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator:
LineOnly 
ExtrudeWidth 
ExtrudeHeight 
FullExtrusion 

Constructor & Destructor Documentation

makVrv::DtExtrudedModelInstance::DtExtrudedModelInstance ( DtDe de)

CTOR.

virtual makVrv::DtExtrudedModelInstance::~DtExtrudedModelInstance ( )
virtual

DTOR.

Member Function Documentation

virtual const PointVector& makVrv::DtExtrudedModelInstance::points ( ) const
virtual

Returns the points associated with this model.

virtual void makVrv::DtExtrudedModelInstance::addPoint ( const DtVector ,
int  index = -1 
)
virtual

Add a control point to the end of the control point list if index is -1, or, at the specified index.

virtual void makVrv::DtExtrudedModelInstance::removePoint ( int  index)
virtual

Remove a control point at the specified index.

virtual void makVrv::DtExtrudedModelInstance::setPosition ( int  index,
const DtVector  
)
virtual

Move a control point at the specified index to a new position.

virtual void makVrv::DtExtrudedModelInstance::clearPoints ( )
virtual

Clears out positions and resets geometry.

virtual bool makVrv::DtExtrudedModelInstance::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.

virtual void makVrv::DtExtrudedModelInstance::addToConnector ( DtOsgSceneConnector connector)
virtual

Tell the model instance to add itself to the provided node.

Reimplemented from makVrv::DtOsgModelInstance.

virtual bool makVrv::DtExtrudedModelInstance::removeFromConnector ( DtOsgSceneConnector connector)
virtual

Tell the model instance to remove itself from the provided node.

Reimplemented from makVrv::DtOsgModelInstance.

virtual void makVrv::DtExtrudedModelInstance::setStipplePattern ( unsigned  int)
virtual

Sets the stipple pattern of the line.

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

Set the color of the line.

virtual void makVrv::DtExtrudedModelInstance::setTextureHeight ( double  height)
virtual

Set the height of the texture in meters.

virtual void makVrv::DtExtrudedModelInstance::setTextureWidth ( double  width)
virtual

Set the width of the texture tiles in meters.

virtual void makVrv::DtExtrudedModelInstance::setTexture ( osg::Texture *  texture)
virtual

Set the shape's texture.

virtual void makVrv::DtExtrudedModelInstance::setUpExtent ( float  height)
virtual

Set the shape's upwards extrusion extent.

virtual void makVrv::DtExtrudedModelInstance::setDownExtent ( float  height)
virtual

Set the shape's downwards extrusion extent.

virtual void makVrv::DtExtrudedModelInstance::setLeftExtent ( float  height)
virtual

Set the shape's left extrusion extent.

virtual void makVrv::DtExtrudedModelInstance::setRightExtent ( float  heigh)
virtual

Set the shape's right extrusion extent.

virtual void makVrv::DtExtrudedModelInstance::setWidth ( float  )
virtual

Sets the width of the line. If there is height, will 0 out height.

virtual void makVrv::DtExtrudedModelInstance::setHeight ( float  )
virtual

Sets the height of the line ("up/down" the origin point).

If width is set, will 0 out width for the entire line

virtual void makVrv::DtExtrudedModelInstance::setDimensions ( float  width,
float  height 
)
virtual

Sets the dimensions of the line.

virtual void makVrv::DtExtrudedModelInstance::setLineWidth ( float  width)
virtual

Sets the width of the line in pixel space, not world.

Clears out any existing dimensional size

virtual void makVrv::DtExtrudedModelInstance::setScribed ( bool  b)
virtual

Sets the line to be scribed (default true)

virtual void makVrv::DtExtrudedModelInstance::setScribeColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Sets the color of the scribe line.

Once set it will always be different than the color of the main polygon

virtual void makVrv::DtExtrudedModelInstance::setScribeOccluded ( bool  b)
virtual

Sets the scribed line to be occluded by the terrain (default true)

virtual void makVrv::DtExtrudedModelInstance::setVisible ( bool  isVisible)
inlinevirtual

no-op

Implements makVrv::DtModelInstance.

int makVrv::DtExtrudedModelInstance::pointCount ( ) const

Returns the number of points.

const DtVector& makVrv::DtExtrudedModelInstance::origin ( ) const

Returns the origin point of the line.

const DtVector& makVrv::DtExtrudedModelInstance::point ( int  ) const

Returns the point at the given index. zero point if index is out of range.

virtual void makVrv::DtExtrudedModelInstance::setLockUpdates ( bool  )
virtual

Sets whether or not updates are locked. If updates are locked, no changes made until they are unlocked.

bool makVrv::DtExtrudedModelInstance::updatesLocked ( ) const

Returns whether or not updates are locked.

virtual void makVrv::DtExtrudedModelInstance::setPickable ( bool  )
virtual

Sets whether or not line is pickable.

bool makVrv::DtExtrudedModelInstance::pickable ( ) const

Returns whether or not line is pickable.

void makVrv::DtExtrudedModelInstance::setOrigin ( const DtVector origin)
virtual void makVrv::DtExtrudedModelInstance::updatePoints ( )
virtual

Create the point array based on extents and point list.

Reimplemented in makVrv::DtExtrudedPolygonModelInstance.

virtual void makVrv::DtExtrudedModelInstance::setSolid ( bool  )
virtual

Sets shape solid or outlined only. If solid is false and scribed is false, line will be effectively invisible.

virtual void makVrv::DtExtrudedModelInstance::updateMode ( )
protectedvirtual

Updates the line mode to a correct mode for the given extents.

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

Rebuild the geometry objects.

Reimplemented in makVrv::DtExtrudedPolygonModelInstance.

virtual void makVrv::DtExtrudedModelInstance::updateTextureCoordinates ( )
protectedvirtual

Recalculate the texture coordinates.

virtual void makVrv::DtExtrudedModelInstance::addPointsForExtentExtrusion ( const DtVector point)
protectedvirtual

Add points for a height or width extrustion.

virtual void makVrv::DtExtrudedModelInstance::addFaceForRotation ( const osg::Quat &  rotation,
const DtVector point 
)
protectedvirtual

Adds a face given the rotation matrix.

virtual void makVrv::DtExtrudedModelInstance::addPointsForFullExtrusion ( const DtVector from,
const DtVector to 
)
protectedvirtual

Add points for full extrustion.

virtual void makVrv::DtExtrudedModelInstance::updateStippling ( )
protectedvirtual

Updates for stippling.

Reimplemented in makVrv::DtExtrudedPolygonModelInstance.

virtual void makVrv::DtExtrudedModelInstance::updateScribeLine ( )
protectedvirtual

Updates the scribe line for geometry and color.

Reimplemented in makVrv::DtExtrudedPolygonModelInstance.

virtual void makVrv::DtExtrudedModelInstance::updateColors ( )
protectedvirtual

Updates colors of line and scribe line.

Reimplemented in makVrv::DtExtrudedPolygonModelInstance.

virtual bool makVrv::DtExtrudedModelInstance::frontAndBackFaceRendered ( ) const
protectedvirtual

Returns true if the first and last face are part of the line. Default is true.

virtual void makVrv::DtExtrudedModelInstance::updatePointsForLineStrip ( )
protectedvirtual

Updates the points for the line strip mode (no extrusion)

virtual void makVrv::DtExtrudedModelInstance::updatePointsForTriangleStrip ( )
protectedvirtual

Updates points for width or height extrusion.

virtual void makVrv::DtExtrudedModelInstance::updatePointsForExtrusion ( )
protectedvirtual

Updates points for full extrusion.

virtual void makVrv::DtExtrudedModelInstance::createFaces ( )
protectedvirtual

Creates the front/back face per segment for full extrusion.

virtual void makVrv::DtExtrudedModelInstance::updateScribeForTriangleStrip ( )
protectedvirtual

Updates script line for triangle strip mode.

virtual void makVrv::DtExtrudedModelInstance::updateScribeForExtrusion ( osg::Vec3Array *  )
protectedvirtual

Updates scribe line for full extrusion mode.

Member Data Documentation

osg::ref_ptr<osg::Geode> makVrv::DtExtrudedModelInstance::myShapeGeode
protected
osg::ref_ptr<osg::Geometry> makVrv::DtExtrudedModelInstance::myShapeGeometry
protected
osg::ref_ptr<osg::Vec3Array> makVrv::DtExtrudedModelInstance::myShapePoints
protected
osg::ref_ptr<osg::Geode> makVrv::DtExtrudedModelInstance::myScribeGeode
protected
osg::ref_ptr<osg::Geometry> makVrv::DtExtrudedModelInstance::myScribeGeometry
protected
osg::ref_ptr<osg::Vec3Array> makVrv::DtExtrudedModelInstance::myScribePoints
protected
osg::ref_ptr<osg::Texture> makVrv::DtExtrudedModelInstance::myTexture
protected
osg::ref_ptr<osg::Vec2Array> makVrv::DtExtrudedModelInstance::myTextureCoordinates
protected
osg::ref_ptr<osg::LineWidth> makVrv::DtExtrudedModelInstance::myLineWidth
protected
osg::ref_ptr<osg::Group> makVrv::DtExtrudedModelInstance::myMainTransform
protected
osg::ref_ptr<osg::Vec3Array> makVrv::DtExtrudedModelInstance::myFaces
protected

If the line has width and height, the list of faces that make up the junction points of the boxes.

Each junction point is a series of four coordinates

osg::Vec4 makVrv::DtExtrudedModelInstance::myColor
protected
double makVrv::DtExtrudedModelInstance::myTextureWidth
protected
double makVrv::DtExtrudedModelInstance::myTextureHeight
protected
float makVrv::DtExtrudedModelInstance::myUpExtent
protected
float makVrv::DtExtrudedModelInstance::myDownExtent
protected
float makVrv::DtExtrudedModelInstance::myLeftExtent
protected
float makVrv::DtExtrudedModelInstance::myRightExtent
protected
PointVector makVrv::DtExtrudedModelInstance::myLinePoints
protected
DtVector makVrv::DtExtrudedModelInstance::myOrigin
protected
bool makVrv::DtExtrudedModelInstance::myGeometryDirty
protected
bool makVrv::DtExtrudedModelInstance::myShapePointsDirty
protected
bool makVrv::DtExtrudedModelInstance::myColorsDirty
protected
bool makVrv::DtExtrudedModelInstance::myUpdatesLocked
protected
bool makVrv::DtExtrudedModelInstance::myScribeOccluded
protected
bool makVrv::DtExtrudedModelInstance::myScribed
protected
bool makVrv::DtExtrudedModelInstance::mySolid
protected
int makVrv::DtExtrudedModelInstance::myStipplePattern
protected
LineExtrusionMode makVrv::DtExtrudedModelInstance::myMode
protected
DtOsgSegmentPickable* makVrv::DtExtrudedModelInstance::myPickable
protected

If drawing as line use this pointer to create the pickable segments of that line, else geometry will not support it.

bool makVrv::DtExtrudedModelInstance::myIsPickable
protected
osg::Vec4 makVrv::DtExtrudedModelInstance::myScribeColor
protected
bool makVrv::DtExtrudedModelInstance::myScribeColorSet
protected

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

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)