VR-Vantage 3.1.1 API Documentation
 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. More...

Inheritance diagram for DtExampleSimulationConnection:
Inheritance graph
[legend]

Public Member Functions

 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. More...
 
virtual ~DtExampleSimulationConnection ()
 DTOR. More...
 
virtual bool connect ()
 Function that creates the sim engine. More...
 
virtual bool connected () const
 Terminate the connection. More...
 
virtual bool disconnect ()
 Function that destroys the sim engine. More...
 
virtual void tick ()
 Function to be called repeatedly by a thread. More...
 
const makVrv::DtCoordinateSystemcoordinateSystem () const
 Get the coordinate system. More...
 
double simTime () const
 Get the simulation time. More...
 
void setSimTime (double simTime)
 Set the simulation time. More...
 
- Public Member Functions inherited from makVrv::DtBaseConnection
 DtBaseConnection (DtSharedSettingsManager &settingsManager, DtAgentManagerInterface &aSceneInterface, const DtCoordinateSystem &coordSystem)
 CTOR. More...
 
 DtBaseConnection (DtSharedSettingsManager &settingsManager, DtAgentManagerInterface &aSceneInterface)
 CTOR without a coordsystem. Create a new one. More...
 
virtual ~DtBaseConnection ()
 DTOR MUST call clearInstances first. More...
 
virtual void clearInstances ()
 Clear and delete all instances rooted in the connection MUST be called before the connection is destroyed. More...
 
virtual void coordinateSystemChanged (const std::string &coordinateName, const std::string &coordinateOrigin)
 process a coordintate system change by passing the new coordinate system to the DtCoordinateSystem object More...
 
const DtCoordinateSystemcoordinateSystem () const
 get the coordinate system object for this connection More...
 
DtSharedSettingsManagersettingsManager ()
 Get the settings manager. More...
 
virtual DtAgentManagerInterfacesceneInterface ()
 Get the scene manager interface for creating drivers. More...
 
const DtSharedSettingsManagersettingsManager () const
 Get the settings manager. More...
 
DtVisualizerCreationSettingsvisualizerCreationSettings ()
 Get myVisualTypeVisualizerSettings. More...
 
void reportElementCreated (DtElementID id, DtElementID parentId, unsigned int type)
 Report an element created. More...
 
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
 
void reportElementDestroyed (DtElementID id)
 Report an element destroyed. More...
 
const DtElementChangescurrentElementChanges () const
 Look at the current element changes. More...
 
DtElementChangestakeElementChanges ()
 Take the current changes and internally start a new set of changes. More...
 
DtTemporaryAgentManagertemporaryEffects ()
 Get the temporary effects manager. More...
 
DtBlinkingObjectManagerblinkManager ()
 Get the blinking manager. More...
 
DtRandomNumberGeneratorrandomNumberGenerator ()
 Get the simulation's random number generator. More...
 
virtual const std::string & tag ()
 Get the tag identifying which type of connection this is. More...
 
const DtUnicodeemptyString () const
 Allocated empty string. More...
 
virtual DtVirtualBaseClassfindInstance (const std::string &instanceName)
 Find an instance with the given name. More...
 
bool destroyingInstances () const
 Check to see if the simulation is destroying instances. More...
 
virtual void registerInstance (const std::string &instanceName, DtVirtualBaseClass *instance)
 Register an object as an instance of instanceName, and transfer memory ownership of the instance to the DtVrlinkBaseConnection. More...
 

Protected Attributes

DtExampleSimEnginemyExampleSimEngine
 The simulation engine. More...
 
double mySimTime
 Copy of the simulation time. More...
 
- Protected Attributes inherited from makVrv::DtBaseConnection
DtSharedSettingsManagermySettingsManagerCache
 Hold on to the shared simulation manager. More...
 
DtRandomNumberGenerator myRandomNumberGenerator
 The random number generator for the local simulation. More...
 
DtAgentManagerInterfacemySceneInterface
 Thread specific Variables. More...
 
DtElementChangesmyWorkingElementChanges
 Internal working element changes. More...
 
DtTemporaryAgentManagermyTemporaryEffects
 Manager for temporary global effects. More...
 
DtBlinkingObjectManagermyBlinkManager
 Manager for blinking objects. More...
 
DtUnicode myEmptyString
 
InstanceMap myInstances
 Stores a pointer to simulation specific instances. More...
 
bool myDestroyingInstanceFlag
 Flag to store if the connection is destroying the instances in it's DTOR. More...
 
DtCoordinateSystemmyCoordinateSystem
 The local coordinate system the simulation will use. More...
 
DtVisualizerCreationSettingsmyVisualizerCreationSettings
 Creation settings for visualizers. More...
 

Additional Inherited Members

- Public Attributes inherited from makVrv::DtBaseConnection
vrvSignalsLib::signal< void()> signal_coordinateSystemChanged
 Emitted when the coordinate system changed. More...
 
- Protected Types inherited from makVrv::DtBaseConnection
using InstanceMap = std::unordered_map< std::string, DtVirtualBaseClass * >
 

Detailed Description

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.

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:


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