VR-Forces 4.0.4 Class Documentation
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes

The DtDriver for CIGI. More...

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

List of all members.

Public Member Functions

 DtCigiDriver (DtAgentManager &agentManager, const std::string &uniqueName)
 Constructor.
virtual ~DtCigiDriver ()
 Destructor.
virtual const std::string & className () const
 Get this Driver's class name.
const DtCigiConnectionInitializerconnectionSettings () const
 Returns the CIGI connection settings.
virtual void setConnectionSettings (const DtCigiConnectionInitializer &settings)
 Set the connection settings.
virtual DtConfiguration createConfiguration () const
 Create a configuration for the driver.
virtual void realizeConfiguration (const DtConfiguration &config)
 Realize the driver via a generic configuration.
virtual void run ()
 Function that will be called when the thread is started.
virtual DtAgentManagerInterfacesceneInterface ()
 Returns the scene interface.
virtual bool useThreadFlag () const
 Returns whether the CIGI Driver is using a separate thread for CIGI message processing.
virtual void addDriverFunction (boost::function< void()> func)
 Adds a function to be run from the driver queue.
virtual void generateLosResponse (int losId, DtUniqueID entityId, bool visible, double range, int responseCount, int hostFrame)
 Generate a line-of-sight response.
virtual void generateHatHotResponse (double height, unsigned int hotId, bool hat, unsigned int lastFrame, bool valid)
 Generate a line-of-sight response.

Public Attributes

boost::signal< void(DtCigiConnection *)> signal_sessionCreated
 This signal is emitted when the CIGI session is created.
boost::signal< void(DtCigiConnection *)> signal_sessionAboutToBeDestroyed
 This signal is emitted when the CIGI session is about to be destroyed.

Protected Types

typedef DtLockedBufferedQueue
< boost::function< void()> > 
FunctionCallQueue
 Typedefs for the function lists.
typedef std::vector
< boost::function< void()> > 
FunctionCallList

Protected Member Functions

virtual bool onStart ()
 Start the driver processing.
virtual bool onStop ()
 Stop the driver processing.
virtual bool onTick ()
 Tick the driver.
virtual void startThread ()
 Starts a separate thread that executes the run method.
virtual void stopThread ()
 Stops the separate thread.
virtual void setConnectionState (bool connected)
 Sets the connection state.
virtual void slot_onLoadDatabase (const std::string &filename)
 Slot called when signal_loadDatabase is received from the DtCigiConnection.
virtual void performLoadDatabase (const std::string &filename)
 Performs the database load and calls setDatabaseLoaded on the DtCigiConnection.
virtual void slot_onCoordinateSystemChanged (const std::string &name, const std::string &params)
 Slot called when the IG's coordinate system changes.
virtual void runFunctionQueue (FunctionCallQueue &queue)
 Iterates through the function queue and executes the functions.

Protected Attributes

bool myUseThreadFlag
 Determines whether the reading/processing/sending of CIGI messages should be performed in a separate thread or not.
DtThread * myThread
 The (possible) other thread that performs CIGI operations.
DtCigiConnectionmyConnection
 The CIGI connection that performs network IO and message processing.
DtLosRespondermyLosResponder
 The line-of-sight responder held by the connection.
bool myConnectedFlag
 Whether we are connected to the network or not.
DtCigiConnectionInitializermyInitializer
DtAsynchronousEventQueuemyAsynchronousEventQueue
DtAsynchronousAgentManagermyAsynchronousInterface
DtDemyDe
FunctionCallQueue myDriverThreadFunctions
FunctionCallQueue mySimulationThreadFunctions
DtSignalConnectionManager myDynamicSignals
DtCigiViewControllermyViewController
 Processes CIGI view control/definition messages.
DtIgSettingsControllermyComponentController
 Processes system/view component controls and other messages that change IG settings.
DtCigiIntersectionHandlermyIntersectionHandler
 Processes HAT/HOT/LOS requests.
double myNextFrameTime
 When we should next process CIGI messages.

Static Protected Attributes

static std::string theCigiDriverClassName

Detailed Description

The DtDriver for CIGI.

Provides communication between the IG (DtDe) and the DtCigiConnection which does most of the actual processing of CIGI messages (except for those that need the DtDe, like HAT/HOT/LOS, etc)


Member Typedef Documentation

typedef DtLockedBufferedQueue<boost::function<void ()> > makVrv::DtCigiDriver::FunctionCallQueue [protected]

Typedefs for the function lists.

typedef std::vector<boost::function<void ()> > makVrv::DtCigiDriver::FunctionCallList [protected]

Constructor & Destructor Documentation

makVrv::DtCigiDriver::DtCigiDriver ( DtAgentManager agentManager,
const std::string &  uniqueName 
)

Constructor.

virtual makVrv::DtCigiDriver::~DtCigiDriver ( ) [virtual]

Destructor.


Member Function Documentation

virtual const std::string& makVrv::DtCigiDriver::className ( ) const [virtual]

Get this Driver's class name.

