VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | 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]

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 queueDriverFunction (boost::function< void()> func)
 Queues a function to be run from the driver thread.
virtual void queueConnectionFunction (boost::function< void()> func)
 Queues a function to be run from the connection thread.
void reportSmoothingEnabledChanged (bool enabled)
- Public Member Functions inherited from makVrv::DtDriver
 DtDriver (DtAgentManager &agentManager, const std::string &instanceName)
 CTOR.
virtual ~DtDriver ()
 DTOR.
DtAgentManageragentManager ()
 Get the master scene for this host.
bool started () const
 Get this driver's active state.
virtual const std::string & instanceName () 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.

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 connects to DtTerrainPatchObjectSignaler::signal_terrainPatchCreated.
virtual void slot_terrainPatchCreated ()
 Called when signal_terrainPatchCreated is raised and connects to DtDe::signal_preTick.
virtual void slot_firstTickAfterTerrainPatchCreated ()
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 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 slot_displayEngineAdded (const DtDeRecord &igRecord)
 Called when a display engine is added.
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

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 myConnectionThreadFunctions
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.
- Protected Attributes inherited from makVrv::DtDriver
DtAgentManagermyAgentManager
bool myStartedFlag
std::string myName
DtConfiguration myConfiguration
bool myPersistentFlag
bool myUserControllableFlag
bool myRequestStateDiffPendingFlag
DtElementChanges myChanges

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.

const DtCigiConnectionInitializer & makVrv::DtCigiDriver::connectionSettings ( ) const
inline

Returns the CIGI connection settings.

References myInitializer.

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

Set the connection settings.

virtual DtConfiguration makVrv::DtCigiDriver::createConfiguration ( ) const
virtual

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.

virtual DtAgentManagerInterface& makVrv::DtCigiDriver::sceneInterface ( )
virtual

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::queueDriverFunction ( boost::function< void()>  func)
virtual

Queues a function to be run from the driver thread.

virtual void makVrv::DtCigiDriver::queueConnectionFunction ( boost::function< void()>  func)
virtual

Queues a function to be run from the connection thread.

void makVrv::DtCigiDriver::reportSmoothingEnabledChanged ( bool  enabled)
virtual bool makVrv::DtCigiDriver::onStart ( )
protectedvirtual

Start the driver processing.

Implements makVrv::DtDriver.

virtual bool makVrv::DtCigiDriver::onStop ( )
protectedvirtual

Stop the driver processing.

Implements makVrv::DtDriver.

virtual bool makVrv::DtCigiDriver::onTick ( )
protectedvirtual

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 ( )
protectedvirtual

Starts a separate thread that executes the run method.

virtual void makVrv::DtCigiDriver::stopThread ( )
protectedvirtual

Stops the separate thread.

virtual void makVrv::DtCigiDriver::setConnectionState ( bool  connected)
protectedvirtual

Sets the connection state.

virtual void makVrv::DtCigiDriver::slot_onLoadDatabase ( const std::string &  filename)
protectedvirtual

Slot called when signal_loadDatabase is received from the DtCigiConnection.

When multi-threaded, this requests that performLoadDatabase run in the render thread; otherwise it calls performLoadDatabase directly.

virtual void makVrv::DtCigiDriver::performLoadDatabase ( const std::string &  filename)
protectedvirtual

Performs the database load and connects to DtTerrainPatchObjectSignaler::signal_terrainPatchCreated.

That signal is raised when a terrain is loaded from disk (or a connection to an osgEarth server is established.

virtual void makVrv::DtCigiDriver::slot_terrainPatchCreated ( )
protectedvirtual

Called when signal_terrainPatchCreated is raised and connects to DtDe::signal_preTick.

signal_preTick is the first tick after the terrain database is loaded; This gives OSG a chance to process the terrain for a (typically long) frame

virtual void makVrv::DtCigiDriver::slot_firstTickAfterTerrainPatchCreated ( )
protectedvirtual
virtual void makVrv::DtCigiDriver::slot_onCoordinateSystemChanged ( const std::string &  name,
const std::string &  params 
)
protectedvirtual

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)
protectedvirtual

Iterates through the function queue and executes the functions.

Member Data Documentation

boost::signal<void (DtCigiConnection*)> makVrv::DtCigiDriver::signal_sessionCreated

This signal is emitted when the CIGI session is created.

boost::signal<void (DtCigiConnection*)> makVrv::DtCigiDriver::signal_sessionAboutToBeDestroyed

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

std::string makVrv::DtCigiDriver::theCigiDriverClassName
staticprotected
bool makVrv::DtCigiDriver::myUseThreadFlag
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.

DtCigiConnection* makVrv::DtCigiDriver::myConnection
protected

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.

DtLosResponder* makVrv::DtCigiDriver::myLosResponder
protected

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

bool makVrv::DtCigiDriver::myConnectedFlag
protected

Whether we are connected to the network or not.

DtCigiConnectionInitializer* makVrv::DtCigiDriver::myInitializer
protected

Referenced by connectionSettings().

DtAsynchronousEventQueue* makVrv::DtCigiDriver::myAsynchronousEventQueue
protected
DtAsynchronousAgentManager* makVrv::DtCigiDriver::myAsynchronousInterface
protected
DtDe& makVrv::DtCigiDriver::myDe
protected
FunctionCallQueue makVrv::DtCigiDriver::myDriverThreadFunctions
protected
FunctionCallQueue makVrv::DtCigiDriver::myConnectionThreadFunctions
protected
DtSignalConnectionManager makVrv::DtCigiDriver::myDynamicSignals
protected
DtCigiViewController* makVrv::DtCigiDriver::myViewController
protected

Processes CIGI view control/definition messages.

DtIgSettingsController* makVrv::DtCigiDriver::myComponentController
protected

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

DtCigiIntersectionHandler* makVrv::DtCigiDriver::myIntersectionHandler
protected

Processes HAT/HOT/LOS requests.

double makVrv::DtCigiDriver::myNextFrameTime
protected

When we should next process CIGI messages.


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

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)