FCDObjectWithId Class Reference
[COLLADA Document Object Model.]

A basic COLLADA object which has a unique COLLADA id. More...

#include <FCDObjectWithId.h>

Inheritance diagram for FCDObjectWithId:

FCDObject FUParameterizable FUTrackable FUObject FCDEntity FCDGeometrySource FCDAnimation FCDAnimationClip FCDController FCDEffect FCDEmitter FCDForceField FCDGeometry FCDImage FCDMaterial FCDPhysicsAnalyticalGeometry FCDPhysicsMaterial FCDPhysicsModel FCDPhysicsRigidBody FCDPhysicsRigidConstraint FCDPhysicsScene FCDSceneNode FCDTargetedEntity List of all members.

Public Member Functions

 DeclareFlag (DaeIdChanged, 1)
 DeclareFlagCount (2)
 5 flags are locally declared.
 FCDObjectWithId (FCDocument *document, const char *baseId="ObjectWithID")
 Constructor: sets the prefix COLLADA id to be used if no COLLADA id is provided.
virtual ~FCDObjectWithId ()
 Destructor.
const fm::stringGetDaeId () const
 Retrieves the unique COLLADA id for this object.
void SetDaeId (const fm::string &id)
 Sets the COLLADA id for this object.
void SetDaeId (fm::string &id)
 Sets the COLLADA id for this object.
void RemoveDaeId ()
 [INTERNAL] Release the unique COLLADA id of an object.
void Clone (FCDObjectWithId *clone) const
 [INTERNAL] Clones the object.

Static Public Member Functions

static fm::string CleanId (const char *id)
 Cleans up a given name into a valid COLLADA id.
static const fm::string CleanId (const fm::string &id)
 See above.
static fm::string CleanSubId (const char *sid)
 Cleans up a given name into a valid COLLADA sub-id.
static const fm::string CleanSubId (const fm::string &sid)
 See above.

Detailed Description

A basic COLLADA object which has a unique COLLADA id.

Many COLLADA structures such as entities and sources need a unique COLLADA id. The COLLADA document contains a map of all the COLLADA ids known in its scope. The interface of the FCDObjectWithId class allows for the retrieval and the modification of the unique COLLADA id attached to these objects.

A unique COLLADA id is built, if none are provided, using the 'baseId' field of the constructor. A unique COLLADA id is generated only on demand.


Constructor & Destructor Documentation

FCDObjectWithId::FCDObjectWithId FCDocument document,
const char *  baseId = "ObjectWithID"
 

Constructor: sets the prefix COLLADA id to be used if no COLLADA id is provided.

Parameters:
document The COLLADA document which owns this object.
baseId The prefix COLLADA id to be used if no COLLADA id is provided.


Member Function Documentation

static fm::string FCDObjectWithId::CleanId const char *  id  )  [static]
 

Cleans up a given name into a valid COLLADA id.

This function does no check for uniqueness.

Parameters:
id A name.
Returns:
A valid COLLADA id. The returned value is a static variable reference. If you want to keep this information, copy it to a local value.

static fm::string FCDObjectWithId::CleanSubId const char *  sid  )  [static]
 

Cleans up a given name into a valid COLLADA sub-id.

This function does no check for uniqueness. Sub-ids support even less characters than ids.

Parameters:
sid A sub-id.
Returns:
A valid COLLADA id. The returned value is a static variable reference. If you want to keep this information, copy it to a local value.

void FCDObjectWithId::Clone FCDObjectWithId clone  )  const
 

[INTERNAL] Clones the object.

The unique COLLADA id will be copied over to the clone object. Use carefully: when a cloned object with an id is released, it does remove the unique COLLADA id from the unique name map.

Parameters:
clone The object clone.

const fm::string& FCDObjectWithId::GetDaeId  )  const
 

Retrieves the unique COLLADA id for this object.

If no unique COLLADA id has been previously generated or provided, this function has the side-effect of generating a unique COLLADA id.

Returns:
The unique COLLADA id.

void FCDObjectWithId::RemoveDaeId  ) 
 

[INTERNAL] Release the unique COLLADA id of an object.

Use this function wisely, as it leaves the object id-less and without a way to automatically generate a COLLADA id.

void FCDObjectWithId::SetDaeId fm::string id  ) 
 

Sets the COLLADA id for this object.

There is no guarantee that the given COLLADA id will be used, as it may not be unique.

Parameters:
id The wanted COLLADA id for this object. This COLLADA id does not need to be unique. If the COLLADA id is not unique, a new unique COLLADA id will be generated and this formal variable will be modified to contain the new COLLADA id.

void FCDObjectWithId::SetDaeId const fm::string id  ) 
 

Sets the COLLADA id for this object.

There is no guarantee that the given COLLADA id will be used, as it may not be unique. You can call the GetDaeId function after this call to retrieve the final, unique COLLADA id.

Parameters:
id The wanted COLLADA id for this object. This COLLADA id does not need to be unique. If the COLLADA id is not unique, a new unique COLLADA id will be generated.


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 16:58:39 2008 for FCollada by  doxygen 1.4.6-NO