dtDAL::ActorProxy Class Reference

This is the base class for all actor proxy objects. More...

#include <actorproxy.h>

Inheritance diagram for dtDAL::ActorProxy:

dtActors::ActionActorProxy dtActors::AutoTriggerActorProxy dtActors::EnvEffectActorProxy dtActors::TriggerActorProxy dtActors::TripodActorProxy dtDAL::TransformableActorProxy dtActors::MotionActionActorProxy dtActors::CloudDomeActorProxy dtActors::CloudPlaneActorProxy dtActors::SkyBoxActorProxy dtActors::SkyDomeActorProxy dtActors::BaseLightActorProxy dtActors::BezierControlPointActorProxy dtActors::BezierNodeActorProxy dtActors::CameraActorProxy dtActors::InfiniteTerrainActorProxy dtActors::ParticleSystemActorProxy dtActors::PlayerStartActorProxy dtActors::ProximityTriggerActorProxy dtDAL::PhysicalActorProxy dtDAL::WaypointActorProxy

List of all members.

Public Member Functions

 ActorProxy ()
 Constructs the actor proxy.
const dtCore::UniqueIdGetId () const
 Gets the UniqueID object assigned to this actor proxy.
void SetId (const dtCore::UniqueId &newId)
 Sets the UniqueID mapped to this actor proxy.
const std::string & GetName () const
 Gets the name of the actor proxy.
void SetName (const std::string &name)
 Sets the name of this actor proxy.
const std::string & GetClassName () const
 Retrieve the class name.
bool IsInstanceOf (const std::string &name) const
 Returns if one object is an instance of another.
const std::set< std::string > & GetClassHierarchy () const
 Returns an alphabetically ordered list of strings corresponding to the list of ancestor classes from which this derives.
virtual bool IsGameActorProxy () const
 This is a shortcut to avoid having to dynamic cast to a GameActorProxy.
void AddProperty (ActorProperty *newProp)
 Adds a new property to the this proxy's list of properties.
ActorPropertyGetProperty (const std::string &name)
 Gets a property of the requested name.
template<class PropertyType>
void GetProperty (const std::string &name, PropertyType *&property)
 Templated version of GetProperty (non-const) that auto casts the property to the desired type.
const ActorPropertyGetProperty (const std::string &name) const
 Gets a property of the requested name.
template<class PropertyType>
void GetProperty (const std::string &name, const PropertyType *&property) const
 Templated version of GetProperty (const) that auto casts the property to the desired type.
ResourceDescriptorGetResource (const std::string &name)
 Gets a ResourceDescriptor of the requested property name.
const ResourceDescriptorGetResource (const std::string &name) const
 Gets a ResourceDescriptor of the requested property name.
void SetResource (const std::string &name, ResourceDescriptor *source)
 Sets a resource in the map.
const ActorProxyGetLinkedActor (const std::string &name) const
 Gets a property of the requested name.
ActorProxyGetLinkedActor (const std::string &name)
 Gets a property of the requested name.
void SetLinkedActor (const std::string &name, ActorProxy *newValue)
 Sets an actor proxy in the map.
void GetPropertyList (std::vector< ActorProperty * > &propList)
 Gets a list of the properties currently registered for this actor proxy.
void GetPropertyList (std::vector< const ActorProperty * > &propList) const
 Gets a const list of the properties currently registered for this actor proxy.
const ActorTypeGetActorType () const
 Gets the actor type that represents this actor proxy.
dtCore::DeltaDrawableGetActor ()
 Gets the actor type that represents this actor proxy.
template<typename TActorPtr>
void GetActor (TActorPtr &actorType)
 Templated version of GetActor() that static casts the actor to the type passed in.
const dtCore::DeltaDrawableGetActor () const
 Gets the actor who's properties are modeled by this proxy.
template<typename TActorPtr>
void GetActor (TActorPtr &actorType) const
 Templated version of GetActor() const that static casts the actor to the type passed in.
virtual void SetBillBoardIcon (ActorProxyIcon *icon)
 Sets the billboard icon used to represent this actor proxy.
virtual ActorProxyIconGetBillBoardIcon ()
 Gets the billboard icon currently assigned to this actor proxy.
virtual const RenderModeGetRenderMode ()
 Gets the render mode currently active on this actor proxy.
virtual void BuildPropertyMap ()=0
 This method is called by the actor registry which instructs the proxy to create its properties.
virtual bool IsPlaceable () const =0
 Not all objects are "placeable" in the scene.
