VR-Vantage 2.8 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
DtExampleSimEngine Class Reference

Provide a basic sim engine to use in an example showing how to embed a sim engine into a driver that runs in a single thread. More...

Public Member Functions

 DtExampleSimEngine (makVrv::DtDe &de)
 CTOR.
virtual ~DtExampleSimEngine ()
 DTOR.
bool init ()
 Initialize the simulation engine.
bool uninit ()
 Destroy what was created in init()
bool tick (double simTime)
 Perform updates param[in] simTime is he current simulation time.
 DtExampleSimEngine (makVrv::DtDe &de)
 CTOR.
virtual ~DtExampleSimEngine ()
 DTOR.
bool init ()
 Initialize the simulation engine.
bool uninit ()
 Destroy what was created in init()
bool tick (double simTime)
 Perform updates param[in] simTime is he current simulation time.
 DtExampleSimEngine (DtExampleSimulationConnection &connection)
 CTOR.
virtual ~DtExampleSimEngine ()
 DTOR.
bool init ()
 Initialize the simulation engine.
bool uninit ()
 Destroy what was created in init()
bool tick (double simTime)
 Perform updates param[in] simTime is he current simulation time.

Protected Member Functions

virtual void setHoverSignalsActive (bool active)
 Sets whether the sim engine is listening for mouseover events or not in its entity indicator.
virtual void setEntityInfoWidgetActive (bool active)
 Sets whether the entity info widget is displayed or not.
virtual makVrv::DtUnicode generateInfoString () const
 Generates the information string displayed in the entity info widget.
virtual void updatePosition (double simTime)
 Updates the current position / orientation of the entity.
virtual void repositionAircraft (DtVector position, DtTaitBryan ori)
 Positions the aircraft at the given position with the given orientation.
virtual void setHoverSignalsActive (bool active)
 Sets whether the sim engine is listening for mouseover events or not in its entity indicator.
virtual void setEntityInfoWidgetActive (bool active)
 Sets whether the entity info widget is displayed or not.
virtual makVrv::DtUnicode generateInfoString () const
 Generates the information string displayed in the entity info widget.
virtual void updatePosition (double simTime)
 Updates the current position / orientation of the entity.
virtual void repositionAircraft (DtVector position, DtTaitBryan ori)
 Positions the aircraft at the given position with the given orientation.
virtual void setHoverSignalsActive (bool active)
 Sets whether the sim engine is listening for mouseover events or not.
virtual void setEntityInfoWidgetActive (bool active)
 Sets whether the entity info widget is displayed or not.
virtual makVrv::DtUnicode generateInfoString () const
 Generates the information string displayed in the info widget.
virtual void updatePosition (double simTime)
 Updates the current position / orientation of the entity.
virtual void repositionAircraft (DtVector position, DtTaitBryan ori)
 Positions the aircraft at the given position with the given orientation.
void slot_toggleLabelPinnedState (const makVrv::DtSelectionManager::IdSet &selList)
 Boost slots.
void slot_toggleLabelPinnedState (const makVrv::DtSelectionManager::IdSet &selList)
 Boost slots.
void slot_toggleLabelPinnedState (const makVrv::DtSelectionManager::IdSet &sel)
 Boost slots.

Protected Attributes

makVrv::DtDemyDe
makVrv::DtEntity3dFacademyEntityFacade
makVrv::DtEntityIndicatorWidgetmyEntityIndicator
makVrv::DtEntityInfoWidgetmyEntityInfoWidget
makVrv::DtEntityHATLineFacademyEntityHATLineFacade
std::string myEntityDisplayName
bool myEntityInfoWidgetPinnedFlag
DtTaitBryan myOrientation
DtVector myPosition
double myHeading
double myLastCommLineTime
double myLastUpdateTime
DtVector myOrbitCenter
double myAngularVelocity
double myClockAngle
double myRadius
double myRoll
makVrv::DtSignalConnectionManager mySignalConnections
DtExampleSimulationConnectionmySimulationConnection

Detailed Description

Provide a basic sim engine to use in an example showing how to embed a sim engine into a driver that runs in a single thread.

