VR-Forces 4.1 Class Documentation
List of all members | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtCigiConnection Class Reference

This class is responsible for the actual processing of CIGI data. More...

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

Public Types

enum  DtIgMode { ResetStandby = 0, Operate = 1, Debug = 2 }

Public Member Functions

 DtCigiConnection (const DtCigiConnectionInitializer &init, DtAgentManagerInterface &sceneInterface, DtSharedSettingsManager &settingsManager)
 Constructor.
virtual ~DtCigiConnection ()
 Destructor.
virtual bool tick ()
 Receives/processes any CIGI messages and queues up HAT/HOT/LOS responses.
virtual bool connect ()
 Connects to the host.
virtual bool disconnect ()
 Disconnects from the host.
virtual void setConnectionInitializer (const DtCigiConnectionInitializer &init)
 Set the initialization settings.
virtual int cigiMinorVersion () const
 Returns the mior CIGI version being used by the connection.
virtual void sendCigiMessages ()
 Sends start of frame and any other responses that are queued up.
virtual void setCoordinateSystem (const std::string &name, const std::string &params)
 Sets the coordinate system. Called by the driver in a thread-safe manner.
virtual DtCoordinateSystemcoordinateSystem ()
 Returns the coordinate system. Used for coordinate conversions.
virtual const
DtCigiEntityVisualizer
entityManager () const
 Returns the DtCigiEntityVisualizer.
virtual const
makArchives::DtCigiSettingsRecord
cigiSettings () const
 Returns the CIGI Mappings being used.
virtual void setLastHostFrameNumber (unsigned int frameNumber)
 Sets the last host frame number (contained in an IG control message).
virtual unsigned int lastHostFrameNumber () const
 Returns the last host frame number.
virtual DtVirtualBaseClassfindInstance (const std::string &instanceName)
 Find an instance with the given name.
bool destroyingInstances () const
 Check to see if the simulation is destroying instances.
virtual void registerInstance (const std::string &instanceName, DtVirtualBaseClass *instance)
 Set the instance with a given name.
virtual void setIgMode (DtIgMode mode)
 Sets the IG mode (either standby or operating).
virtual DtIgMode igMode () const
 Returns the IG mode.
virtual void setDatabaseNumber (int number)
 Sets the database number. Will be sent in the start of frame message.
virtual int databaseNumber () const
 Returns the database number.
virtual void setLoadingDatabase ()
 Sets the database to the 'loading' state.
virtual void setDatabaseLoaded ()
 Sets the database to the 'loaded' state.
virtual void setExtrapolationEnabled (bool enabled)
 Sets whether the IG is using extrapolation.
virtual bool extrapolationEnabled () const
 Returns whether the IG is using extrapolation.
virtual void setTimestampValid (bool valid)
 Sets whether the host's timestamp is valid.
virtual bool timestampValid () const
 Returns whether the host's timestamp is valid.
virtual void setLastTimestamp (unsigned int timestamp)
 Sets the last timestamp received by an IG control.
virtual unsigned int lastTimestamp () const
 Returns the last timestamp sent by the host.
virtual void sendHatHotResponse (double height, unsigned int hotId, bool hat, unsigned int lastFrame, bool valid)
 Queues up a HAT/HOT response to be sent out.
virtual void sendLosResponse (int losId, int entityId, bool visible, double range, int responseCount, int hostFrame)
 Queues up a LOS response to be sent out.
virtual DtHatHotResponderhatHotResponder ()
 Returns a reference to the height above/of terrain responder.
virtual DtLosResponderlosResponder ()
 Returns a reference to the line-of-sight responder.
virtual unsigned int currentIgFrame () const
 Returns the current IG frame being sent out in SOF messages.
virtual DtComponentSignalercomponentSignaler ()
 Returns a reference to the component signaler.
- Public Member Functions inherited from makVrv::DtBaseConnection
 DtBaseConnection (DtSharedSettingsManager &, DtAgentManagerInterface &)
 CTOR.
virtual ~DtBaseConnection ()
 DTOR MUST call clearInstances first.
virtual void clearInstances ()
 Clear and delete all instances rooted in the connection MUST be called before the connection is destroyed.
DtSharedSettingsManagersettingsManager ()
 Get the settings manager.
virtual DtAgentManagerInterfacesceneInterface ()
 Get the scene manager interface for creating drivers.
const DtSharedSettingsManagersettingsManager () const
 Get the settings manager.