virtual bool IsGhostProxy () const
 if this returns true, this proxy will not be saved into the map useful for having proxies that own other proxies
virtual void OnRemove () const
 Called when this actor is removed from a map.
virtual dtCore::RefPtr
< ActorProxy
Clone ()
 Creates a copy of this actor proxy and returns it.
const bool IsInSTAGE () const
 Returns true if called from STAGE.
bool operator== (const ActorProxy &rhs) const
bool operator!= (const ActorProxy &rhs) const

Protected Member Functions

void SetActor (dtCore::DeltaDrawable &actor)
 Sets the actor on this proxy.
virtual ~ActorProxy ()
 Keep the destructor protected since we use dtCore::RefPtr to track any object created.
virtual void CreateActor ()=0
 Initializes the actor.
void SetClassName (const std::string &name)
 Set the class name.
void RemoveProperty (const std::string &nameToRemove)
 Only call from build property map.

Protected Attributes

dtCore::RefPtr< ActorProxyIconmBillBoardIcon
 Each actor proxy may have a billboard associated with it.

Friends

class ActorPluginRegistry
 Allow access to the ActorPluginRegistry.

Classes

class  RenderMode
 This enumeration defines the different ways an actor proxy can be rendered in the level editor. More...


Detailed Description

This is the base class for all actor proxy objects.

The proxy's main purpose is to expose the attributes of an actor class (or Delta3D object) via a list of properties.

Note:
Proxy objects must be created through the ActorPluginRegistry or the LibraryManager. If they are not created in this fashion, the actor types will not be set correctly.

Client-side applications may or may not wish to use the proxy interface for accessing actor objects. However, the actor proxy is the only way to expose actors to the Delta3D Level Editor.


Constructor & Destructor Documentation

dtDAL::ActorProxy::ActorProxy (  ) 

Constructs the actor proxy.

dtDAL::ActorProxy::~ActorProxy (  )  [protected, virtual]

Keep the destructor protected since we use dtCore::RefPtr to track any object created.


Member Function Documentation

const dtCore::UniqueId & dtDAL::ActorProxy::GetId (  )  const

Gets the UniqueID object assigned to this actor proxy.

Returns:
The UniqueID.

void dtDAL::ActorProxy::SetId ( const dtCore::UniqueId newId  ) 

Sets the UniqueID mapped to this actor proxy.

Parameters:
newId The new ID.

const std::string & dtDAL::ActorProxy::GetName (  )  const

Gets the name of the actor proxy.

This is actually a wrapper which just returns the name assigned to the underlying actor.

Returns:
A string identifier.

void dtDAL::ActorProxy::SetName ( const std::string &  name  ) 

Sets the name of this actor proxy.

In actuality, this is setting the name of the underlying actor this proxy is holding.

Parameters:
name The new name to assign to this actor proxy.

const std::string& dtDAL::ActorProxy::GetClassName (  )  const [inline]

Retrieve the class name.

Returns:
The class name

bool dtDAL::ActorProxy::IsInstanceOf ( const std::string &  name  )  const [inline]

Returns if one object is an instance of another.

Parameters:
name The name of the object to check against
Returns:
true if it is, false if not

const std::set<std::string>& dtDAL::ActorProxy::GetClassHierarchy (  )  const [inline]

Returns an alphabetically ordered list of strings corresponding to the list of ancestor classes from which this derives.

Returns:
An STL set.

virtual bool dtDAL::ActorProxy::IsGameActorProxy (  )  const [inline, virtual]

This is a shortcut to avoid having to dynamic cast to a GameActorProxy.

It should only be overridded by dtGame::GameActorProxy.

Returns:
true if this proxy is an instance of dtGame::GameActorProxy

Reimplemented in dtGame::GameActorProxy.

void dtDAL::ActorProxy::AddProperty ( ActorProperty newProp  ) 

Adds a new property to the this proxy's list of properties.

Note:
Properties must have unique names, therefore, if a property is added that who's name collides with another, the property is not added and an error message is logged.

ActorProperty * dtDAL::ActorProxy::GetProperty ( const std::string &  name  ) 

Gets a property of the requested name.

Parameters:
name Name of the property to retrieve.
Returns:
A pointer to the property object or NULL if it is not found.

template<class PropertyType>
void dtDAL::ActorProxy::GetProperty ( const std::string &  name,
PropertyType *&  property 
) [inline]

Templated version of GetProperty (non-const) that auto casts the property to the desired type.