Provide an example sim engine to use in an example showing how to embed a sim engine into a driver that runs in a separate thread.

The vast majority of this code is identical to the DtExampleSimEngine code in the exampleThreadedDriver example. Comparing the two is worthwhile. It creates an aircraft, with a HAT line and entity indicator, and updates it to fly in a circle and display the entity info widget when the mouse is over the entity indicator. The only significant difference between this code and the code in exampleThreadedDriver is that instead of using a connection, its using the display engine (DtDe) interface provided by the driver; and getting sim time from the DtDe instead of from the connection.

The vast majority of this code was extracted directly from DtExampleDriver. It creates an aircraft, with a HAT line and entity indicator, and updates it to fly in a circle and display the entity info widget when the mouse is over the entity indicator. The only significant difference between this code and the code extracted from exampleDriver is that instead of using the agent manager provided to the driver, its using the agent manager interface (sceneInterface()) provided by the connection; and getting sim time from the connection instead of from the DtDe. Note that we could have just grabbed clock time, but this demonstrates a way of moving this piece of data (sim time) from the driver to the connection.

Constructor & Destructor Documentation

DtExampleSimEngine::DtExampleSimEngine ( makVrv::DtDe de)

CTOR.

Parameters
[in]deis a a reference to the Display Engine
virtual DtExampleSimEngine::~DtExampleSimEngine ( )
virtual

DTOR.

DtExampleSimEngine::DtExampleSimEngine ( makVrv::DtDe de)

CTOR.

Parameters
[in]deis a a reference to the Display Engine
virtual DtExampleSimEngine::~DtExampleSimEngine ( )
virtual

DTOR.

DtExampleSimEngine::DtExampleSimEngine ( DtExampleSimulationConnection connection)

CTOR.

Parameters
[in]connectionis an simple example connection object.
virtual DtExampleSimEngine::~DtExampleSimEngine ( )
virtual

DTOR.

Member Function Documentation

bool DtExampleSimEngine::init ( )

Initialize the simulation engine.

In this case, the entity facade, indicators, and hat line are created.

Returns
true if the initialization succeeds; false otherwise
bool DtExampleSimEngine::uninit ( )

Destroy what was created in init()

Returns
true if the initialization succeeds; false otherwise
bool DtExampleSimEngine::tick ( double  simTime)

Perform updates param[in] simTime is he current simulation time.

Returns
true on success; false otherwise
void DtExampleSimEngine::slot_toggleLabelPinnedState ( const makVrv::DtSelectionManager::IdSet selList)
protected

Boost slots.

Slot called by signal to indicate that the label state was changed for the elements listed in the IdSet. If our element ID is among them, we will call setEntityInfoWidgetActive param[in] selList is the list of the currently selected elements

virtual void DtExampleSimEngine::setHoverSignalsActive ( bool  active)
protectedvirtual

Sets whether the sim engine is listening for mouseover events or not in its entity indicator.

virtual void DtExampleSimEngine::setEntityInfoWidgetActive ( bool  active)
protectedvirtual

Sets whether the entity info widget is displayed or not.

virtual makVrv::DtUnicode DtExampleSimEngine::generateInfoString ( ) const
protectedvirtual

Generates the information string displayed in the entity info widget.

virtual void DtExampleSimEngine::updatePosition ( double  simTime)
protectedvirtual

Updates the current position / orientation of the entity.

virtual void DtExampleSimEngine::repositionAircraft ( DtVector  position,
DtTaitBryan  ori 
)
protectedvirtual

Positions the aircraft at the given position with the given orientation.

bool DtExampleSimEngine::init ( )

Initialize the simulation engine.

In this case, the entity facade, indicators, and hat line are created.

Returns
true if the initialization succeeds; false otherwise
bool DtExampleSimEngine::uninit ( )

Destroy what was created in init()

Returns
true if the initialization succeeds; false otherwise
bool DtExampleSimEngine::tick ( double  simTime)

Perform updates param[in] simTime is he current simulation time.

Returns
true on success; false otherwise
void DtExampleSimEngine::slot_toggleLabelPinnedState ( const makVrv::DtSelectionManager::IdSet selList)
protected

