VR-Forces 4.1 Class Documentation
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. More...

Inheritance diagram for makVrf::DtObjectDataInterface:
Inheritance graph
[legend]

Public Types

enum  Representation { Local = 0, World = 1 }
 Use these enums in various information methods to return data in local or world coordinates. More...

Public Member Functions

 DtObjectDataInterface (makVrv::DtDe &)
virtual ~DtObjectDataInterface ()
makVrv::DtElementID elementID () const
 Returns the element id of this object.
virtual
makVrv::DtElementEntry::ElementType 
type () const
 Returns the type of this object.
virtual
makVrv::DtSimEntryUpdater::UpdateRate 
setUpdateRate (makVrv::DtSimEntryUpdater::UpdateRate)
 Sets the update rate for the data contained in this data interface.
virtual void setStateView (const makVrv::DtStateView< makVrv::DtSimState > *s)
 Sets the base level state view of this object.
makVrv::DtSimEntryUpdater::UpdateRate updateRate () const
 Returns the current update rate.
virtual void forceUpdate ()
 Forces an update of the data so on the next tick the network thread will update data in the gui thread.
virtual bool hasBeenRemoved () const
 Returns true if this item has been removed from the simulation.
virtual bool isVisible () const
 Returns true if the item is visible.
virtual void setVisible (bool)
 Sets the item to visible or invisible.
virtual bool isSelected () const
 Returns true if the item is selected.
virtual void removeFromSelection ()
 Removes the item from the current selection.
virtual void addToSelection (bool replace=false)
 Adds the item to the current selection. If replace is true will replace the current selection and leave only the item.

Static Public Member Functions

template<typename T_ObjectDataInterfaceType >
static DtBoost::shared_ptr
< T_ObjectDataInterfaceType > 
cast (DtBoost::shared_ptr< DtObjectDataInterface > dataInterface)
 This is a convenience method for casting a DtBoost::shared_ptr to a DtObjectDataInterface to a derived class.

Public Attributes

boost::signal< void()> signal_dataUpdated
 Signal sent when any of this items data has been updated.
boost::signal< void()> signal_dataRemoved
 Signal send when this items data has been removed.

Protected Member Functions

virtual void slot_simObjectEntryAboutToBeRemoved (makVrv::DtSimObjectEntry &)
 Slot that is called when the state view is destroyed. Will mark this item as removed by clearing out internal pointers.
virtual DtVector geocentricVectorToLocalVector (const DtVector &localLocation, const DtVector &geocVector) const
 Converts a geocentric vector to a local vector, given the local location.
virtual void slot_onStateViewUpdated ()
 Called when any of the state views data has been updated. Sends out signal_dataUpdated.

Protected Attributes

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

Detailed Description

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:
GUI Object Data Interface example.

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, and makVrf::DtSpotReportDataInterface.

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::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, and makVrf::DtAggregateDataInterface.

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.

Member Data Documentation

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

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

boost::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 Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)