Warning: this uses a static cast, so you are able to shoot yourself in the foot.

const ActorProperty * dtDAL::ActorProxy::GetProperty ( const std::string &  name  )  const

Gets a property of the requested name.

(const version)

Parameters:
name Name of the property to retrieve.
Returns:
A pointer to the property object or NULL if it is not found.

template<class PropertyType>
void dtDAL::ActorProxy::GetProperty ( const std::string &  name,
const PropertyType *&  property 
) const [inline]

Templated version of GetProperty (const) that auto casts the property to the desired type.

Warning: this uses a static cast, so you are able to shoot yourself in the foot.

ResourceDescriptor * dtDAL::ActorProxy::GetResource ( const std::string &  name  ) 

Gets a ResourceDescriptor of the requested property name.

Parameters:
name Name of the resouce to retrieve.
Returns:
A pointer to the resource descripter or NULL if it is not found.

const ResourceDescriptor * dtDAL::ActorProxy::GetResource ( const std::string &  name  )  const

Gets a ResourceDescriptor of the requested property name.

Parameters:
name Name of the resouce to retrieve.
Returns:
A pointer to the resource descripter or NULL if it is not found.

void dtDAL::ActorProxy::SetResource ( const std::string &  name,
ResourceDescriptor source 
)

Sets a resource in the map.

Parameters:
name The name of the resouce
source The pointer to resource descriptor

const ActorProxy * dtDAL::ActorProxy::GetLinkedActor ( const std::string &  name  )  const

Gets a property of the requested name.

Parameters:
name Name of the actor actor property to retrieve.
Returns:
A pointer to the ActorProxy or NULL if it is not found.

ActorProxy * dtDAL::ActorProxy::GetLinkedActor ( const std::string &  name  ) 

Gets a property of the requested name.

Parameters:
name Name of the actor actor property to retrieve.
Returns:
A pointer to the ActorProxy or NULL if it is not found.

void dtDAL::ActorProxy::SetLinkedActor ( const std::string &  name,
ActorProxy newValue 
)

Sets an actor proxy in the map.

Parameters:
name The name of the property to set
value The pointer to new proxy value

void dtDAL::ActorProxy::GetPropertyList ( std::vector< ActorProperty * > &  propList  ) 

Gets a list of the properties currently registered for this actor proxy.

void dtDAL::ActorProxy::GetPropertyList ( std::vector< const ActorProperty * > &  propList  )  const

Gets a const list of the properties currently registered for this actor proxy.

const ActorType& dtDAL::ActorProxy::GetActorType (  )  const [inline]

Gets the actor type that represents this actor proxy.

Note:
The actor type is assigned to the proxy when it is created by the actor registry.

dtCore::DeltaDrawable * dtDAL::ActorProxy::GetActor (  ) 

Gets the actor type that represents this actor proxy.

Note:
The actor type is assigned to the proxy when it is created by the actor registry. Gets the actor who's properties are modeled by this proxy.

Actors in the Dynamic Actor Layer are actually synonyms for any Delta3D object. All Delta3D objects that are drawable derive from dtCore::DeltaDrawable. Therefore, an actor is any class that contains dtCore::DeltaDrawable in its inheritance tree.

template<typename TActorPtr>
void dtDAL::ActorProxy::GetActor ( TActorPtr &  actorType  )  [inline]

Templated version of GetActor() that static casts the actor to the type passed in.

Note:
Make sure the supplied pointer is of the correct type which matches the proxy!
 dtCore::InfiniteLight *light;
 proxy->GetActor(light);

const dtCore::DeltaDrawable * dtDAL::ActorProxy::GetActor (  )  const

Gets the actor who's properties are modeled by this proxy.

Note:
Actors in the Dynamic Actor Layer are actually synonyms for any Delta3D object. All Delta3D objects that are drawable derive from dtCore::DeltaDrawable. Therefore, an actor is any class that contains dtCore::DeltaDrawable in its inheritance tree.

template<typename TActorPtr>
void dtDAL::ActorProxy::GetActor ( TActorPtr &  actorType  )  const [inline]

Templated version of GetActor() const that static casts the actor to the type passed in.

void dtDAL::ActorProxy::SetBillBoardIcon ( ActorProxyIcon icon  )  [virtual]

Sets the billboard icon used to represent this actor proxy.

Parameters:
icon The billboard to use.
Note:
This will only be rendered if the RenderMode is set to DRAW_BILLBOARD_ICON.

