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

The base class for simple OSG based model instances. More...

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

Public Types

enum  AlphaToCoverageState { USE_GLOBAL, FORCE_OFF, FORCE_ON }
 The possible states of a control point. More...
 

Public Member Functions

virtual ~DtOsgModelInstance ()
 DTOR. More...
 
virtual bool realize (DtModelDefinition &definition)
 Attempt to realize a definition. More...
 
virtual bool cloneInstance (DtModelDefinition &definition)
 Attempt to clone the basic geometry. More...
 
virtual void addToConnector (DtOsgSceneConnector *connector)
 Brief Tell the model instance to add itself to the provided node. More...
 
virtual bool removeFromConnector (DtOsgSceneConnector *connector)
 Brief Tell the model instance to remove itself from the provided node. More...
 
virtual bool saveModelToFile (const std::string &filename) const
 Attempt to save the model to a file. More...
 
virtual void enableColorBlending (bool b)
 Enable / disable coloring on all models in the scene object Note about enableColorBlending: If this particular model has instancing enabled then this flag is set to false and color blending is handled by the instance manager. More...
 
virtual void setBlendColor (float r, float g, float b, float a)
 set the model's color More...
 
virtual void enableTexture (bool onOff)
 
virtual osg::Node * rootNode ()
 Get the model instance's root node. More...
 
virtual const osg::Node * rootNode () const
 
virtual osg::Node * sensorNode ()
 Get the model instance's sensor node, . More...
 
virtual const osg::Node * sensorNode () const
 
- Public Member Functions inherited from makVrv::DtModelInstance
 DtModelInstance (DtDe &de)
 CTOR. More...
 
virtual ~DtModelInstance ()
 DTOR. More...
 
const std::string & realizedDefinitionName () const
 Get the name of the definition that this model instance was realized with. More...
 
const DtVectorboundingBoxExtents () const
 Get the bounding box extents of the model instance. More...
 
void getBoundingBoxExtents (double &x, double &y, double &z) const
 Get the bounding box extents of the model instance. More...
 
const DtVectorboundingBoxCenter () const
 Get the bounding box center of the model instance. More...
 
void getBoundingBoxCenter (double &x, double &y, double &z) const
 Get the bounding box center of the model instance. More...
 
void getBoundingBoxComponents (DtVector &minimum, DtVector &maximum)
 Get the bounding box min/max of the model instance. More...
 
const DtVectorallGeometryboundingBoxExtents () const
 functions for getting the allGeometry versions of the extents (they are calculated by traversing as if all switch paths are active) More...
 
void getAllGeometryBoundingBoxExtents (double &x, double &y, double &z) const
 Get the all geometry version of bounding box extents of the model instance. More...
 
const DtVectorallGeometryboundingBoxCenter () const
 Get the all geometry version of bounding box center of the model instance. More...
 
void getAllGeometryBoundingBoxCenter (double &x, double &y, double &z) const
 Get the all geometry version of bounding box center of the model instance. More...
 
void getAllGeometryBoundingBoxComponents (DtVector &minimum, DtVector &maximum)
 Get the all geometry version of bounding box min/max of the model instance. More...
 
virtual void setContributesToBound (bool trueOrFalse)
 Set whether this model instance contributes to an object's overall bounding volume. More...
 
bool contributesToBound () const
 Get whether this model instance contributes to an object's overall bounding volume. More...
 
virtual void setVisible (bool isVisible)=0
 Set whether the model is visible or not. More...
 

Static Public Member Functions

static osg::Vec4 readVec4 (const std::string &paramName, const DtModelDefinition &definition, const osg::Vec4 &initValue=osg::Vec4(1, 1, 1, 1))
 
static osg::Vec3 readVec3 (const std::string &paramName, const DtModelDefinition &definition, const osg::Vec3 &initValue=osg::Vec3(1, 1, 1))
 
- Static Public Member Functions inherited from makVrv::DtModelInstance
static float readFloat (const std::string &paramName, const DtModelDefinition &definition)
 
static DtVector readVector (const std::string &paramName, const DtModelDefinition &definition)
 

Protected Member Functions

virtual void updateColorBlending ()
 calls update color blending with the model root. More...
 
virtual void updateColorBlending (osg::Node *node)
 
virtual void enableTexture (osg::Node *root, bool onOff)
 
virtual void updateBoundingBoxViaContents ()
 
 DtOsgModelInstance (DtDe &de)
 CTOR. More...
 
virtual void setRootNode (osg::Node *node)
 Set the model instance's root node. More...
 

Protected Attributes

osg::ref_ptr< osg::Node > myModelRoot
 
osg::ref_ptr< osg::StateSet > myCachedState
 
