dtDAL::ActorProperty Class Reference

The actor property class provides a get/set mechanism for accessing properties of a class. More...

#include <actorproperty.h>

Inheritance diagram for dtDAL::ActorProperty:

dtDAL::AbstractParameter dtDAL::ActorActorProperty dtDAL::GenericActorProperty< SetType, GetType > dtDAL::GenericActorProperty< bool, bool > dtDAL::GenericActorProperty< const osg::Vec2 &, osg::Vec2 > dtDAL::GenericActorProperty< const osg::Vec2d &, osg::Vec2d > dtDAL::GenericActorProperty< const osg::Vec2f &, osg::Vec2f > dtDAL::GenericActorProperty< const osg::Vec3 &, osg::Vec3 > dtDAL::GenericActorProperty< const osg::Vec3d &, osg::Vec3d > dtDAL::GenericActorProperty< const osg::Vec3f &, osg::Vec3f > dtDAL::GenericActorProperty< const osg::Vec4 &, osg::Vec4 > dtDAL::GenericActorProperty< const osg::Vec4d &, osg::Vec4d > dtDAL::GenericActorProperty< const osg::Vec4f &, osg::Vec4f > dtDAL::GenericActorProperty< const std::string &, std::string > dtDAL::GenericActorProperty< double, double > dtDAL::GenericActorProperty< dtDAL::GameEvent *, dtDAL::GameEvent * > dtDAL::GenericActorProperty< float, float > dtDAL::GenericActorProperty< int, int > dtDAL::GenericActorProperty< long, long > dtDAL::GenericActorProperty< T &, T & > dtDAL::GroupActorProperty dtDAL::ResourceActorProperty

List of all members.

Public Member Functions

virtual const std::string & GetName () const
 Gets the unique name assigned to this property.
virtual const DataTypeGetDataType () const
 
Returns:
the type of this property.

DataTypeGetPropertyType () const
 This is an alias to GetStringValue.
virtual void CopyFrom (const ActorProperty &otherProp)=0
 Assigns the value of this property the value contained in the specified property.
const std::string & GetLabel () const
 Gets the label assigned to this property.
const std::string & GetDescription () const
 Gets the description assigned to this property.
bool IsReadOnly () const
 Gets the read only state of a property.
void SetReadOnly (bool readOnly)
 Sets the read only state of a property.
void SetGroupName (const std::string &name)
 Sets the value of the property based on a string.
const std::string & GetGroupName () const
 Get the group name.
void SetNumberPrecision (unsigned int precision)
 Sets the precision of floating point number as they are converted to and from string values.
unsigned int GetNumberPrecision () const
 Gets the current floating point precision value on this parameter.

Protected Member Functions

 ActorProperty (dtDAL::DataType &dataType, const std::string &name, const std::string &label, const std::string &desc, const std::string &groupName, bool readOnly=false)
 Constructs the actor property.
virtual ~ActorProperty ()
 Protected since actor properties are smart pointers.

Protected Attributes

std::string mGroupName
 The name of the property's group.


Detailed Description

The actor property class provides a get/set mechanism for accessing properties of a class.

The get/set portions of the property are functor objects which point to a getter and setter method on a particular class. Therefore, when a property is created, it knows how to set and get the data it represents.

Note:
There are, by default, a set of classes that map to the data types listed in the Delta3D datatypes enumeration. The most common/preferred method signatures for each property type is supported. If, however, the need arises for completely custom properties, this is possible through the GenericActorProperty class.
See also:
DataType

GenericActorProperty


Constructor & Destructor Documentation

dtDAL::ActorProperty::ActorProperty ( dtDAL::DataType dataType,
const std::string &  name,
const std::string &  label,
const std::string &  desc,
const std::string &  groupName,
bool  readOnly = false 
) [inline, protected]

Constructs the actor property.

This is protected since the real property functionality comes from classes extending this one.

virtual dtDAL::ActorProperty::~ActorProperty (  )  [inline, protected, virtual]

Protected since actor properties are smart pointers.


Member Function Documentation

virtual const std::string& dtDAL::ActorProperty::GetName (  )  const [inline, virtual]

Gets the unique name assigned to this property.

Implements dtDAL::AbstractParameter.