ActorProxyIcon * dtDAL::ActorProxy::GetBillBoardIcon (  )  [virtual]

Gets the billboard icon currently assigned to this actor proxy.

Returns:
The billboard icon.

Reimplemented in dtActors::AnimationGameActorProxy, dtActors::BaseLightActorProxy, dtActors::BezierControlPointActorProxy, dtActors::BezierNodeActorProxy, dtActors::Cal3DGameActorProxy, dtActors::CameraActorProxy, dtActors::CoordinateConfigActorProxy, dtActors::GameMeshActorProxy, dtActors::MeshTerrainActorProxy, dtActors::ParticleSystemActorProxy, dtActors::PlayerStartActorProxy, dtActors::PositionalLightActorProxy, dtActors::ProximityTriggerActorProxy, dtActors::SoundActorProxy, dtActors::SpotlightActorProxy, dtActors::StaticMeshActorProxy, dtActors::TaskActorProxy, and dtDAL::WaypointActorProxy.

const ActorProxy::RenderMode & dtDAL::ActorProxy::GetRenderMode (  )  [virtual]

Gets the render mode currently active on this actor proxy.

Returns:
The current render mode.

Reimplemented in dtActors::AnimationGameActorProxy, dtActors::BaseLightActorProxy, dtActors::BezierControlPointActorProxy, dtActors::BezierNodeActorProxy, dtActors::Cal3DGameActorProxy, dtActors::CameraActorProxy, dtActors::CoordinateConfigActorProxy, dtActors::GameMeshActorProxy, dtActors::MeshTerrainActorProxy, dtActors::ParticleSystemActorProxy, dtActors::PlayerStartActorProxy, dtActors::PositionalLightActorProxy, dtActors::ProximityTriggerActorProxy, dtActors::SoundActorProxy, dtActors::SpotlightActorProxy, dtActors::StaticMeshActorProxy, dtActors::TaskActorProxy, and dtDAL::WaypointActorProxy.

virtual void dtDAL::ActorProxy::BuildPropertyMap (  )  [pure virtual]

This method is called by the actor registry which instructs the proxy to create its properties.

Methods implementing this should be sure to call their parent class's buildPropertyMap method to ensure all properties in the proxy inheritance hierarchy are correcly added to the property map.

Implemented in dtActors::ActionActorProxy, dtActors::AnimationGameActorProxy, dtActors::AutoTriggerActorProxy, dtActors::BaseLightActorProxy, dtActors::BasicEnvironmentActorProxy, dtActors::BezierControllerActorProxy, dtActors::BezierControlPointActorProxy, dtActors::BezierNodeActorProxy, dtActors::Cal3DGameActorProxy, dtActors::CameraActorProxy, dtActors::CloudDomeActorProxy, dtActors::CloudPlaneActorProxy, dtActors::CoordinateConfigActorProxy, dtActors::DeltaObjectActorProxy, dtActors::EnvActorProxy, dtActors::EnvEffectActorProxy, dtActors::GameMeshActorProxy, dtActors::InfiniteLightActorProxy, dtActors::InfiniteTerrainActorProxy, dtActors::MeshTerrainActorProxy, dtActors::MotionActionActorProxy, dtActors::ParticleSystemActorProxy, dtActors::PlayerStartActorProxy, dtActors::PositionalLightActorProxy, dtActors::ProximityTriggerActorProxy, dtActors::SkyBoxActorProxy, dtActors::SkyDomeActorProxy, dtActors::SoundActorProxy, dtActors::SpotlightActorProxy, dtActors::StaticMeshActorProxy, dtActors::TaskActorProxy, dtActors::TaskActorGameEventProxy, dtActors::TaskActorOrderedProxy, dtActors::TriggerActorProxy, dtActors::TripodActorProxy, dtDAL::PhysicalActorProxy, dtDAL::TransformableActorProxy, dtDAL::WaypointActorProxy, and dtGame::GameActorProxy.

virtual bool dtDAL::ActorProxy::IsPlaceable (  )  const [pure virtual]

Not all objects are "placeable" in the scene.

For example, an infinite light does not really have a position in the scene, therefore, it is not a placeable actor. Non-placeable actors are still added to a Delta3D scene, they are just not able to be moved around and placed throughout a scene in the same way as a placeable object. Actor proxies of this type are referred to as "global actors".