SensorRegionStateMap mySensorRegionMap
 
AlphaToCoverageState myAlphaToCoverageState
 
DtSignalConnectionManager myConnections
 
bool myModelInstanceShaderSet
 Has this model instance had a shader generated for it? Used for classes (ex. More...
 
- Protected Attributes inherited from makVrv::DtModelInstance
DtDemyDe
 
std::string myRealizedModelDefinitionName
 
DtVector myBoundingBoxCenter
 
DtVector myBoundingBoxExtents
 
DtVector myBoundingBoxMinimum
 
DtVector myBoundingBoxMaximum
 
DtVector myAllGeometryBoundingBoxCenter
 
DtVector myAllGeometryBoundingBoxExtents
 
DtVector myAllGeometryBoundingBoxMinimum
 
DtVector myAllGeometryBoundingBoxMaximum
 
bool myContributesToBound
 
bool myColorBlendingEnabled
 
float myBlendRed
 
float myBlendBlue
 
float myBlendGreen
 
float myBlendAlpha
 
typedef boost::unordered_map
< std::string, bool
SensorRegionStateMap
 Dynamic Sensor Region methods. More...
 
boost::signal< void(const
std::string &) > 
signal_dynamicSensorRegionAdded
 Signal raised when a dynamic sensor region is added. More...
 
boost::signal< void(const
std::string &, bool) > 
signal_dynamicSensorRegionChanged
 Signal raised when a dynamic sensor region's state changes. More...
 
boost::signal< void(bool)> signal_atcModeEnableChanged
 Signal raised when alpha to coverage for this model is changed. More...
 
virtual void addDynamicSensorRegion (const std::string &region)
 Add an active region state. More...
 
virtual void setDynamicSensorRegion (const std::string &region, bool state)
 Set the state of an active region. More...
 
virtual bool dynamicSensorRegion (const std::string &region)
 Get the current state of the specified sensor region. More...
 
SensorRegionStateMap const dynamicSensorRegionMap () const
 Get the map containing all regions and their current states. More...
 
virtual void slot_atcGlobalModelEnableChanged ()
 Slot to handle the global alpha to coverage signal for entities. More...
 
virtual bool alphaToCoverageEnabled ()
 Get the current setting for alpha to coverage for this model. More...
 
virtual void registerLightPoints (const std::string &groupName, bool daylightControlledLights)
 loop over all this models light points and register them with the light point manager daylightControlled is only used if the light points do not already have a type specified More...
 

Additional Inherited Members

- Public Attributes inherited from makVrv::DtModelInstance
boost::signal< void(DtModelInstance *)> signal_modelInstanceChanged
 

Detailed Description

The base class for simple OSG based model instances.

This call can't be instantiated itself.

Member Typedef Documentation

typedef boost::unordered_map<std::string, bool> makVrv::DtOsgModelInstance::SensorRegionStateMap

Dynamic Sensor Region methods.

How Dynamic Sensor Region states are stored

Member Enumeration Documentation

The possible states of a control point.

Enumerator
USE_GLOBAL 
FORCE_OFF 
FORCE_ON 

Constructor & Destructor Documentation

virtual makVrv::DtOsgModelInstance::~DtOsgModelInstance ( )
virtual

DTOR.

makVrv::DtOsgModelInstance::DtOsgModelInstance ( DtDe de)
protected

CTOR.

Member Function Documentation

virtual bool makVrv::DtOsgModelInstance::realize ( DtModelDefinition definition)
virtual
virtual bool makVrv::DtOsgModelInstance::cloneInstance ( DtModelDefinition definition)
virtual

Attempt to clone the basic geometry.

Can be done in the background. If the model instance can't clone the definition it should return false.

Reimplemented from makVrv::DtModelInstance.

Reimplemented in makVrv::DtOsgSimpleModelInstance.

virtual void makVrv::DtOsgModelInstance::addToConnector ( DtOsgSceneConnector connector)
virtual
virtual bool makVrv::DtOsgModelInstance::removeFromConnector ( DtOsgSceneConnector connector)
virtual
virtual osg::Node* makVrv::DtOsgModelInstance::rootNode ( )
virtual

Get the model instance's root node.

Reimplemented in makVrv::DtExtrudedModelInstance.

virtual const osg::Node* makVrv::DtOsgModelInstance::rootNode ( ) const
virtual
virtual osg::Node* makVrv::DtOsgModelInstance::sensorNode ( )
virtual

Get the model instance's sensor node, .

Reimplemented in makVrv::DtRibbonModelInstance, and makVrv::DtDiGuyModelInstance.

virtual const osg::Node* makVrv::DtOsgModelInstance::sensorNode ( ) const
virtual
virtual bool makVrv::DtOsgModelInstance::saveModelToFile ( const std::string &  filename) const
virtual

Attempt to save the model to a file.

Reimplemented from makVrv::DtModelInstance.

virtual void makVrv::DtOsgModelInstance::enableColorBlending ( bool  b)
virtual

Enable / disable coloring on all models in the scene object Note about enableColorBlending: If this particular model has instancing enabled then this flag is set to false and color blending is handled by the instance manager.

It should not be set to true if the model has instancing enabled.

Reimplemented from makVrv::DtModelInstance.

Reimplemented in makVrv::DtPolygonModelInstance.

virtual void makVrv::DtOsgModelInstance::setBlendColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

set the model's color

Reimplemented from makVrv::DtModelInstance.

virtual void makVrv::DtOsgModelInstance::enableTexture ( bool  onOff)
virtual
virtual void makVrv::DtOsgModelInstance::addDynamicSensorRegion ( const std::string &  region)
virtual

Add an active region state.

virtual void makVrv::DtOsgModelInstance::setDynamicSensorRegion ( const std::string &  region,
bool  state 
)
virtual

Set the state of an active region.

virtual bool makVrv::DtOsgModelInstance::dynamicSensorRegion ( const std::string &  region)
virtual

Get the current state of the specified sensor region.

SensorRegionStateMap const makVrv::DtOsgModelInstance::dynamicSensorRegionMap ( ) const

Get the map containing all regions and their current states.

virtual void makVrv::DtOsgModelInstance::slot_atcGlobalModelEnableChanged ( )
virtual

Slot to handle the global alpha to coverage signal for entities.

Reimplemented in makVrv::DtScribeBoxModelInstance.

virtual bool makVrv::DtOsgModelInstance::alphaToCoverageEnabled ( )
virtual

Get the current setting for alpha to coverage for this model.

virtual void makVrv::DtOsgModelInstance::registerLightPoints ( const std::string &  groupName,
bool  daylightControlledLights 
)
virtual

loop over all this models light points and register them with the light point manager daylightControlled is only used if the light points do not already have a type specified

static osg::Vec4 makVrv::DtOsgModelInstance::readVec4 ( const std::string &  paramName,
const DtModelDefinition definition,
const osg::Vec4 &  initValue = osg::Vec4(1, 1, 1, 1) 
)
static
static osg::Vec3 makVrv::DtOsgModelInstance::readVec3 ( const std::string &  paramName,
const DtModelDefinition definition,
const osg::Vec3 &  initValue = osg::Vec3(1, 1, 1) 
)
static
virtual void makVrv::DtOsgModelInstance::updateColorBlending ( )
protectedvirtual

calls update color blending with the model root.

Override to use a different root

virtual void makVrv::DtOsgModelInstance::updateColorBlending ( osg::Node *  node)
protectedvirtual
virtual void makVrv::DtOsgModelInstance::enableTexture ( osg::Node *  root,
bool  onOff 
)
protectedvirtual
virtual void makVrv::DtOsgModelInstance::updateBoundingBoxViaContents ( )
protectedvirtual

Reimplemented in makVrv::DtDiGuyModelInstance.

virtual void makVrv::DtOsgModelInstance::setRootNode ( osg::Node *  node)
protectedvirtual

Set the model instance's root node.

Reimplemented in makVrv::DtDiGuyModelInstance.

Member Data Documentation

boost::signal< void(const std::string&) > makVrv::DtOsgModelInstance::signal_dynamicSensorRegionAdded

Signal raised when a dynamic sensor region is added.

boost::signal< void(const std::string&, bool) > makVrv::DtOsgModelInstance::signal_dynamicSensorRegionChanged

Signal raised when a dynamic sensor region's state changes.

boost::signal<void(bool)> makVrv::DtOsgModelInstance::signal_atcModeEnableChanged

Signal raised when alpha to coverage for this model is changed.

osg::ref_ptr<osg::Node> makVrv::DtOsgModelInstance::myModelRoot
protected
osg::ref_ptr<osg::StateSet> makVrv::DtOsgModelInstance::myCachedState
protected
SensorRegionStateMap makVrv::DtOsgModelInstance::mySensorRegionMap
protected
AlphaToCoverageState makVrv::DtOsgModelInstance::myAlphaToCoverageState
protected
DtSignalConnectionManager makVrv::DtOsgModelInstance::myConnections
protected
bool makVrv::DtOsgModelInstance::myModelInstanceShaderSet
protected

Has this model instance had a shader generated for it? Used for classes (ex.

Dt3DSegmentedLineModelInstance) which call DtOsgShaderUtils::generateModelInstanceShaders


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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)