FCDLibrary< T > Class Template Reference
[COLLADA Document Object Model.]

A COLLADA library. More...

#include <FCDLibrary.h>

List of all members.

Public Member Functions

 FCDLibrary (FCDocument *document)
 Constructor: do not use directly.
virtual ~FCDLibrary ()
 Destructor: do not use directly.
T * AddEntity ()
 Create a new entity within this library.
void ReleaseEntity (T *entity)
 Releases an entity contained within this library.
T * FindDaeId (const string &daeId)
 Retrieve the library entity with the given COLLADA id.
bool IsEmpty () const
 Returns whether the library contains no entities.
virtual FUStatus LoadFromXML (xmlNode *node)
 [INTERNAL] Reads in the contents of the library from the COLLADA XML document.
virtual void WriteToXML (xmlNode *node) const
 [INTERNAL] Writes out the library entities to the COLLADA XML document.
StringList GetPostProcessCmds () const
size_t GetEntityCount () const
 Retrieve the number of entities within the library.
T * GetEntity (size_t index)
 Retrieve an indexed entity from the library.
const T * GetEntity (size_t index) const
 Retrieve an indexed entity from the library.

Protected Types

typedef vector< T * > FCDEntityList
 The list type for the entities.

Protected Member Functions

FCDocumentGetDocument ()
 Retrieves the parent document.
const FCDocumentGetDocument () const
 See above.

Protected Attributes

FCDEntityList entities
 Entities list.


Detailed Description

template<class T>
class FCDLibrary< T >

A COLLADA library.

A COLLADA library holds a list of entities. There are libraries for the following entities: animations (FCDAnimation), animation clips (FCDAnimationClip), meshes and splines (FCDGeometry), materials (FCDMaterial), effects (FCDEffect), images (FCDImage), skins and morphers (FCDController), cameras (FCDCamera), lights (FCDLight), physics models (FCDPhysicsModel), physics materials (FCDPhysicsMaterial), physics scenes (FCDPhysicsSceneNode) and visual scenes (FCDSceneNode).

The COLLADA libraries are contained within the FCDocument object.


Constructor & Destructor Documentation

template<class T>
FCDLibrary< T >::FCDLibrary FCDocument document  ) 
 

Constructor: do not use directly.

All the necessary libraries are created by the FCDocument object during its creation.

Parameters:
document The parent document.

template<class T>
FCDLibrary< T >::~FCDLibrary  )  [virtual]
 

Destructor: do not use directly.

The libraries are released by the FCDocument, just before it is released.


Member Function Documentation

template<class T>
T * FCDLibrary< T >::AddEntity  ) 
 

Create a new entity within this library.

Returns:
The newly created entity.

template<class T>
T * FCDLibrary< T >::FindDaeId const string &  daeId  ) 
 

Retrieve the library entity with the given COLLADA id.

Parameters:
daeId The COLLADA id of the entity.
Returns:
The library entity which matches the COLLADA id. This pointer will be NULL if no matching entity was found.

template<class T>
FCDocument* FCDLibrary< T >::GetDocument  )  [inline, protected]
 

Retrieves the parent document.

Returns:
The parent document.

template<class T>
const T* FCDLibrary< T >::GetEntity size_t  index  )  const [inline]
 

Retrieve an indexed entity from the library.

Parameters:
index The index of the entity to retrieve. Should be within the range [0, GetEntityCount()[.
Returns:
The indexed entity.

template<class T>
T* FCDLibrary< T >::GetEntity size_t  index  )  [inline]
 

Retrieve an indexed entity from the library.

Parameters:
index The index of the entity to retrieve. Should be within the range [0, GetEntityCount()[.
Returns:
The indexed entity.

template<class T>
size_t FCDLibrary< T >::GetEntityCount  )  const [inline]
 

Retrieve the number of entities within the library.

Returns:
the number of entities contained within the library.

template<class T>
StringList FCDLibrary< T >::GetPostProcessCmds  )  const
 

Deprecated:
[INTERNAL] Retrieves the list of post-processing commands for the entities of this library.
Returns:
The list of post-processing commands.

template<class T>
bool FCDLibrary< T >::IsEmpty  )  const [inline]
 

Returns whether the library contains no entities.

Returns:
Whether the library is empty.

template<class T>
FUStatus FCDLibrary< T >::LoadFromXML xmlNode *  node  )  [virtual]
 

[INTERNAL] Reads in the contents of the library from the COLLADA XML document.

Parameters:
node The COLLADA XML tree node to parse into entities.
Returns:
The status of the import. If the status is not successful, it may be dangerous to extract information from the library.

Reimplemented in FCDMaterialLibrary.

template<class T>
void FCDLibrary< T >::ReleaseEntity T *  entity  ) 
 

Releases an entity contained within this library.

Parameters:
entity The entity to delete.

template<class T>
void FCDLibrary< T >::WriteToXML xmlNode *  node  )  const [virtual]
 

[INTERNAL] Writes out the library entities to the COLLADA XML document.

Parameters:
node The COLLADA XML tree node in which to write the library entities.

Reimplemented in FCDMaterialLibrary.


Member Data Documentation

template<class T>
FCDEntityList FCDLibrary< T >::entities [protected]
 

Entities list.

This list should contain all the root entities of the correct type. Note that the following entity types are tree-based, rather than list-based: FCDAnimation, FCDSceneNode and FCDPhysicsSceneNode.


The documentation for this class was generated from the following files:
Generated on Fri May 12 16:44:43 2006 for FCollada by  doxygen 1.4.6-NO