Implemented in dtActors::AutoTriggerActorProxy, dtActors::BaseLightActorProxy, dtActors::BasicEnvironmentActorProxy, dtActors::BezierControllerActorProxy, dtActors::BezierControlPointActorProxy, dtActors::BezierNodeActorProxy, dtActors::CameraActorProxy, dtActors::EnvEffectActorProxy, dtActors::InfiniteLightActorProxy, dtActors::PositionalLightActorProxy, dtActors::ProximityTriggerActorProxy, dtActors::SpotlightActorProxy, dtActors::TaskActorProxy, dtActors::TriggerActorProxy, dtActors::TripodActorProxy, dtDAL::TransformableActorProxy, and dtDAL::WaypointActorProxy.

bool dtDAL::ActorProxy::IsGhostProxy (  )  const [virtual]

if this returns true, this proxy will not be saved into the map useful for having proxies that own other proxies

Reimplemented in dtDAL::WaypointActorProxy.

void dtDAL::ActorProxy::OnRemove (  )  const [virtual]

Called when this actor is removed from a map.

Reimplemented in dtDAL::WaypointActorProxy.

dtCore::RefPtr< ActorProxy > dtDAL::ActorProxy::Clone (  )  [virtual]

Creates a copy of this actor proxy and returns it.

The method uses the library manager to create the clone and then iterates though the current state of this proxy's property set and copies their values to the newly created clone.

Returns:
The cloned actor proxy.

const bool dtDAL::ActorProxy::IsInSTAGE (  )  const

Returns true if called from STAGE.

Returns:
true if STAGE is running, false if not

bool dtDAL::ActorProxy::operator== ( const ActorProxy rhs  )  const [inline]

bool dtDAL::ActorProxy::operator!= ( const ActorProxy rhs  )  const [inline]

void dtDAL::ActorProxy::SetActor ( dtCore::DeltaDrawable actor  )  [protected]

Sets the actor on this proxy.

This should be only called from subclasses

Parameters:
actor The actor to set

virtual void dtDAL::ActorProxy::CreateActor (  )  [protected, pure virtual]

Initializes the actor.

Implemented in dtActors::AnimationGameActorProxy, dtActors::AutoTriggerActorProxy, dtActors::BaseLightActorProxy, dtActors::BasicEnvironmentActorProxy, dtActors::BezierControllerActorProxy, dtActors::BezierControlPointActorProxy, dtActors::BezierNodeActorProxy, dtActors::Cal3DGameActorProxy, dtActors::CameraActorProxy, dtActors::CloudDomeActorProxy, dtActors::CloudPlaneActorProxy, dtActors::CoordinateConfigActorProxy, dtActors::DeltaObjectActorProxy, dtActors::EnvActorProxy, dtActors::EnvEffectActorProxy, dtActors::GameMeshActorProxy, dtActors::InfiniteLightActorProxy, dtActors::InfiniteTerrainActorProxy, dtActors::MeshTerrainActorProxy, dtActors::ParticleSystemActorProxy, dtActors::PlayerStartActorProxy, dtActors::PositionalLightActorProxy, dtActors::ProximityTriggerActorProxy, dtActors::SkyBoxActorProxy, dtActors::SkyDomeActorProxy, dtActors::SoundActorProxy, dtActors::SpotlightActorProxy, dtActors::StaticMeshActorProxy, dtActors::TaskActorProxy, dtActors::TaskActorGameEventProxy, dtActors::TaskActorOrderedProxy, dtActors::TaskActorRollupProxy, dtActors::TriggerActorProxy, dtActors::TripodActorProxy, dtDAL::PhysicalActorProxy, dtDAL::TransformableActorProxy, dtDAL::WaypointActorProxy, and dtGame::GameActorProxy.

void dtDAL::ActorProxy::SetClassName ( const std::string &  name  )  [protected]

Set the class name.

Parameters:
name The class name to set

void dtDAL::ActorProxy::RemoveProperty ( const std::string &  nameToRemove  )  [protected]

Only call from build property map.


Friends And Related Function Documentation

friend class ActorPluginRegistry [friend]

Allow access to the ActorPluginRegistry.

This is so it can set the ActorType of the proxy when it creates it and call any initialization methods on the actor proxy.


Member Data Documentation

dtCore::RefPtr<ActorProxyIcon> dtDAL::ActorProxy::mBillBoardIcon [protected]

Each actor proxy may have a billboard associated with it.

Billboards are displayed in place of the actual actor if the actor has no displable qualities. For example, if a static mesh has no mesh currently assigned to it, the billboard will display instead.


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