dtCore::DeltaDrawable Class Reference

A renderable object. More...

#include <deltadrawable.h>

Inheritance diagram for dtCore::DeltaDrawable:

dtCore::Base dtABC::Action dtABC::AutoTrigger dtABC::Trigger dtAI::WaypointManager dtCore::EffectManager dtCore::EnvEffect dtCore::Environment dtCore::Transformable dtCore::Tripod dtDAL::ActorProxyIcon::BillBoardDrawable dtGUI::CEUIDrawable

List of all members.

Public Member Functions

virtual osg::Node * GetOSGNode ()=0
 Get the internal node.
virtual const osg::Node * GetOSGNode () const =0
virtual void AddedToScene (Scene *scene)
 Supply the Scene this Drawable has been added to.
virtual void SetParent (DeltaDrawable *parent)
 Override function for derived object to know when attaching to scene.
DeltaDrawableGetParent ()
const DeltaDrawableGetParent () const
SceneGetSceneParent ()
 Get a pointer to the Scene this Drawable has been added to.
const SceneGetSceneParent () const
virtual bool AddChild (DeltaDrawable *child)
 Add a child to this DeltaDrawable.
virtual void RemoveChild (DeltaDrawable *child)
 Remove a DeltaDrawable child.
void Emancipate ()
 Remove this DeltaDrawable from it's parent.
unsigned int GetNumChildren () const
 Return the number of DeltaDrawable children added.
DeltaDrawableGetChild (unsigned int idx)
 Get the child specified by idx (0 to number of children-1).
const DeltaDrawableGetChild (unsigned int idx) const
 Get the child specified by idx (0 to number of children-1).
unsigned int GetChildIndex (const DeltaDrawable *child) const
 Get the index number of child.
bool CanBeChild (DeltaDrawable *child) const
 Check if the supplied DeltaDrawable can actually be a chil of this instance.
virtual void RenderProxyNode (bool enable=true)
void GetBoundingSphere (osg::Vec3 *center, float *radius)
 Get the bounding sphere information for this Drawable.

Protected Member Functions

 DeltaDrawable (const std::string &name="DeltaDrawable")
virtual ~DeltaDrawable ()
osg::Node * GetProxyNode ()
const osg::Node * GetProxyNode () const
void SetProxyNode (osg::Node *proxyNode)
virtual void OnOrphaned ()
 Callback which is called when this drawable's parent is removed.


Detailed Description

A renderable object.

A Drawable is a virtual base class which cannot be created, but rather must be derived. The derived class must instantiate the mNode protected variable which is some type of osg::Node. A Drawable instance must be added to the Scene for it to be rendered.

See also:
Scene::AddDrawable

Constructor & Destructor Documentation

DeltaDrawable::DeltaDrawable ( const std::string &  name = "DeltaDrawable"  )  [protected]

DeltaDrawable::~DeltaDrawable (  )  [protected, virtual]


Member Function Documentation

virtual osg::Node* dtCore::DeltaDrawable::GetOSGNode (  )  [pure virtual]

Get the internal node.

Returns this object's OpenSceneGraph node.

Returns:
the OpenSceneGraph node

Implemented in dtABC::Action, dtABC::AutoTrigger, dtABC::Trigger, dtAI::WaypointManager, dtCore::EffectManager, dtCore::EnvEffect, dtCore::Environment, dtCore::Transformable, dtCore::Tripod, dtDAL::ActorProxyIcon::BillBoardDrawable, and dtGUI::CEUIDrawable.

virtual const osg::Node* dtCore::DeltaDrawable::GetOSGNode (  )  const [pure virtual]

Implemented in dtABC::Action, dtABC::AutoTrigger, dtABC::Trigger, dtAI::WaypointManager, dtCore::EffectManager, dtCore::EnvEffect, dtCore::Environment, dtCore::Transformable, dtCore::Tripod, dtDAL::ActorProxyIcon::BillBoardDrawable, and dtGUI::CEUIDrawable.

void DeltaDrawable::AddedToScene ( Scene scene  )  [virtual]

Supply the Scene this Drawable has been added to.

Notifies this drawable object that it has been added to a scene.

This is typically called from Scene::AddDrawable().

This method will iterate through the list of children DeltaDrawable's (if any) and call AddedToScene() with the supplied Scene.

Parameters:
scene the scene to which this drawable object has been added. Note: Can be NULL.