Implements makVrv::DtDriver.

Returns the CIGI connection settings.

References myInitializer.

virtual void makVrv::DtCigiDriver::setConnectionSettings ( const DtCigiConnectionInitializer settings) [virtual]

Set the connection settings.

Create a configuration for the driver.

Reimplemented from makVrv::DtDriver.

virtual void makVrv::DtCigiDriver::realizeConfiguration ( const DtConfiguration config) [virtual]

Realize the driver via a generic configuration.

Reimplemented from makVrv::DtDriver.

virtual void makVrv::DtCigiDriver::run ( ) [virtual]

Function that will be called when the thread is started.

Runs the loop that ticks the driver, processes CIGI messages, updates the IG, and sends any responses/start-of-frame.

Returns the scene interface.

Returns an asynchronous interface if running a separate thread.

Reimplemented from makVrv::DtDriver.

virtual bool makVrv::DtCigiDriver::useThreadFlag ( ) const [virtual]

Returns whether the CIGI Driver is using a separate thread for CIGI message processing.

virtual void makVrv::DtCigiDriver::addDriverFunction ( boost::function< void()>  func) [virtual]

Adds a function to be run from the driver queue.

virtual void makVrv::DtCigiDriver::generateLosResponse ( int  losId,
DtUniqueID  entityId,
bool  visible,
double  range,
int  responseCount,
int  hostFrame 
) [virtual]

Generate a line-of-sight response.

Calls DtLosResponder::generateLosResponse directly if the driver is in a single thread or queue the response on mySimulationThreadFunctions queue if run in a separate thread.

Parameters:
losIdThe ID of the LOS response
entityIdThe unique ID of the entity that was intersected
visibleSet to true if there were no intersection
rangeDistance from the source before an intersection was hit.
responseCountThe number of intersections made with the request.
hostFrameThe last host frame when the calculation was made.
virtual void makVrv::DtCigiDriver::generateHatHotResponse ( double  height,
unsigned int  hotId,
bool  hat,
unsigned int  lastFrame,
bool  valid 
) [virtual]

Generate a line-of-sight response.

Calls DtCigiConnection::sendHatHotResponse directly if the driver is in a single thread or queue the response on mySimulationThreadFunctions queue if run in a separate thread.

Parameters:
heightThe HAT/HOT
hotIdThe ID of the HAT/HOT response
hatHAT if true, HOT if false
lastFrameThe last host frame when the calculation was made.
validTrue if an intersection was made
virtual bool makVrv::DtCigiDriver::onStart ( ) [protected, virtual]

Start the driver processing.

Implements makVrv::DtDriver.

virtual bool makVrv::DtCigiDriver::onStop ( ) [protected, virtual]

Stop the driver processing.

Implements makVrv::DtDriver.

virtual bool makVrv::DtCigiDriver::onTick ( ) [protected, virtual]

Tick the driver.

Runs the driver functions if multi-threaded. Otherwise, processes any incoming messages, and sends any responses.

Implements makVrv::DtDriver.

virtual void makVrv::DtCigiDriver::startThread ( ) [protected, virtual]

Starts a separate thread that executes the run method.

virtual void makVrv::DtCigiDriver::stopThread ( ) [protected, virtual]

Stops the separate thread.

virtual void makVrv::DtCigiDriver::setConnectionState ( bool  connected) [protected, virtual]

Sets the connection state.

virtual void makVrv::DtCigiDriver::slot_onLoadDatabase ( const std::string &  filename) [protected, virtual]

Slot called when signal_loadDatabase is received from the DtCigiConnection.

virtual void makVrv::DtCigiDriver::performLoadDatabase ( const std::string &  filename) [protected, virtual]

Performs the database load and calls setDatabaseLoaded on the DtCigiConnection.

virtual void makVrv::DtCigiDriver::slot_onCoordinateSystemChanged ( const std::string &  name,
const std::string &  params 
) [protected, virtual]

Slot called when the IG's coordinate system changes.

Updates the connection's coordinate system in a thread-safe manner.

virtual void makVrv::DtCigiDriver::runFunctionQueue ( FunctionCallQueue queue) [protected, virtual]

Iterates through the function queue and executes the functions.


Member Data Documentation

This signal is emitted when the CIGI session is created.

This signal is emitted when the CIGI session is about to be destroyed.

std::string makVrv::DtCigiDriver::theCigiDriverClassName [static, protected]

Determines whether the reading/processing/sending of CIGI messages should be performed in a separate thread or not.

DtThread* makVrv::DtCigiDriver::myThread [protected]

The (possible) other thread that performs CIGI operations.

The CIGI connection that performs network IO and message processing.

This object should be used in a threadsafe manner (i.e. through the function queue.

The line-of-sight responder held by the connection.

Whether we are connected to the network or not.

Referenced by connectionSettings().

Processes CIGI view control/definition messages.

Processes system/view component controls and other messages that change IG settings.

Processes HAT/HOT/LOS requests.

When we should next process CIGI messages.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)