void reportElementCreated (DtElementID id, DtElementID parentId, unsigned int type)
 Report an element created.
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
void reportElementDestroyed (DtElementID id)
 Report an element destroyed.
const DtElementChangescurrentElementChanges () const
 Look at the current element changes.
DtElementChangestakeElementChanges ()
 Take the current changes and internally start a new set of changes.
DtTemporaryAgentManagertemporaryEffects ()
 Get the temporary effects manager.
DtBlinkingObjectManagerblinkManager ()
 Get the blinking manager.
DtRandomNumberGeneratorrandomNumberGenerator ()
 Get the simulation's random number generator.
virtual const std::string & tag ()
 Get the tag identifying which type of connection this is.
const DtUnicodeemptyString () const
 Allocated empty string.

Public Attributes

boost::signal< void(DtViewStateProcessor::ObserverAction &)> signal_viewChanged
 Emitted when a view control change is received.
boost::signal< void(int,
DtUniqueID)> 
signal_alphaChanged
 Emitted when an entity's alpha has changed.
boost::signal< void(int,
DtCigiViewController::DtViewDefinitionAction) > 
signal_receivedViewDefinition
 Emitted when a CIGI View definition is received.
boost::signal< void(int,
DtCigiViewController::DtViewControlAction)> 
signal_receivedViewControl
 Emitted when a CIGI View Control is received.
boost::signal< void(int, int,
int, int, int, bool)> 
signal_timeSet
 Emitted when the time is set via CIGI Celestial Sphere Control message.
boost::signal< void(const
std::string &)> 
signal_loadDatabase
 Emitted when the host tells the IG to load a database.
boost::signal< void()> signal_connected
 Emitted when the connection finished connecting.
boost::signal< void()> signal_toBeDisconnected
 Emitted when the connection will be disconnecting.

Protected Types

typedef std::map< std::string,
DtVirtualBaseClass * > 
InstanceMap
- Protected Types inherited from makVrv::DtBaseConnection
typedef boost::unordered_map
< std::string,
DtVirtualBaseClass * > 
InstanceMap

Protected Member Functions

void on_viewControlReceived (const CigiViewCtrlV3 &viewControl)
 Slot processes view control messages.

Protected Attributes

DtCigiNetworkIOmyNetworkIO
DtCigiEntityVisualizermyEntityManager
DtCigiConnectionInitializer myInitializer
DtCigiIgControlProcessormyIgController
DtHatHotRespondermyHatHotResponder
DtLosRespondermyLosResponder
DtCoordinateSystemmyCoordinateSystem
DtComponentSignaler myComponentSignaler
DtCigiConnSettingsHandler mySettingsHandler
bool myUseSynchronousMode
unsigned int myIgFrame
unsigned int myLastHostFrameNumber
DtSignalConnectionManager mySignals
DtIgMode myMode
int myDatabaseNumber
bool myDatabaseLoading
bool myExtrapolationEnabled
bool myTimestampValid
unsigned int myLastTimestamp
InstanceMap myInstances
bool myDestroyingInstancesFlag
int myCigiMinorVersion
- Protected Attributes inherited from makVrv::DtBaseConnection
DtSharedSettingsManagermySettingsManagerCache
DtRandomNumberGenerator myRandomNumberGenerator
DtAgentManagerInterfacemySceneInterface
DtElementChangesmyWorkingElementChanges
DtTemporaryAgentManagermyTemporaryEffects
DtBlinkingObjectManagermyBlinkManager
 Manager for blinking objects.
DtUnicode myEmptyString
InstanceMap myInstances
bool myDestroyingInstanceFlag

Detailed Description

This class is responsible for the actual processing of CIGI data.

This holds the entity visualizer, the CIGI settings, the signal processor, etc. This class be be run in a separate thread from the CIGI driver. This is the actual 'simulation' thread.

Member Typedef Documentation

typedef std::map<std::string,DtVirtualBaseClass*> makVrv::DtCigiConnection::InstanceMap
protected

Member Enumeration Documentation

Enumerator:
ResetStandby 
Operate 
Debug 

Constructor & Destructor Documentation

makVrv::DtCigiConnection::DtCigiConnection ( const DtCigiConnectionInitializer init,
DtAgentManagerInterface sceneInterface,
DtSharedSettingsManager settingsManager 
)

Constructor.

virtual makVrv::DtCigiConnection::~DtCigiConnection ( )
virtual

Destructor.

Member Function Documentation