Boost slots.

Slot called by signal to indicate that the label state was changed for the elements listed in the IdSet. If our element ID is among them, we will call setEntityInfoWidgetActive param[in] selList is the list of the currently selected elements

virtual void DtExampleSimEngine::setHoverSignalsActive ( bool  active)
protectedvirtual

Sets whether the sim engine is listening for mouseover events or not in its entity indicator.

virtual void DtExampleSimEngine::setEntityInfoWidgetActive ( bool  active)
protectedvirtual

Sets whether the entity info widget is displayed or not.

virtual makVrv::DtUnicode DtExampleSimEngine::generateInfoString ( ) const
protectedvirtual

Generates the information string displayed in the entity info widget.

virtual void DtExampleSimEngine::updatePosition ( double  simTime)
protectedvirtual

Updates the current position / orientation of the entity.

virtual void DtExampleSimEngine::repositionAircraft ( DtVector  position,
DtTaitBryan  ori 
)
protectedvirtual

Positions the aircraft at the given position with the given orientation.

bool DtExampleSimEngine::init ( )

Initialize the simulation engine.

In this case, the entity facade, indicators, and hat line are created.

Returns
true if the initialization succeeds; false otherwise
bool DtExampleSimEngine::uninit ( )

Destroy what was created in init()

Returns
true if the initialization succeeds; false otherwise
bool DtExampleSimEngine::tick ( double  simTime)

Perform updates param[in] simTime is he current simulation time.

Returns
true on success; false otherwise
void DtExampleSimEngine::slot_toggleLabelPinnedState ( const makVrv::DtSelectionManager::IdSet sel)
protected

Boost slots.

Slot called by signal to indicate that the label state was changed for the elements listed in the IdSet. If our element ID is among them, we will call setEntityInfoWidgetActive

virtual void DtExampleSimEngine::setHoverSignalsActive ( bool  active)
protectedvirtual

Sets whether the sim engine is listening for mouseover events or not.

virtual void DtExampleSimEngine::setEntityInfoWidgetActive ( bool  active)
protectedvirtual

Sets whether the entity info widget is displayed or not.

virtual makVrv::DtUnicode DtExampleSimEngine::generateInfoString ( ) const
protectedvirtual

Generates the information string displayed in the info widget.

virtual void DtExampleSimEngine::updatePosition ( double  simTime)
protectedvirtual

Updates the current position / orientation of the entity.

virtual void DtExampleSimEngine::repositionAircraft ( DtVector  position,
DtTaitBryan  ori 
)
protectedvirtual

Positions the aircraft at the given position with the given orientation.

Member Data Documentation

makVrv::DtDe & DtExampleSimEngine::myDe
protected
makVrv::DtEntity3dFacade * DtExampleSimEngine::myEntityFacade
protected
makVrv::DtEntityIndicatorWidget * DtExampleSimEngine::myEntityIndicator
protected
makVrv::DtEntityInfoWidget * DtExampleSimEngine::myEntityInfoWidget
protected
makVrv::DtEntityHATLineFacade * DtExampleSimEngine::myEntityHATLineFacade
protected
std::string DtExampleSimEngine::myEntityDisplayName
protected
bool DtExampleSimEngine::myEntityInfoWidgetPinnedFlag
protected
DtTaitBryan DtExampleSimEngine::myOrientation
protected
DtVector DtExampleSimEngine::myPosition
protected
double DtExampleSimEngine::myHeading
protected
double DtExampleSimEngine::myLastCommLineTime
protected
double DtExampleSimEngine::myLastUpdateTime
protected
DtVector DtExampleSimEngine::myOrbitCenter
protected
double DtExampleSimEngine::myAngularVelocity
protected
double DtExampleSimEngine::myClockAngle
protected
double DtExampleSimEngine::myRadius
protected
double DtExampleSimEngine::myRoll
protected
makVrv::DtSignalConnectionManager DtExampleSimEngine::mySignalConnections
protected
DtExampleSimulationConnection& DtExampleSimEngine::mySimulationConnection
protected

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


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