virtual const DataType& dtDAL::ActorProperty::GetDataType (  )  const [inline, virtual]

Returns:
the type of this property.

Implements dtDAL::AbstractParameter.

DataType& dtDAL::ActorProperty::GetPropertyType (  )  const [inline]

This is an alias to GetStringValue.

See also:
GetStringValue
Returns:
the value of the property as a string. This is an alias to SetStringValue.
See also:
SetStringValue
Returns:
true if the property could be set via the string.

Returns an enumeration of the data type that this property represents.

Reimplemented in dtDAL::EnumActorProperty< T >.

virtual void dtDAL::ActorProperty::CopyFrom ( const ActorProperty otherProp  )  [pure virtual]

Assigns the value of this property the value contained in the specified property.

Parameters:
otherProp The property containing the value to copy.
Note:
This method exists to provide subclasses the opportunity to assign values to themselves from other properties in a generic manor. For example, if there is a list of generic actor properties of varying types, using this method, you can loop through each list and merely call this method to copy one property value to another.

This is not like a copy constructor or assignment operator. The is merely a method to set the "value" of a property from another property.

See also:
GenericActorProperty::copyFrom

Implemented in dtDAL::ActorActorProperty, dtDAL::ResourceActorProperty, dtDAL::GenericActorProperty< SetType, GetType >, dtDAL::GroupActorProperty, dtDAL::GenericActorProperty< const osg::Vec4d &, osg::Vec4d >, dtDAL::GenericActorProperty< long, long >, dtDAL::GenericActorProperty< const osg::Vec4 &, osg::Vec4 >, dtDAL::GenericActorProperty< float, float >, dtDAL::GenericActorProperty< const osg::Vec2 &, osg::Vec2 >, dtDAL::GenericActorProperty< const osg::Vec3 &, osg::Vec3 >, dtDAL::GenericActorProperty< int, int >, dtDAL::GenericActorProperty< const std::string &, std::string >, dtDAL::GenericActorProperty< const osg::Vec3f &, osg::Vec3f >, dtDAL::GenericActorProperty< dtDAL::GameEvent *, dtDAL::GameEvent * >, dtDAL::GenericActorProperty< const osg::Vec2f &, osg::Vec2f >, dtDAL::GenericActorProperty< double, double >, dtDAL::GenericActorProperty< const osg::Vec4f &, osg::Vec4f >, dtDAL::GenericActorProperty< const osg::Vec3d &, osg::Vec3d >, dtDAL::GenericActorProperty< const osg::Vec2d &, osg::Vec2d >, dtDAL::GenericActorProperty< T &, T & >, and dtDAL::GenericActorProperty< bool, bool >.

const std::string& dtDAL::ActorProperty::GetLabel (  )  const [inline]

Gets the label assigned to this property.

const std::string& dtDAL::ActorProperty::GetDescription (  )  const [inline]

Gets the description assigned to this property.

bool dtDAL::ActorProperty::IsReadOnly (  )  const [inline]

Gets the read only state of a property.

void dtDAL::ActorProperty::SetReadOnly ( bool  readOnly  )  [inline]

Sets the read only state of a property.

void dtDAL::ActorProperty::SetGroupName ( const std::string &  name  )  [inline]

Sets the value of the property based on a string.

Note:
This method will attempt to use the data to set the value, but it may return false if the data could not be used.
Parameters:
value the value to set.
Returns:
true if the string was usable to set the value, false if not.

a string version of the data. This value can be used when calling SetStringValue.

See also:
SetStringValue Set the group name
Parameters:
name The desired group name

const std::string& dtDAL::ActorProperty::GetGroupName (  )  const [inline]

Get the group name.

Returns:
The current group name

void dtDAL::ActorProperty::SetNumberPrecision ( unsigned int  precision  )  [inline]

Sets the precision of floating point number as they are converted to and from string values.

Parameters:
precision The amount of numeric percision.
Note:
This value defaults to 16.

unsigned int dtDAL::ActorProperty::GetNumberPrecision (  )  const [inline]

Gets the current floating point precision value on this parameter.

Returns:
The current number precision.


Member Data Documentation

std::string dtDAL::ActorProperty::mGroupName [protected]

The name of the property's group.


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