VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtGimbalDriver Class Reference

DtGimbalDriver looks for the plane element created by DtExampleDriver (or DtDriverExamplePlugin) and implements a gimbal attached to that plane at a specified offset. It shows how to use the DtGeoReference class to position and orient the gimbal using the plane's position and orientation; and how to find azimuth and elevation angles to a target in the gimbal's local coordinate system. It attaches the observer named "Observer 1" to the gimbal, and uses the azimuth and elevation angles determined to lock the observer onto the target location.

Inheritance diagram for DtGimbalDriver:
Inheritance graph
[legend]

Public Member Functions

 DtGimbalDriver (makVrv::DtAgentManager &am)
 
virtual ~DtGimbalDriver ()
 
- Public Member Functions inherited from makVrv::DtDriver
 DtDriver (DtAgentManager &agentManager, const std::string &instanceName)
 
virtual ~DtDriver ()
 
virtual void realizeConfiguration (const DtConfiguration &configuration)
 
virtual DtConfiguration createConfiguration () const
 
DtAgentManageragentManager ()
 
virtual DtAgentManagerInterfacesceneInterface ()
 
bool started () const
 
virtual const std::string & instanceName () const
 
virtual bool autoStart () const
 
virtual void setAutoStart (bool autoStart)
 
virtual bool isWindowDependent () const
 
virtual void setIsWindowDependent (bool dep)
 
virtual void setIsUserControllable (bool)
 
virtual bool isUserControllable () const
 
virtual void setIsPersistent (bool per)
 
virtual bool isPersistent () const
 
virtual bool isOnDriverSelectionList () const
 
virtual void setOnDriverSelectionList (bool)
 
bool objectFromAgentManager (const DtUniqueID &id) const
 

Protected Member Functions

virtual bool initialize ()
 
virtual void slot_coordinateSystemChanged ()
 
- Protected Member Functions inherited from makVrv::DtDriver
void applyChangesAndDelete (DtElementChanges *changes)
 
void reportElementCreated (DtElementID id, DtElementID parentId, DtElementEntry::ElementType type)
 
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
 
void reportElementDestroyed (DtElementID id)
 
void start ()
 
void stop ()
 
bool tick ()
 
virtual void setInstanceName (const std::string &name)
 
virtual void installAccessories ()
 
virtual void uninstallAccessories ()
 

Protected Attributes

makVrv::DtGeoReferencemyPlaneGeoRef
 
makVrv::DtGeoReferencemyGimbalGeoRef
 
makVrv::DtSceneObjectAgent * myGimbalSceneObjectAgent
 
makVrv::DtSceneObjectmyPlaneSceneObject
 
makVrv::DtElementID myGimbalId
 
makVrv::DtSignalConnectionManager mySignalConnections
 
DtGeodeticCoord * myTargetLocation
 
- Protected Attributes inherited from makVrv::DtDriver
DtAgentManagermyAgentManager
 
bool myStartedFlag
 
std::string myName
 
DtConfiguration myConfiguration
 
bool myPersistentFlag
 
bool myUserControllableFlag
 
bool myRequestStateDiffPendingFlag
 
DtElementChanges myChanges
 

Private Member Functions

 DtGimbalDriver ()
 

Methods Inherited from makVrv::DtDriver

virtual const std::string & className () const
 
virtual bool onStart ()
 
virtual bool onStop ()
 
virtual bool onTick ()
 
virtual void attachObserverToEntity (const std::string &entityName)
 
virtual void slot_displayEngineAdded (const makVrv::DtDeRecord &igRecord)
 

Constructor & Destructor Documentation

DtGimbalDriver::DtGimbalDriver ( makVrv::DtAgentManager am)

CTOR.

virtual DtGimbalDriver::~DtGimbalDriver ( )
virtual

Virtual DTOR.

DtGimbalDriver::DtGimbalDriver ( )
private

Unimplemented CTOR to prevent auto-creation.

Member Function Documentation

virtual const std::string& DtGimbalDriver::className ( ) const
virtual

Returns the driver's class name.

See Also
makVrv::DtDriver::className() const

Implements makVrv::DtDriver.

virtual bool DtGimbalDriver::onStart ( )
protectedvirtual

Performs startup logic for the driver. In this case, this method is a no-op (but must be implemented since it's pure virtual). Initialization is delayed until onTick() so that the plane we need to attach exists.

See Also
makVrv::DtDriver::start().

Implements makVrv::DtDriver.

virtual bool DtGimbalDriver::onStop ( )
protectedvirtual

Performs shutdown logic for the driver. Deletes the Gimbal Element and GeoReference objects.

See Also
makVrv::DtDriver::stop()

Implements makVrv::DtDriver.

virtual bool DtGimbalDriver::onTick ( )
protectedvirtual

Performs update logic for the driver. If myGimbalSceneObjectAgent hasn't been initialized yet, onTick() calls initialize(). Once initialized, each tick this method:

  • Updates the DtGeoReference for the plane with the plane's current position and orientation.
  • Finds the position and orientation of the gimbal in the plane's coordinate system and updates the gimbal's DtGeoReference
  • Finds the position of the target in the gimbal's coordinate system.
  • Calculates azimuth and elevation angles from the gimbal to the target
  • Sets the observer's attached rotation with the azimuth and elevation angles
    See Also
    makVrv::DtDriver::tick()

Implements makVrv::DtDriver.

virtual void DtGimbalDriver::attachObserverToEntity ( const std::string &  entityName)
protectedvirtual

Tells the current observer to attach to the named entity. This method uses an observer state record, and calls DtObserver::setFromRecord. When setFromRecord is used, the observer will listen for the existence of the named entity and actually do the attachment when the entity is created.

virtual void DtGimbalDriver::slot_displayEngineAdded ( const makVrv::DtDeRecord igRecord)
protectedvirtual

Ensures the driver is properly restarted when a de is connected (such as a remote display engine).

See Also
makVrv::DtDriver::slot_displayEngineAdded( const makVrv::DtDeRecord& )

Reimplemented from makVrv::DtDriver.

virtual bool DtGimbalDriver::initialize ( )
protectedvirtual

initialize() looks for the plane created by DtExampleDriver (or DtExampleDriverPlugin). When found, it creates a Gimbal element that can be (logically) attached to the plane. It also creates the DtGeoReferences to use for topocentric operations to correctly place the Gimbal element and put the target into Gimbal coordinates.

virtual void DtGimbalDriver::slot_coordinateSystemChanged ( )
protectedvirtual

We use this to set up our target location. This is mostly for future use when we support alternate datums, since the target location (being geodetic) needs to be reset if the datum changes.

Member Data Documentation

makVrv::DtGeoReference* DtGimbalDriver::myPlaneGeoRef
protected
makVrv::DtGeoReference* DtGimbalDriver::myGimbalGeoRef
protected
makVrv::DtSceneObjectAgent* DtGimbalDriver::myGimbalSceneObjectAgent
protected
makVrv::DtSceneObject* DtGimbalDriver::myPlaneSceneObject
protected
makVrv::DtElementID DtGimbalDriver::myGimbalId
protected
makVrv::DtSignalConnectionManager DtGimbalDriver::mySignalConnections
protected
DtGeodeticCoord* DtGimbalDriver::myTargetLocation
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)