VR-Forces 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 Types | Protected Member Functions | Protected Attributes
makVrv::DtKinematicState Class Referenceabstract

Base class for Kinematic State Objects e.g. DtEntityKinematicState Controls kinematic state of a scene object. Kinematic state objects use updaters to modify input values and apply them to scene objects. There is now one kinematic state object per element. An element that has a kinematic state object will add scene objects to a kinematic state ( via addSceneObject ) on a per model set basis; one scene object per model set. Each scene object is then added to the updater chain to receive spatial info updates ( addSceneObjectToUpdaters ). There is one updater chain that updates all the scene objects of an element. For example, all entity kinematic states will have a DtDeadReckonUpdater and perhaps a ground clamping updater (if specified in the Kinematic State visualizer definition for the 3D model set, processed in processKinematicStateDefinition). These updaters are "chained", the kinematic state sends spatial info to the DtDeadReckonUpdater which calculates and modifies the values, these are then passed to the DtGroundClampingUpdater, which will modify the spatial info again and finally send them to the scene object.

As there is one kinematic state object per element, and therefore one updater chain per element, when ground clamping or buoyancy are turned off/on they will be applied to ALL scene objects for all model sets of that element. This means that 2D icons positions/orientations can be clamped.

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

Public Member Functions

 DtKinematicState (DtStateListener &listener, DtAgentManagerInterface &sceneInterface, DtSharedSettingsManager &settingsManager)
 
virtual ~DtKinematicState ()
 
 DtKinematicState ()=delete
 
 DtKinematicState (const DtKinematicState &)=delete
 
DtKinematicStateoperator= (const DtKinematicState &)=delete
 
virtual void initialize ()
 
virtual void processKinematicStateDefinition (const DtVisualizerDefinition *visDef)
 
virtual void createUpdaters ()=0
 
virtual void destroyUpdaters ()=0
 
virtual void addSceneObject (DtModelSetId modelSet, DtSceneObjectAgent *sceneObjectAgent)
 
virtual void removeSceneObject (DtModelSetId modelSet, DtSceneObjectAgent *sceneObjectAgent)
 
virtual DtSceneObjectAgent * findSceneObjectForModelSet (DtModelSetId modelSet)
 
virtual bool distribute () const
 
virtual void setDistribute (const bool distribute)
 

Protected Types

using SceneObjectMap = std::unordered_map< DtModelSetId, DtSceneObjectAgent * >
 

Protected Member Functions

virtual void connectToListenerSignals ()
 
virtual void connectToSettingsSignals ()=0
 
virtual void addSceneObjectToUpdaters (DtModelSetId modelSet, DtSceneObjectAgent *sceneObjectAgent)=0
 
virtual void removeSceneObjectFromUpdaters (DtModelSetId modelSet, DtSceneObjectAgent *sceneObjectAgent)=0
 

Protected Attributes

SceneObjectMap mySceneObjectMap
 
DtStateListenermyStateListener
 
DtAgentManagerInterfacemySceneInterface
 
DtSharedSettingsManagermySettingsManager
 
DtSignalConnectionManager myConnections
 
DtUniqueID myEmbarkedParentSceneObjectID
 
bool myEmbarkedFlag
 
bool myInitialized
 
bool myDistributeFlag
 
virtual void setParentElement (DtElement *parent)
 
virtual void setEmbarked (const DtUniqueID &id)
 
virtual void startEmbarked ()=0
 
virtual void endEmbarked ()=0
 

Member Typedef Documentation

using makVrv::DtKinematicState::SceneObjectMap = std::unordered_map<DtModelSetId, DtSceneObjectAgent*>
protected

Model set to scene object map.

Constructor & Destructor Documentation

makVrv::DtKinematicState::DtKinematicState ( DtStateListener listener,
DtAgentManagerInterface sceneInterface,
DtSharedSettingsManager settingsManager 
)

CTOR.

virtual makVrv::DtKinematicState::~DtKinematicState ( )
virtual

DTOR.

makVrv::DtKinematicState::DtKinematicState ( )
delete

not allowed - default constructor

makVrv::DtKinematicState::DtKinematicState ( const DtKinematicState )
delete

not allowed - copy constructor

Member Function Documentation

DtKinematicState& makVrv::DtKinematicState::operator= ( const DtKinematicState )
delete

not allowed - equals operator

virtual void makVrv::DtKinematicState::initialize ( )
virtual

Initialize the Kinematic State Object Call processKinematicStateDefinition before initialize.

Reimplemented in makVrv::DtEntityKinematicState, makVrv::DtEnvironmentalKinematicState, makVrv::DtShapeEnvironmentalKinematicState, and makVrv::DtVertexEnvironmentalKinematicState.

