VR-Vantage
Loading...
Searching...
No Matches
DtGimbalDriver Class Reference
Inheritance diagram for DtGimbalDriver:

Public Member Functions

 DtGimbalDriver (makVrv::DtAgentManager &am)
 CTOR.
 DtGimbalDriver ()=delete
 Unimplemented CTOR to prevent auto-creation.
virtual ~DtGimbalDriver ()
 Virtual DTOR.
Public Member Functions inherited from makVrv::DtDriver
 DtDriver (DtAgentManager &agentManager, const std::string &instanceName)
 CTOR.
virtual ~DtDriver ()
 DTOR.
virtual void realizeConfiguration (const DtConfiguration &configuration)
 Realize the driver using the configuration.
virtual DtConfiguration createConfiguration (bool saveAllParameters=false) const
 Create a configuration for the driver.
DtAgentManager & agentManager ()
 Get the master scene for this host. Do not create drivers using this agentManager, use the sceneInterface as it may replaced the implementation of the sceneInterface.
virtual DtAgentManagerInterface & sceneInterface ()
 Get the scene manager interface for creating agents.
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. Will be saved to record if state is different.
bool objectFromAgentManager (const DtUniqueID &id) const
 check to see if the object was created using this driver's agent manager.

Protected Member Functions

virtual bool initialize ()
virtual void slot_coordinateSystemChanged ()
Protected Member Functions inherited from makVrv::DtDriver
void applyChangesAndDelete (DtElementChanges *changes)
 Function for apply changes from a changes object and deleting it. This function is useful for queuing from an external thread as a means of passing changes from a secondary thread back to the main thread.
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. Called by the Master Scene. Calls installAccessories().
void stop ()
 Stop the driver. Called by the Master Scene. Calls uninstallAccessories().
bool tick ()
 Tick the host driver. Called by the Master Scene.
virtual void setInstanceName (const std::string &name)
 set the Instance name.
virtual void installAccessories ()
 Installs accessories on this driver. The compatible and enabled accessories in the DtDriverManager's accessory map are installed on this driver.
virtual void uninstallAccessories ()
 Removes accessories from this driver. The compatible and enabled accessories in the DtDriverManager's accessory map are removed from this driver.

Protected Attributes

makVrv::DtGeoReference * myPlaneGeoRef
makVrv::DtGeoReference * myGimbalGeoRef
makVrv::DtSceneObjectAgent * myGimbalSceneObjectAgent
makVrv::DtSceneObject * myPlaneSceneObject
makVrv::DtElementID myGimbalId
makVrv::DtSignalConnectionManager mySignalConnections
DtGeodeticCoord * myTargetLocation
makVrv::DtElementID myPlaneElementId
DtGimbalSensorOverlay * myGimbalSensorOverlay
Protected Attributes inherited from makVrv::DtDriver
DtAgentManager & myAgentManager
bool myStartedFlag
std::string myName
DtConfiguration myConfiguration
bool myPersistentFlag
bool myUserControllableFlag
bool myRequestStateDiffPendingFlag
DtElementChanges myChanges
DtSignalConnectionManager myConnections
 Auto-disconnects on destruction; avoids singleton lookups in the DTOR.

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 &observerName, const std::string &entityName)
virtual void slot_displayEngineAdded (const makVrv::DtDeRecord &igRecord)

Additional Inherited Members

Static Protected Attributes inherited from makVrv::DtDriver
static const std::string theOnDriverSelectionList

Detailed Description

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.

Constructor & Destructor Documentation

◆ DtGimbalDriver() [1/2]

DtGimbalDriver::DtGimbalDriver ( makVrv::DtAgentManager & am)

CTOR.

◆ DtGimbalDriver() [2/2]

DtGimbalDriver::DtGimbalDriver ( )
delete

Unimplemented CTOR to prevent auto-creation.

◆ ~DtGimbalDriver()

virtual DtGimbalDriver::~DtGimbalDriver ( )
virtual

Virtual DTOR.

Member Function Documentation

◆ className()

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

Returns the driver's class name.

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

Implements makVrv::DtDriver.

◆ onStart()

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.

◆ onStop()

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.

◆ onTick()

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.

◆ attachObserverToEntity()

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

Tells the named 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

◆ slot_displayEngineAdded()

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.

◆ initialize()

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.

◆ slot_coordinateSystemChanged()

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

◆ myPlaneGeoRef

makVrv::DtGeoReference* DtGimbalDriver::myPlaneGeoRef
protected

◆ myGimbalGeoRef

makVrv::DtGeoReference* DtGimbalDriver::myGimbalGeoRef
protected

◆ myGimbalSceneObjectAgent

makVrv::DtSceneObjectAgent* DtGimbalDriver::myGimbalSceneObjectAgent
protected

◆ myPlaneSceneObject

makVrv::DtSceneObject* DtGimbalDriver::myPlaneSceneObject
protected

◆ myGimbalId

makVrv::DtElementID DtGimbalDriver::myGimbalId
protected

◆ mySignalConnections

makVrv::DtSignalConnectionManager DtGimbalDriver::mySignalConnections
protected

◆ myTargetLocation

DtGeodeticCoord* DtGimbalDriver::myTargetLocation
protected

◆ myPlaneElementId

makVrv::DtElementID DtGimbalDriver::myPlaneElementId
protected

◆ myGimbalSensorOverlay

DtGimbalSensorOverlay* DtGimbalDriver::myGimbalSensorOverlay
protected

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