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 Attributes
DtExampleSimulationConnection Class Reference

DtExampleSimulationConnection.

We use the idea of a connection to provide some basic functionality that any object (potentially) running in a separate thread might need. A reference to the connection is typically passed to all objects that will execute in the thread, much the same way a reference to DtDe is passed to all objects executing in the main thread. It provides access to the scene interface, settings manager, element data reporting, and provides a common place to register singleton instances. This derived example connection clones the current coordinate system object on creation and makes that available as well. It also provides the link that let's us provide simulation time from the driver to the sim engine.

Inheritance diagram for DtExampleSimulationConnection:
Inheritance graph
[legend]

Public Member Functions

 DtExampleSimulationConnection (makVrv::DtAgentManagerInterface &sceneInterface, const makVrv::DtCoordinateSystem &coordSystem, makVrv::DtSharedSettingsManager &settingsManager)
 
virtual ~DtExampleSimulationConnection ()
 
virtual bool connect ()
 
virtual bool connected () const
 
virtual bool disconnect ()
 
virtual void tick ()
 
const makVrv::DtCoordinateSystem & coordinateSystem () const
 
double simTime () const
 
void setSimTime (double simTime)
 
- Public Member Functions inherited from makVrv::DtBaseConnection
 DtBaseConnection (DtSharedSettingsManager &settingsManager, DtAgentManagerInterface &aSceneInterface, const DtCoordinateSystem &coordSystem)
 
 DtBaseConnection (DtSharedSettingsManager &settingsManager, DtAgentManagerInterface &aSceneInterface)
 
virtual ~DtBaseConnection ()
 
virtual void clearInstances ()
 
virtual void coordinateSystemChanged (const std::string &coordinateName, const std::string &coordinateOrigin)
 
const DtCoordinateSystem & coordinateSystem () const
 
DtSharedSettingsManager & settingsManager ()
 
virtual DtAgentManagerInterface & sceneInterface ()
 
const DtSharedSettingsManager & settingsManager () const
 
DtVisualizerCreationSettings & visualizerCreationSettings ()
 
void reportElementCreated (DtElementID id, DtElementID parentId, unsigned int type)
 
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
 
void reportElementDestroyed (DtElementID id)
 
const DtElementChanges & currentElementChanges () const
 
DtElementChanges * takeElementChanges ()
 
DtTemporaryAgentManager & temporaryEffects ()
 
DtBlinkingObjectManager & blinkManager ()
 
DtRandomNumberGenerator & randomNumberGenerator ()
 
virtual const std::string & tag ()
 
const DtUnicode & emptyString () const
 
virtual DtVirtualBaseClass * findInstance (const std::string &instanceName)
 
bool destroyingInstances () const
 
virtual void registerInstance (const std::string &instanceName, DtVirtualBaseClass *instance)
 

Protected Attributes

DtExampleSimEngine * myExampleSimEngine
 
double mySimTime
 
- Protected Attributes inherited from makVrv::DtBaseConnection
DtSharedSettingsManager & mySettingsManagerCache
 
DtRandomNumberGenerator myRandomNumberGenerator
 
DtAgentManagerInterface & mySceneInterface
 
DtElementChanges * myWorkingElementChanges
 
DtTemporaryAgentManager * myTemporaryEffects
 
DtBlinkingObjectManager * myBlinkManager
 
DtUnicode myEmptyString
 
InstanceMap myInstances
 
bool myDestroyingInstanceFlag
 
DtCoordinateSystem * myCoordinateSystem
 
DtVisualizerCreationSettings * myVisualizerCreationSettings
 

Additional Inherited Members

- Public Attributes inherited from makVrv::DtBaseConnection
vrvSignalsLib::signal< void()> signal_coordinateSystemChanged
 
boost::signalslib::signal< void()> signal_preConnectionTick
 
boost::signalslib::signal< void()> signal_postConnectionTick
 
- Protected Types inherited from makVrv::DtBaseConnection
using InstanceMap = std::unordered_map< std::string, DtVirtualBaseClass * >
 

Constructor & Destructor Documentation

DtExampleSimulationConnection::DtExampleSimulationConnection ( makVrv::DtAgentManagerInterface &  sceneInterface,
const makVrv::DtCoordinateSystem &  coordSystem,
makVrv::DtSharedSettingsManager &  settingsManager 
)

CTOR param[in] sceneInterface is a reference to either a DtAgentManager or a DtAsynchronousManager, depending on whether or not this connection is going to be used in a separate thread param[in] coordSystem is cloned (not strictly necessary if used in the main thread, but it does it regardless param[in] settingsManager allows the objects using the connection to check for current settings that are maintained in the main thread. This includes access to a signaler that will raise signals (in whichever thread the connection is running in) when those settings change.

virtual DtExampleSimulationConnection::~DtExampleSimulationConnection ( )
virtual

DTOR.

Member Function Documentation

virtual bool DtExampleSimulationConnection::connect ( )
virtual

Function that creates the sim engine.

Returns
true if connect succeeds; false otherwise
virtual bool DtExampleSimulationConnection::connected ( ) const
virtual

Terminate the connection.

Returns
true if connected; false otherwise
virtual bool DtExampleSimulationConnection::disconnect ( )
virtual

Function that destroys the sim engine.

Returns
true if disconnect succeeds; false otherwise
virtual void DtExampleSimulationConnection::tick ( )
virtual

Function to be called repeatedly by a thread.

const makVrv::DtCoordinateSystem& DtExampleSimulationConnection::coordinateSystem ( ) const

Get the coordinate system. NOTE WELL: A more complete implementation would listen for the coordinate system changed signal and update this when needed.

Returns
a reference to the connection's copy of the coordinate system
double DtExampleSimulationConnection::simTime ( ) const

Get the simulation time.

Returns
the current simulation time
void DtExampleSimulationConnection::setSimTime ( double  simTime)

Set the simulation time. The driver puts this function on the connection's function queue with the current simulation time param[in] simTime is the current simulation time.

Member Data Documentation

DtExampleSimEngine* DtExampleSimulationConnection::myExampleSimEngine
protected

The simulation engine.

double DtExampleSimulationConnection::mySimTime
protected

Copy of the simulation time.


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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)