virtual void makVrv::DtKinematicState::createUpdaters ( )
pure virtual
virtual void makVrv::DtKinematicState::destroyUpdaters ( )
pure virtual
virtual void makVrv::DtKinematicState::addSceneObject ( DtModelSetId  modelSet,
DtSceneObjectAgent *  sceneObjectAgent 
)
virtual

Scene object methods.

virtual void makVrv::DtKinematicState::removeSceneObject ( DtModelSetId  modelSet,
DtSceneObjectAgent *  sceneObjectAgent 
)
virtual

Scene object methods.

virtual DtSceneObjectAgent* makVrv::DtKinematicState::findSceneObjectForModelSet ( DtModelSetId  modelSet)
virtual

Attempt to find the scene object for a give model set, can return nullptr.

virtual bool makVrv::DtKinematicState::distribute ( ) const
virtual

Get / Set the distribute flag, used when updater agents are created. When set to true these agents will be sent to remote displays.

virtual void makVrv::DtKinematicState::setDistribute ( const bool  distribute)
virtual

Get / Set the distribute flag, used when updater agents are created. When set to true these agents will be sent to remote displays.

virtual void makVrv::DtKinematicState::processKinematicStateDefinition ( const DtVisualizerDefinition visDef)
virtual

Processor the vis def for the kin state, as we no longer have a kin state visualizer The definition for DtModelSetId::Models3D (0) is currently used for the whole element kinematic object In the future, whole element parameters will be added and these will be used instead Call this BEFORE initialize.

Reimplemented in makVrv::DtEntityKinematicState.

virtual void makVrv::DtKinematicState::setParentElement ( DtElement parent)
virtual

Embarkation / ParentingAttempts to find a valid scene object id from the parent element calls setEmbarked if one is found. Uses the 3D Models ( ModelSet3dModels ) scene object if it is available, if not it will then try the Icons2D scene object and finally the ModelsColorized scene object.

virtual void makVrv::DtKinematicState::setEmbarked ( const DtUniqueID id)
protectedvirtual

Embarks this object on the specified parent scene object Sets myEmbarkedParentSceneObjectID and myEmbarkedFlag calls startEmbarked()

virtual void makVrv::DtKinematicState::startEmbarked ( )
protectedpure virtual

Pure virtual - implemented by derived classes startEmbarked requires an embarkation updater Tells the embarkation updater to embark the entity on myEmbarkedParentSceneObjectID.

Implemented in makVrv::DtEntityKinematicState, makVrv::DtShapeEnvironmentalKinematicState, makVrv::DtEnvironmentalKinematicState, and makVrv::DtVertexEnvironmentalKinematicState.

virtual void makVrv::DtKinematicState::endEmbarked ( )
protectedpure virtual

Embarkation / ParentingAttempts to find a valid scene object id from the parent element calls setEmbarked if one is found. Uses the 3D Models ( ModelSet3dModels ) scene object if it is available, if not it will then try the Icons2D scene object and finally the ModelsColorized scene object.

Implemented in makVrv::DtEntityKinematicState, makVrv::DtShapeEnvironmentalKinematicState, makVrv::DtEnvironmentalKinematicState, and makVrv::DtVertexEnvironmentalKinematicState.

virtual void makVrv::DtKinematicState::connectToListenerSignals ( )
protectedvirtual
virtual void makVrv::DtKinematicState::connectToSettingsSignals ( )
protectedpure virtual

Not implemented - derived kin states do.

Implemented in makVrv::DtEntityKinematicState, and makVrv::DtEnvironmentalKinematicState.

virtual void makVrv::DtKinematicState::addSceneObjectToUpdaters ( DtModelSetId  modelSet,
DtSceneObjectAgent *  sceneObjectAgent 
)
protectedpure virtual
virtual void makVrv::DtKinematicState::removeSceneObjectFromUpdaters ( DtModelSetId  modelSet,
DtSceneObjectAgent *  sceneObjectAgent 
)
protectedpure virtual

Member Data Documentation

SceneObjectMap makVrv::DtKinematicState::mySceneObjectMap
protected
DtStateListener& makVrv::DtKinematicState::myStateListener
protected
DtAgentManagerInterface& makVrv::DtKinematicState::mySceneInterface
protected
DtSharedSettingsManager& makVrv::DtKinematicState::mySettingsManager
protected
DtSignalConnectionManager makVrv::DtKinematicState::myConnections
protected
DtUniqueID makVrv::DtKinematicState::myEmbarkedParentSceneObjectID
protected

There is now one updater chain, the embarkation updater uses the 3D Models ( ModelSet3dModels ) scene object to update from if it is available, if not it will then try the Icons2D scene object and finally the ModelsColorized scene object.

bool makVrv::DtKinematicState::myEmbarkedFlag
protected
bool makVrv::DtKinematicState::myInitialized
protected

Has initialized been called before. Used so that signals are only connected once.

bool makVrv::DtKinematicState::myDistributeFlag
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)