dtDAL::GroupActorProperty Class Reference

An actor property that contains a structure of NamedParameter Objects. More...

#include <groupactorproperty.h>

Inheritance diagram for dtDAL::GroupActorProperty:

dtDAL::ActorProperty dtDAL::AbstractParameter

List of all members.

Public Member Functions

 GroupActorProperty (const std::string &name, const std::string &label, Functor1< const NamedGroupParameter & > set, Functor0Ret< dtCore::RefPtr< NamedGroupParameter > > get, const std::string &desc, const std::string &groupName, const std::string &editorType="", bool readOnly=false)
 Creates a new group actor property.
virtual bool FromString (const std::string &value)
 Sets the value of the property based on a string.
virtual const std::string ToString () const
 
Returns:
a string version of the data.

virtual void CopyFrom (const ActorProperty &otherProp)
 This is overridden to make handle the fact that the get method returns a refptr.
void SetValue (const NamedGroupParameter &value)
 Sets the value of this property by calling the set functor assigned to this property.
dtCore::RefPtr
< NamedGroupParameter
GetValue () const
 
Returns:
the value of this property be calling the get functor assigned to this property.

const std::string & GetEditorType () const

Protected Member Functions

virtual ~GroupActorProperty ()


Detailed Description

An actor property that contains a structure of NamedParameter Objects.

This actor property solves the concept of both structures and lists in actor properties. This property gets and sets a NamedGroupParameter, which can hold any number of other NamedParameters. This is passed to the functors for the actor property which must then handle the data in way that makes sense the actor. Additionally, a string name can be passed to the property in the constructor

Note:
When loading and saving GroupActorProperties, only the NamedParameter types that have associated actor property types can be saved. The rest will be ignored. There are no plans no solve this issue.

Also, note that currently Vec3d and Vec3f parameters will be loaded as Vec3. There are plans to fix this.


Constructor & Destructor Documentation

dtDAL::GroupActorProperty::GroupActorProperty ( const std::string &  name,
const std::string &  label,
Functor1< const NamedGroupParameter & >  set,
Functor0Ret< dtCore::RefPtr< NamedGroupParameter > >  get,
const std::string &  desc,
const std::string &  groupName,
const std::string &  editorType = "",
bool  readOnly = false 
)

Creates a new group actor property.

Parameters:
name the name used to access this property.
label a more human readable name to use when displaying the property.
desc a longer description of the property.
set The setting functor, a method/function taking a const reference to a NamedGroupParameter.
get The getting functor, a method/function returning a ref ptr to a NamedGroupParameter It returns a refptr because it is expected that the method returning the data will generating the parameter from internal data and won't be holding onto it.
groupName The property grouping to use when editing properties visually.
editorType a string specifying what type of editor to use for the data in this group. These will specify a UI to use in STAGE.
readOnly true if this property should not be editable. Defaults to false.

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


Member Function Documentation

bool dtDAL::GroupActorProperty::FromString ( const std::string &  value  )  [virtual]

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.

Implements dtDAL::AbstractParameter.

const std::string dtDAL::GroupActorProperty::ToString (  )  const [virtual]

Returns:
a string version of the data.

This value can be used when calling SetStringValue.

See also:
SetStringValue

Implements dtDAL::AbstractParameter.

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

This is overridden to make handle the fact that the get method returns a refptr.

Parameters:
otherProp The property to copy from.

Implements dtDAL::ActorProperty.

void dtDAL::GroupActorProperty::SetValue ( const NamedGroupParameter value  ) 

Sets the value of this property by calling the set functor assigned to this property.

dtCore::RefPtr< NamedGroupParameter > dtDAL::GroupActorProperty::GetValue (  )  const

Returns:
the value of this property be calling the get functor assigned to this property.

const std::string& dtDAL::GroupActorProperty::GetEditorType (  )  const [inline]


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