FCDObjectWithId Class Reference
[COLLADA Document Object Model.]

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

#include <FCDObject.h>

Inheritance diagram for FCDObjectWithId:

FCDObject FUObject FCDEntity FCDGeometrySource FCDAnimation FCDController FCDEffect FCDGeometry FCDImage FCDMaterial FCDSceneNode FCDTargetedEntity FCDTexture List of all members.

Public Member Functions

 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 string & GetDaeId () const
 Retrieves the unique COLLADA id for this object.
void SetDaeId (const string &id)
 Sets the COLLADA id for this object.
void SetDaeId (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.

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

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 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 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 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 Fri May 12 16:44:43 2006 for FCollada by  doxygen 1.4.6-NO