Reimplemented in dtActors::Cal3DGameActor, dtActors::GameMeshActor, dtActors::MeshTerrainActor, dtCore::Camera, dtCore::Environment, dtCore::Light, and dtCore::Transformable.

virtual void dtCore::DeltaDrawable::SetParent ( DeltaDrawable parent  )  [inline, virtual]

Override function for derived object to know when attaching to scene.

DeltaDrawable* dtCore::DeltaDrawable::GetParent (  )  [inline]

Reimplemented in dtABC::BezierControlPoint, and dtABC::MotionAction.

const DeltaDrawable* dtCore::DeltaDrawable::GetParent (  )  const [inline]

Reimplemented in dtABC::BezierControlPoint, and dtABC::MotionAction.

Scene* dtCore::DeltaDrawable::GetSceneParent (  )  [inline]

Get a pointer to the Scene this Drawable has been added to.

const Scene* dtCore::DeltaDrawable::GetSceneParent (  )  const [inline]

bool DeltaDrawable::AddChild ( DeltaDrawable child  )  [virtual]

Add a child to this DeltaDrawable.

This virtual method can be overwritten to perform specific functionality.

The default method will store the child in a list and set the child's parent.

Parameters:
child : The child to add to this Drawable
Returns:
: Successfully added this child or not

Reimplemented in dtCore::Environment, dtCore::Light, dtCore::Transformable, dtDAL::ActorProxyIcon::BillBoardDrawable, and dtGUI::CEUIDrawable.

void DeltaDrawable::RemoveChild ( DeltaDrawable child  )  [virtual]

Remove a DeltaDrawable child.

Remove a child from this DeltaDrawable. This will detach the child from its parent so that its free to be repositioned on its own.

Parameters:
*child : The child DeltaDrawable to be removed

Reimplemented in dtCore::Environment, dtCore::Light, dtCore::Transformable, and dtDAL::ActorProxyIcon::BillBoardDrawable.

void DeltaDrawable::Emancipate (  ) 

Remove this DeltaDrawable from it's parent.

Remove this DeltaDrawable from it's parent DeltaDrawable if it has one.

Each DeltaDrawable may have only one parent and it must be removed from it's parent before adding it as a child to another.

See also:
RemoveChild()

unsigned int dtCore::DeltaDrawable::GetNumChildren (  )  const [inline]

Return the number of DeltaDrawable children added.

DeltaDrawable* dtCore::DeltaDrawable::GetChild ( unsigned int  idx  )  [inline]

Get the child specified by idx (0 to number of children-1).

const DeltaDrawable* dtCore::DeltaDrawable::GetChild ( unsigned int  idx  )  const [inline]

Get the child specified by idx (0 to number of children-1).

unsigned int DeltaDrawable::GetChildIndex ( const DeltaDrawable child  )  const

Get the index number of child.

Return a value between 0 and the number of children-1 if found, if not found then return the number of children.

Return a value between 0 and the number of children-1 if found, if not found then return the number of children.

bool DeltaDrawable::CanBeChild ( DeltaDrawable child  )  const

Check if the supplied DeltaDrawable can actually be a chil of this instance.

Parameters:
child : The child to test
Returns:
true if the supplied parameter can be a child
Check to see if the supplied DeltaDrawable can be a child to this instance. To be valid, it can't already have a parent, can't be this instance, and can't be the parent of this instance.

Parameters:
*child : The candidate child to be tested
Returns:
bool : True if it can be a child, false otherwise

void DeltaDrawable::RenderProxyNode ( bool  enable = true  )  [virtual]

Reimplemented in dtABC::BezierController, and dtCore::Transformable.

void DeltaDrawable::GetBoundingSphere ( osg::Vec3 *  center,
float *  radius 
)

Get the bounding sphere information for this Drawable.

Parameters:
center : pointer to fill out with the sphere's center position
radius : float pointer to fill out with the sphere's radius

osg::Node* dtCore::DeltaDrawable::GetProxyNode (  )  [inline, protected]

const osg::Node* dtCore::DeltaDrawable::GetProxyNode (  )  const [inline, protected]

void DeltaDrawable::SetProxyNode ( osg::Node *  proxyNode  )  [protected]

void DeltaDrawable::OnOrphaned (  )  [protected, virtual]

Callback which is called when this drawable's parent is removed.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008