VR-Vantage 2.7 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtStateViewDriver Class Reference

This driver illustrates the use of state views to access sim data. More...

Inheritance diagram for DtStateViewDriver:
Inheritance graph
[legend]

Public Member Functions

 DtStateViewDriver (DtAgentManager &agentManager, const std::string &instanceName)
 CTOR.
virtual ~DtStateViewDriver ()
 DTOR.
virtual const std::stringclassName () const
 Get the class name as a string.
- Public Member Functions inherited from makVrv::DtDriver
 DtDriver (DtAgentManager &agentManager, const std::string &instanceName)
 CTOR.
virtual ~DtDriver ()
 DTOR.
virtual void realizeConfiguration (const DtConfiguration &configuration)
 Realize the driver using the configuration.
virtual DtConfiguration createConfiguration () const
 Create a configuration for the driver.
DtAgentManageragentManager ()
 Get the master scene for this host.
virtual DtAgentManagerInterfacesceneInterface ()
 Get the scene manager interface for creating agents.
bool started () const
 Get this driver's active state.
virtual const std::stringinstanceName () const
 Get this driver's instance name.
virtual bool autoStart () const
 Get whether this driver is set to automatically start if it is persistent.
virtual void setAutoStart (bool autoStart)
 Set whether this driver automatically starts if it is persistent.
virtual bool isWindowDependent () const
 Get whether this driver is set to automatically start when the first window is created and stop when the last window is destroyed.
virtual void setIsWindowDependent (bool dep)
 Set whether this driver is set to automatically start when the first window is created and stop when the last window is destroyed.
virtual void setIsUserControllable (bool)
 Set whether this driver can be started and stopped by the user.
virtual bool isUserControllable () const
 Get whether this driver can be started and stopped by the user.
virtual void setIsPersistent (bool per)
 Set if the driver is persistent and should be saved between runs.
virtual bool isPersistent () const
 Get if the driver is persistent and should be saved between runs.
virtual bool isOnDriverSelectionList () const
 Returns whether or not this driver is to be automatically started/stopped from the driver selection list.
virtual void setOnDriverSelectionList (bool)
 Sets whether or not this item is on the driver selection list.
bool objectFromAgentManager (const DtUniqueID &id) const
 check to see if the object was created using this driver's agent manager.

Protected Member Functions

virtual bool onStart ()
 When late-joining display engines are connected to the master display engine, all drivers are stopped and restarted.
virtual bool onStop ()
 Called when the driver is stopped by the display engine.
virtual void slot_displayEngineAdded (const DtDeRecord &igRecord)
 Called when a display engine is connected; restarts the driver.
virtual bool onTick ()
 Stub implementation since this driver doesn't have anything that needs updating.
virtual void handleAttachToChanged (DtObserver *observer)
 Called by signal when an observer's attachment changes; used as a cue to start listening to the attached entity's state.
DtSimEntryfindSimEntry (DtUniqueID elementId)
 Find a sim entry corresponding to a visual object's unique element ID.
void disableCurrentStateView ()
 Disables the currently active state view.
virtual void slot_stateViewUpdated (DtVrlinkEntityStateView *stateView)
 Called when the currently active state view emits an update.
virtual void slot_simObjectRemoved (DtSimObjectEntry &)
 Called when a sim object is removed, so its state view can be removed from the cache if present.
- Protected Member Functions inherited from makVrv::DtDriver
void applyChangesAndDelete (DtElementChanges *changes)
 Function for apply changes from a changes object and deleting it.
void reportElementCreated (DtElementID id, DtElementID parentId, DtElementEntry::ElementType type)
 Report an element created.
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
 Report an element attribute changed.
void reportElementDestroyed (DtElementID id)
 Report an element destroyed.
void start ()
 Start the driver.
void stop ()
 Stop the driver.
bool tick ()
 Tick the host driver.
virtual void setInstanceName (const std::string &name)
 set the Instance name.
virtual void installAccessories ()
 Installs accessories on this driver.
virtual void uninstallAccessories ()
 Removes accessories from this driver.

Protected Attributes

DtVrlinkEntityStateViewmyStateView
 The currently active state view.
- Protected Attributes inherited from makVrv::DtDriver
DtAgentManagermyAgentManager
bool myStartedFlag
std::string myName
DtConfiguration myConfiguration
bool myPersistentFlag
bool myUserControllableFlag
bool myRequestStateDiffPendingFlag
DtElementChanges myChanges

Detailed Description

This driver illustrates the use of state views to access sim data.

When the DtAttachManager emits its attachment changed signal, the DtStateViewDriver will get a state view onto the currently attached entity and print out some information from the sim state at a 1hz update rate.

Constructor & Destructor Documentation

DtStateViewDriver::DtStateViewDriver ( DtAgentManager agentManager,
const std::string instanceName 
)

CTOR.

virtual DtStateViewDriver::~DtStateViewDriver ( )
virtual

DTOR.

Member Function Documentation

virtual const std::string& DtStateViewDriver::className ( ) const
virtual

Get the class name as a string.

Implements makVrv::DtDriver.

virtual bool DtStateViewDriver::onStart ( )
protectedvirtual

When late-joining display engines are connected to the master display engine, all drivers are stopped and restarted.

It is critical to implement these methods correctly to make late-joining display engines work correctly. Called when the driver is started by the display engine Restores state that existed the last time the driver was stopped

Implements makVrv::DtDriver.

virtual bool DtStateViewDriver::onStop ( )
protectedvirtual

Called when the driver is stopped by the display engine.

Implements makVrv::DtDriver.

virtual void DtStateViewDriver::slot_displayEngineAdded ( const DtDeRecord igRecord)
protectedvirtual

Called when a display engine is connected; restarts the driver.

Reimplemented from makVrv::DtDriver.

virtual bool DtStateViewDriver::onTick ( )
protectedvirtual

Stub implementation since this driver doesn't have anything that needs updating.

Implements makVrv::DtDriver.

virtual void DtStateViewDriver::handleAttachToChanged ( DtObserver observer)
protectedvirtual

Called by signal when an observer's attachment changes; used as a cue to start listening to the attached entity's state.

DtSimEntry* DtStateViewDriver::findSimEntry ( DtUniqueID  elementId)
protected

Find a sim entry corresponding to a visual object's unique element ID.

void DtStateViewDriver::disableCurrentStateView ( )
protected

Disables the currently active state view.

virtual void DtStateViewDriver::slot_stateViewUpdated ( DtVrlinkEntityStateView stateView)
protectedvirtual

Called when the currently active state view emits an update.

virtual void DtStateViewDriver::slot_simObjectRemoved ( DtSimObjectEntry )
protectedvirtual

Called when a sim object is removed, so its state view can be removed from the cache if present.

Member Data Documentation

DtVrlinkEntityStateView* DtStateViewDriver::myStateView
protected

The currently active state view.


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


Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)