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

The DtObjectDataInterface class is a wrapper around state views to give access to convenience methods which will allow developers to more easily access data about those objects. It will also provide some basic manipulation for that object. Instances of this class and its subclasses, are returned by the DtVrfStateViewCollectionManager.

The DtObjectDataInterface class is a base class that is inherited by subclasses to provide their specific data content. The type() method will return the type of class, and, using that information you can dynamically cast to the appropriate class:

Note
Instances of this object (and subclasses) are commonly passed around within boost shared pointers (DtBoost::shared_ptr) objects, and so they must be casted using DtBoost::dynamic_pointer_cast() or the cast() function in this class.
See Also
DtVrfStateViewCollectionManager
Related examples
Inheritance diagram for makVrf::DtObjectDataInterface:
Inheritance graph
[legend]

Public Types

enum  Representation { Local = 0, World = 1 }
 

Public Member Functions

 DtObjectDataInterface (makVrv::DtDe &)
 
virtual ~DtObjectDataInterface ()
 
makVrv::DtElementID elementID () const
 
virtual
makVrv::DtElementEntry::ElementType 
type () const
 
virtual
makVrv::DtSimEntryUpdater::UpdateRate 
setUpdateRate (makVrv::DtSimEntryUpdater::UpdateRate)
 
virtual void setStateView (const makVrv::DtStateView< makVrv::DtSimState > *s)
 
makVrv::DtSimEntryUpdater::UpdateRate updateRate () const
 
virtual void forceUpdate ()
 
virtual bool isValid () const
 
virtual bool hasBeenRemoved () const
 
virtual bool isVisible () const
 
virtual void setVisible (bool)
 
virtual bool isSelected () const
 
virtual void removeFromSelection ()
 
virtual void addToSelection (bool replace=false)
 

Static Public Member Functions

template<typename T_ObjectDataInterfaceType >
static DtBoost::shared_ptr
< T_ObjectDataInterfaceType > 
cast (DtBoost::shared_ptr< DtObjectDataInterface > dataInterface)
 

Public Attributes

boost::signals2::signal< void()> signal_dataUpdated
 
boost::signals2::signal< void()> signal_dataRemoved
 

Protected Member Functions

virtual void slot_simObjectEntryAboutToBeRemoved (makVrv::DtSimObjectEntry &)
 
virtual DtVector geocentricVectorToLocalVector (const DtVector &localLocation, const DtVector &geocVector) const
 
virtual void slot_onStateViewUpdated ()
 

Protected Attributes

makVrv::DtDemyDe
 
makVrv::DtStateView
< makVrv::DtSimState > * 
myStateView
 

Member Enumeration Documentation

Use these enums in various information methods to return data in local or world coordinates.

Enumerator
Local 
World 

Constructor & Destructor Documentation

makVrf::DtObjectDataInterface::DtObjectDataInterface ( makVrv::DtDe )
virtual makVrf::DtObjectDataInterface::~DtObjectDataInterface ( )
virtual

Member Function Documentation

makVrv::DtElementID makVrf::DtObjectDataInterface::elementID ( ) const

Returns the element id of this object. If returns 0 the object has been removed from the simulation.

virtual makVrv::DtElementEntry::ElementType makVrf::DtObjectDataInterface::type ( ) const
virtual

Returns the type of this object. Used for dynamic casting to proper sub-class.

Note
Using cast() is recommended when doing this to deal with shared pointer casting correctly.

Reimplemented in makVrf::DtEntityDataInterface, makVrf::DtAggregateDataInterface, makVrf::DtTacticalGraphicDataInterface, makVrf::DtSpotReportDataInterface, makVrf::DtOrbatDataInterface, and makVrf::DtVrfTDLMessageDataInterface.

template<typename T_ObjectDataInterfaceType >
static DtBoost::shared_ptr<T_ObjectDataInterfaceType> makVrf::DtObjectDataInterface::cast ( DtBoost::shared_ptr< DtObjectDataInterface dataInterface)
inlinestatic

This is a convenience method for casting a DtBoost::shared_ptr to a DtObjectDataInterface to a derived class.

virtual makVrv::DtSimEntryUpdater::UpdateRate makVrf::DtObjectDataInterface::setUpdateRate ( makVrv::DtSimEntryUpdater::UpdateRate  )
virtual

Sets the update rate for the data contained in this data interface. The update rate is the rate at which data from the network thread gets posted to the GUI thread. The current update rate is returned. Note that when this object is deleted the update rate will not be restored to the original rate. Any increase or decrease in rate will be maintained for this data until the next change.

virtual void makVrf::DtObjectDataInterface::setStateView ( const makVrv::DtStateView< makVrv::DtSimState > *  s)
virtual
makVrv::DtSimEntryUpdater::UpdateRate makVrf::DtObjectDataInterface::updateRate ( ) const

Returns the current update rate.

virtual void makVrf::DtObjectDataInterface::forceUpdate ( )
virtual

Forces an update of the data so on the next tick the network thread will update data in the gui thread.

virtual bool makVrf::DtObjectDataInterface::isValid ( ) const
virtual

Returns true if this is a valid data interface.

virtual bool makVrf::DtObjectDataInterface::hasBeenRemoved ( ) const
virtual

Returns true if this item has been removed from the simulation.

virtual bool makVrf::DtObjectDataInterface::isVisible ( ) const
virtual

Returns true if the item is visible.

virtual void makVrf::DtObjectDataInterface::setVisible ( bool  )
virtual

Sets the item to visible or invisible. If setting to be invisible and the item is selected, will be removed from the current selection. If set to visible will not be restored to selection. Call addToSelection to restore to selection.

virtual bool makVrf::DtObjectDataInterface::isSelected ( ) const
virtual

Returns true if the item is selected.

virtual void makVrf::DtObjectDataInterface::removeFromSelection ( )
virtual

Removes the item from the current selection.

virtual void makVrf::DtObjectDataInterface::addToSelection ( bool  replace = false)
virtual

Adds the item to the current selection. If replace is true will replace the current selection and leave only the item.

virtual void makVrf::DtObjectDataInterface::slot_simObjectEntryAboutToBeRemoved ( makVrv::DtSimObjectEntry )
protectedvirtual

Slot that is called when the state view is destroyed. Will mark this item as removed by clearing out internal pointers.

Reimplemented in makVrf::DtVrfVrlinkDataInterface, makVrf::DtEntityDataInterface, makVrf::DtTacticalGraphicDataInterface, makVrf::DtSpotReportDataInterface, makVrf::DtAggregateDataInterface, makVrf::DtOrbatDataInterface, and makVrf::DtVrfTDLMessageDataInterface.

virtual DtVector makVrf::DtObjectDataInterface::geocentricVectorToLocalVector ( const DtVector localLocation,
const DtVector geocVector 
) const
protectedvirtual

Converts a geocentric vector to a local vector, given the local location.

virtual void makVrf::DtObjectDataInterface::slot_onStateViewUpdated ( )
protectedvirtual

Called when any of the state views data has been updated. Sends out signal_dataUpdated.

Reimplemented in makVrf::DtVrfVrlinkDataInterface.

Member Data Documentation

boost::signals2::signal<void ()> makVrf::DtObjectDataInterface::signal_dataUpdated

Signal sent when any of this items data has been updated.

boost::signals2::signal<void ()> makVrf::DtObjectDataInterface::signal_dataRemoved

Signal send when this items data has been removed.

makVrv::DtDe& makVrf::DtObjectDataInterface::myDe
protected
makVrv::DtStateView<makVrv::DtSimState>* makVrf::DtObjectDataInterface::myStateView
protected

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)