virtual bool makVrv::DtCigiConnection::tick ( )
virtual

Receives/processes any CIGI messages and queues up HAT/HOT/LOS responses.

virtual bool makVrv::DtCigiConnection::connect ( )
virtual

Connects to the host.

virtual bool makVrv::DtCigiConnection::disconnect ( )
virtual

Disconnects from the host.

virtual void makVrv::DtCigiConnection::setConnectionInitializer ( const DtCigiConnectionInitializer init)
virtual

Set the initialization settings.

virtual int makVrv::DtCigiConnection::cigiMinorVersion ( ) const
virtual

Returns the mior CIGI version being used by the connection.

virtual void makVrv::DtCigiConnection::sendCigiMessages ( )
virtual

Sends start of frame and any other responses that are queued up.

virtual void makVrv::DtCigiConnection::setCoordinateSystem ( const std::string &  name,
const std::string &  params 
)
virtual

Sets the coordinate system. Called by the driver in a thread-safe manner.

virtual DtCoordinateSystem& makVrv::DtCigiConnection::coordinateSystem ( )
virtual

Returns the coordinate system. Used for coordinate conversions.

virtual const DtCigiEntityVisualizer& makVrv::DtCigiConnection::entityManager ( ) const
virtual

Returns the DtCigiEntityVisualizer.

virtual const makArchives::DtCigiSettingsRecord& makVrv::DtCigiConnection::cigiSettings ( ) const
virtual

Returns the CIGI Mappings being used.

virtual void makVrv::DtCigiConnection::setLastHostFrameNumber ( unsigned int  frameNumber)
virtual

Sets the last host frame number (contained in an IG control message).

virtual unsigned int makVrv::DtCigiConnection::lastHostFrameNumber ( ) const
virtual

Returns the last host frame number.

virtual DtVirtualBaseClass* makVrv::DtCigiConnection::findInstance ( const std::string &  instanceName)
virtual

Find an instance with the given name.

If no instance is found than a null pointer is returned

Warning
This function will always return 0 when the simulation is in the process of destroying all instances, this allows some what save access to findInstance in object destructors.

Reimplemented from makVrv::DtBaseConnection.

bool makVrv::DtCigiConnection::destroyingInstances ( ) const
inline

Check to see if the simulation is destroying instances.

     This function is used in the destructor of objects which access 
     instances via reference which may throw an exception.
     @code 

