|
ADTF Display Toolbox
|
Base class for objects that can be managed with cBaseObjectScene. More...
#include <baseobject.h>
Public Member Functions | |
| cBaseObject (tUInt32 nId) | |
| Constructor. | |
| virtual | ~cBaseObject () |
| Destructor. | |
| tUInt32 | GetId () |
| Returns the id of the object. | |
| tResult | Update () |
| Base Implementation sets the updated property to true. | |
| tBool | IsUpdated () |
| Returns whether or not this object has been updated since the last Reset call. | |
| tResult | Reset () |
| Resets the updated property to false. | |
| virtual tResult | SetHistory (tBool bEnabled, tUInt32 nCount=0) |
| Enables or disable the history trail of this object. | |
| virtual tResult | SetMotionVector (tBool bEnabled) |
| Enables or disables the motion vector. | |
| virtual tResult | SetPosition (tFloat64 fPosX, tFloat64 fPosY, tFloat64 fPosZ) |
| Sets the position of the object. | |
| osg::Vec3d | GetPosition () |
| Returns the current position. | |
| virtual tResult | SetRotation (tFloat64 fRotX, tFloat64 fRotY, tFloat64 fRotZ) |
| Sets the rotation (attitude) of the object. | |
| osg::Vec3d | GetRotation () |
| Returns the current rotation. | |
| virtual tResult | SetSize (tFloat64 fSizeX, tFloat64 fSizeY, tFloat64 fSizeZ) |
| Sets the dimensions of the object. | |
| osg::Vec3d | GetSize () |
| Returns the current size. | |
| virtual tResult | SetColor (tFloat64 fRed, tFloat64 fGreen, tFloat64 fBlue, tFloat64 fAlpha) |
| Sets the color of the object. | |
| virtual tResult | SetMotion (tFloat64 fMotionX, tFloat64 fMotionY, tFloat64 fMotionZ) |
| Sets the motion vector of the object. | |
| osg::Vec3d | GetMotion () |
| Returns the current motion vector. | |
| virtual tResult | SetSelected (tBool bSelected) |
| Gives the object a chance to change its appearance when being selected or unselected. | |
| virtual tBool | IsSelected () |
| Returns the selected property of the object. | |
Protected Member Functions | |
| virtual tResult | UpdateSelection () |
| Used to update the selection sphere. | |
Protected Attributes | |
| tUInt32 | m_nId |
| internal Id | |
| osg::ref_ptr< osg::PositionAttitudeTransform > | m_pTransform |
| The transform that applies the translation and rotation to the box. | |
| osg::ref_ptr< osg::ShapeDrawable > | m_pDrawable |
| The drawable for the box. | |
| osg::ref_ptr< osg::Box > | m_pBox |
| The box that represents the object. | |
| osg::ref_ptr< osg::Geometry > | m_pHistoryGeom |
| Geometry object used for rendering the history trail. | |
| osg::ref_ptr< osg::DrawArrays > | m_pHistoryArray |
| This will do the actual drawing of the history trail. | |
| osg::ref_ptr< osg::Geometry > | m_pMotionGeom |
| Geometry object used for rendering the motion vector. | |
| osg::ref_ptr< osg::DrawArrays > | m_pMotionArray |
| This will do the actual drawing of the motion vector. | |
| osg::Vec3d | m_vPos |
| The current position of the object. | |
| osg::ref_ptr< osg::Vec3Array > | m_pPositionHistory |
| This will store old positions for drawing the history trail. | |
| tUInt32 | m_nHistorySize |
| The maximum amount of positions in the m_pPositionHistory array. | |
| osg::ref_ptr< osg::Vec3Array > | m_pMotionVector |
| The start and end point of the motion vector. | |
| osg::ref_ptr< osg::Vec4Array > | m_pColorArray |
| The color array used for drawing the history trail and the motion vector. | |
| tBool | m_bHistory |
| Whether or not to show the history trail. | |
| tBool | m_bMotionVector |
| Whether or not to show the motion vector. | |
| tBool | m_bSelected |
| Whether or not this object is selected. | |
| tBool | m_bUpdated |
| Whether or not this object has been updated. | |
Base class for objects that can be managed with cBaseObjectScene.
Bring newest version of base class into scope.
If you want to extend its functionality subclass this class. You can create your own nodes and add them either with addChild at the root of this object or with m_pTransform->addChild at the transformation node which manages the shapes position and rotation.
You can find the implementation of this class in src/3dscenedisplay/mixinlib/baseobject.cpp
Definition at line 41 of file baseobject.h.
|
inline |
|
inlinevirtual |
Destructor.
Definition at line 191 of file baseobject.h.
|
inline |
Returns the id of the object.
Definition at line 199 of file baseobject.h.
|
inline |
Returns the current motion vector.
Definition at line 425 of file baseobject.h.
|
inline |
Returns the current position.
Definition at line 312 of file baseobject.h.
|
inline |
Returns the current rotation.
Definition at line 333 of file baseobject.h.
|
inline |
|
inlinevirtual |
Returns the selected property of the object.
Definition at line 453 of file baseobject.h.
|
inline |
Returns whether or not this object has been updated since the last Reset call.
Definition at line 219 of file baseobject.h.
|
inline |
Resets the updated property to false.
Definition at line 228 of file baseobject.h.
|
inlinevirtual |
Sets the color of the object.
If you draw opaque objects, make sure that fAlpha is exactly 1.0.
| fRed/fGreen/fBlue/fAlpha | [in] The color components. |
Definition at line 378 of file baseobject.h.
|
inlinevirtual |
Enables or disable the history trail of this object.
By default the history is enabled.
| bEnabled | [in] Whether to enable or disable the history trail. |
| nCount | [in] The amount of history positions to remember. If the array grows larger then this value, the oldest ones will be removed. Please mind that this comes at a performance cost since osg holds its vertices in a vector that has O(N) complexity for removing a single element. By default (0) no positions will be removed. |
Definition at line 245 of file baseobject.h.
|
inlinevirtual |
Sets the motion vector of the object.
Note that the rotation specified with SetRotation is not applied to this vector.
| fMotionX/fMotionY/fMotionZ | [in] The motion vector. |
Definition at line 410 of file baseobject.h.
|
inlinevirtual |
Enables or disables the motion vector.
| bEnabled | [in] Whether to enable or disable the motion vector. |
Definition at line 267 of file baseobject.h.
|
inlinevirtual |
Sets the position of the object.
| fPosX/fPosY/fPosZ | [in] The coordinates. |
Definition at line 279 of file baseobject.h.
|
inlinevirtual |
Sets the rotation (attitude) of the object.
| fRotX/fRotY/fRotZ | [in] The rotation values. |
Definition at line 322 of file baseobject.h.
|
inlinevirtual |
Gives the object a chance to change its appearance when being selected or unselected.
| bSelected | [in] whether ot not the object is selected. |
Definition at line 435 of file baseobject.h.
|
inlinevirtual |
Sets the dimensions of the object.
| fSizeX/fSizeY/fSizeZ | [in] The dimensions. |
Definition at line 343 of file baseobject.h.
|
inline |
Base Implementation sets the updated property to true.
Call this whenever you modified the object and/or need to modify the nodes inside your object.
Definition at line 209 of file baseobject.h.
|
inlineprotectedvirtual |
Used to update the selection sphere.
Definition at line 463 of file baseobject.h.
|
protected |
Whether or not to show the history trail.
Definition at line 94 of file baseobject.h.
|
protected |
Whether or not to show the motion vector.
Definition at line 96 of file baseobject.h.
|
protected |
Whether or not this object is selected.
Definition at line 98 of file baseobject.h.
|
protected |
Whether or not this object has been updated.
Definition at line 100 of file baseobject.h.
|
protected |
The maximum amount of positions in the m_pPositionHistory array.
Definition at line 75 of file baseobject.h.
|
protected |
internal Id
Definition at line 45 of file baseobject.h.
|
protected |
The box that represents the object.
Definition at line 53 of file baseobject.h.
|
protected |
The color array used for drawing the history trail and the motion vector.
Definition at line 83 of file baseobject.h.
|
protected |
The drawable for the box.
Definition at line 51 of file baseobject.h.
|
protected |
This will do the actual drawing of the history trail.
Definition at line 59 of file baseobject.h.
|
protected |
Geometry object used for rendering the history trail.
Definition at line 57 of file baseobject.h.
|
protected |
This will do the actual drawing of the motion vector.
Definition at line 65 of file baseobject.h.
|
protected |
Geometry object used for rendering the motion vector.
Definition at line 63 of file baseobject.h.
|
protected |
The start and end point of the motion vector.
Definition at line 79 of file baseobject.h.
|
protected |
This will store old positions for drawing the history trail.
Definition at line 73 of file baseobject.h.
|
protected |
The transform that applies the translation and rotation to the box.
Definition at line 49 of file baseobject.h.
|
protected |
The current position of the object.
Definition at line 69 of file baseobject.h.