TestClass::~TestClass() { if(!mySimulation.destroyingInstances()) { //Safe to get instance now. Singleton& anInstance = Singleton::instance(mySimulation); ... }

Reimplemented from makVrv::DtBaseConnection.

virtual void makVrv::DtCigiConnection::registerInstance ( const std::string &  instanceName,
DtVirtualBaseClass instance 
)
virtual

Set the instance with a given name.

if Instance is null, an existing instance entry is deleted.

Reimplemented from makVrv::DtBaseConnection.

virtual void makVrv::DtCigiConnection::setIgMode ( DtIgMode  mode)
virtual

Sets the IG mode (either standby or operating).

virtual DtIgMode makVrv::DtCigiConnection::igMode ( ) const
virtual

Returns the IG mode.

virtual void makVrv::DtCigiConnection::setDatabaseNumber ( int  number)
virtual

Sets the database number. Will be sent in the start of frame message.

virtual int makVrv::DtCigiConnection::databaseNumber ( ) const
virtual

Returns the database number.

virtual void makVrv::DtCigiConnection::setLoadingDatabase ( )
virtual

Sets the database to the 'loading' state.

The database number is negated in start of frame messages in the loading state.

virtual void makVrv::DtCigiConnection::setDatabaseLoaded ( )
virtual

Sets the database to the 'loaded' state.

The database number is no longer negated when the database is loaded.

virtual void makVrv::DtCigiConnection::setExtrapolationEnabled ( bool  enabled)
virtual

Sets whether the IG is using extrapolation.

virtual bool makVrv::DtCigiConnection::extrapolationEnabled ( ) const
virtual

Returns whether the IG is using extrapolation.

virtual void makVrv::DtCigiConnection::setTimestampValid ( bool  valid)
virtual

Sets whether the host's timestamp is valid.

virtual bool makVrv::DtCigiConnection::timestampValid ( ) const
virtual

Returns whether the host's timestamp is valid.

virtual void makVrv::DtCigiConnection::setLastTimestamp ( unsigned int  timestamp)
virtual

Sets the last timestamp received by an IG control.

virtual unsigned int makVrv::DtCigiConnection::lastTimestamp ( ) const
virtual

Returns the last timestamp sent by the host.

virtual void makVrv::DtCigiConnection::sendHatHotResponse ( double  height,
unsigned int  hotId,
bool  hat,
unsigned int  lastFrame,
bool  valid 
)
virtual

Queues up a HAT/HOT response to be sent out.

virtual void makVrv::DtCigiConnection::sendLosResponse ( int  losId,
int  entityId,
bool  visible,
double  range,
int  responseCount,
int  hostFrame 
)
virtual

Queues up a LOS response to be sent out.

virtual DtHatHotResponder& makVrv::DtCigiConnection::hatHotResponder ( )
virtual

Returns a reference to the height above/of terrain responder.

virtual DtLosResponder& makVrv::DtCigiConnection::losResponder ( )
virtual

Returns a reference to the line-of-sight responder.

virtual unsigned int makVrv::DtCigiConnection::currentIgFrame ( ) const
virtual

Returns the current IG frame being sent out in SOF messages.

virtual DtComponentSignaler& makVrv::DtCigiConnection::componentSignaler ( )
virtual

Returns a reference to the component signaler.

void makVrv::DtCigiConnection::on_viewControlReceived ( const CigiViewCtrlV3 &  viewControl)
protected

Slot processes view control messages.

Member Data Documentation

boost::signal<void (DtViewStateProcessor::ObserverAction&)> makVrv::DtCigiConnection::signal_viewChanged

Emitted when a view control change is received.

boost::signal<void (int, DtUniqueID)> makVrv::DtCigiConnection::signal_alphaChanged

Emitted when an entity's alpha has changed.

boost::signal<void (int, DtCigiViewController::DtViewDefinitionAction) > makVrv::DtCigiConnection::signal_receivedViewDefinition

Emitted when a CIGI View definition is received.

boost::signal<void (int, DtCigiViewController::DtViewControlAction)> makVrv::DtCigiConnection::signal_receivedViewControl

Emitted when a CIGI View Control is received.

boost::signal<void (int, int, int, int, int, bool)> makVrv::DtCigiConnection::signal_timeSet

Emitted when the time is set via CIGI Celestial Sphere Control message.

boost::signal<void (const std::string&)> makVrv::DtCigiConnection::signal_loadDatabase

Emitted when the host tells the IG to load a database.

boost::signal<void ()> makVrv::DtCigiConnection::signal_connected

Emitted when the connection finished connecting.

boost::signal<void ()> makVrv::DtCigiConnection::signal_toBeDisconnected

Emitted when the connection will be disconnecting.

DtCigiNetworkIO* makVrv::DtCigiConnection::myNetworkIO
protected
DtCigiEntityVisualizer* makVrv::DtCigiConnection::myEntityManager
protected
DtCigiConnectionInitializer makVrv::DtCigiConnection::myInitializer
protected
DtCigiIgControlProcessor* makVrv::DtCigiConnection::myIgController
protected
DtHatHotResponder* makVrv::DtCigiConnection::myHatHotResponder
protected
DtLosResponder* makVrv::DtCigiConnection::myLosResponder
protected
DtCoordinateSystem* makVrv::DtCigiConnection::myCoordinateSystem
protected
DtComponentSignaler makVrv::DtCigiConnection::myComponentSignaler
protected
DtCigiConnSettingsHandler makVrv::DtCigiConnection::mySettingsHandler
protected
bool makVrv::DtCigiConnection::myUseSynchronousMode
protected
unsigned int makVrv::DtCigiConnection::myIgFrame
protected
unsigned int makVrv::DtCigiConnection::myLastHostFrameNumber
protected
DtSignalConnectionManager makVrv::DtCigiConnection::mySignals
protected
DtIgMode makVrv::DtCigiConnection::myMode
protected
int makVrv::DtCigiConnection::myDatabaseNumber
protected
bool makVrv::DtCigiConnection::myDatabaseLoading
protected
bool makVrv::DtCigiConnection::myExtrapolationEnabled
protected
bool makVrv::DtCigiConnection::myTimestampValid
protected
unsigned int makVrv::DtCigiConnection::myLastTimestamp
protected
InstanceMap makVrv::DtCigiConnection::myInstances
protected
bool makVrv::DtCigiConnection::myDestroyingInstancesFlag
protected
int makVrv::DtCigiConnection::myCigiMinorVersion
protected

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

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)