- Cal3D 0.9 API Reference -

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

CalCoreModel Class Reference

The core model class. More...

#include <coremodel.h>

List of all members.

Public Member Functions

 CalCoreModel ()
 Constructs the core model instance.
virtual ~CalCoreModel ()
 Destructs the core model instance.
bool create (const std::string &strName)
 Creates the core model instance.
void destroy ()
 Destroys the core model instance.
Cal::UserData getUserData ()
 Provides access to the user data.
void setUserData (Cal::UserData userData)
 Stores user data.
void scale (float factor)
 Scale the core model.
int addCoreAnimation (CalCoreAnimation *pCoreAnimation)
 Adds a core animation.
CalCoreAnimationgetCoreAnimation (int coreAnimationId)
 Provides access to a core animation.
int getCoreAnimationCount ()
 Returns the number of core animations.
int loadCoreAnimation (const std::string &strFilename)
 Loads a core animation.
int loadCoreAnimation (const std::string &strFilename, const std::string &strAnimationName)
 Loads a core animation and bind it to a name.
int unloadCoreAnimation (const std::string &name)
 Delete the resources used by the named core animation.
int unloadCoreAnimation (int coreAnimationId)
 Delete the resources used by a core animation.
bool saveCoreAnimation (const std::string &strFilename, int coreAnimationId)
 Saves a core animation.
bool addAnimationName (const std::string &strAnimationName, int coreAnimationId)
 Creates or overwrites a string-to-animation ID mapping.
int getCoreAnimationId (const std::string &strAnimationName)
 Retrieves the ID of the animation referenced by a string.
int addCoreMorphAnimation (CalCoreMorphAnimation *pCoreMorphAnimation)
 Adds a core morph animation.
CalCoreMorphAnimationgetCoreMorphAnimation (int coreMorphAnimationId)
 Provides access to a core morph animation.
int getCoreMorphAnimationCount ()
 Returns the number of core morph animations.
int addCoreMaterial (CalCoreMaterial *pCoreMaterial)
 Adds a core material.
bool createCoreMaterialThread (int coreMaterialThreadId)
 Creates a core material thread.
CalCoreMaterialgetCoreMaterial (int coreMaterialId)
 Provides access to a core material.
int getCoreMaterialCount ()
 Returns the number of core materials.
int getCoreMaterialId (int coreMaterialThreadId, int coreMaterialSetId)
 Returns a specified core material ID.
int loadCoreMaterial (const std::string &strFilename)
 Loads a core material.
int loadCoreMaterial (const std::string &strFilename, const std::string &strMaterialName)
 Loads a core material and bind it to a name.
int unloadCoreMaterial (const std::string &name)
 Delete the resources used by the named core material.
int unloadCoreMaterial (int coreMaterialId)
 Delete the resources used by a core material.
bool saveCoreMaterial (const std::string &strFilename, int coreMaterialId)
 Saves a core material.
bool setCoreMaterialId (int coreMaterialThreadId, int coreMaterialSetId, int coreMaterialId)
 Sets a core material ID.
bool addMaterialName (const std::string &strMaterialName, int coreMaterialId)
 Creates or overwrites a string-to-core-material ID mapping.
int getCoreMaterialId (const std::string &strMaterialName)
 Retrieves the ID of the core material referenced by a string.
int addCoreMesh (CalCoreMesh *pCoreMesh)
 Adds a core mesh.
CalCoreMeshgetCoreMesh (int coreMeshId)
 Provides access to a core mesh.
int getCoreMeshCount ()
 Returns the number of core meshes.
int loadCoreMesh (const std::string &strFilename)
 Loads a core mesh.
int loadCoreMesh (const std::string &strFilename, const std::string &strMeshName)
 Loads a core mesh and bind it to a name.
int unloadCoreMesh (const std::string &name)
 Delete the resources used by the named core mesh.
int unloadCoreMesh (int coreMeshId)
 Delete the resources used by a core mesh.
bool saveCoreMesh (const std::string &strFilename, int coreMeshId)
 Saves a core mesh.
bool addMeshName (const std::string &strMeshName, int coreMeshId)
 Creates or overwrites a string-to-core-mesh ID mapping.
int getCoreMeshId (const std::string &strMeshName)
 Retrieves the ID of the core mesh referenced by a string.
CalCoreSkeletongetCoreSkeleton ()
 Provides access to the core skeleton.
bool loadCoreSkeleton (const std::string &strFilename)
 Loads the core skeleton.
bool saveCoreSkeleton (const std::string &strFilename)
 Saves the core skeleton.
void setCoreSkeleton (CalCoreSkeleton *pCoreSkeleton)
 Sets the core skeleton.
void addBoneName (const std::string &strBoneName, int boneId)
 Creates or overwrites a string-to-boneId mapping.
int getBoneId (const std::string &strBoneName)
 Retrieves the ID of the bone referenced by a string.


Detailed Description

The core model class.


Constructor & Destructor Documentation

CalCoreModel::CalCoreModel  ) 
 

Constructs the core model instance.

This function is the default constructor of the core model instance.

CalCoreModel::~CalCoreModel  )  [virtual]
 

Destructs the core model instance.

This function is the destructor of the core model instance.


Member Function Documentation

bool CalCoreModel::addAnimationName const std::string &  strAnimationName,
int  coreAnimationId
 

Creates or overwrites a string-to-animation ID mapping.

This function makes an animation ID reference-able by a string name. Note that we don't verify that the ID is valid because the animation may be added later. Also, if there is already a helper with this name, it will be overwritten without warning.

Parameters:
strAnimationName The string that will be associated with the ID.
coreAnimationId The ID number of the animation to be referenced by the string.

void CalCoreModel::addBoneName const std::string &  strBoneName,
int  boneId
 

Creates or overwrites a string-to-boneId mapping.

This function makes a bone ID reference-able by a string name.

Parameters:
strBoneName The string that will be associated with the ID.
boneId The ID number of the bone that will be referenced by the string.

int CalCoreModel::addCoreAnimation CalCoreAnimation pCoreAnimation  ) 
 

Adds a core animation.

This function adds a core animation to the core model instance.

Parameters:
pCoreAnimation A pointer to the core animation that should be added.
Returns:
One of the following values:
  • the assigned animation ID of the added core animation
  • -1 if an error happend

int CalCoreModel::addCoreMaterial CalCoreMaterial pCoreMaterial  ) 
 

Adds a core material.

This function adds a core material to the core model instance.

Parameters:
pCoreMaterial A pointer to the core material that should be added.
Returns:
One of the following values:
  • the assigned material ID of the added core material
  • -1 if an error happend

int CalCoreModel::addCoreMesh CalCoreMesh pCoreMesh  ) 
 

Adds a core mesh.

This function adds a core mesh to the core model instance.

Parameters:
pCoreMesh A pointer to the core mesh that should be added.
Returns:
One of the following values:
  • the assigned mesh ID of the added core material
  • -1 if an error happend

int CalCoreModel::addCoreMorphAnimation CalCoreMorphAnimation pCoreMorphAnimation  ) 
 

Adds a core morph animation.

This function adds a core morph animation to the core model instance.

Parameters:
pCoreMorphAnimation A pointer to the core morph animation that should be added.
Returns:
One of the following values:
  • the assigned morph animation ID of the added core morph animation
  • -1 if an error happend

bool CalCoreModel::addMaterialName const std::string &  strMaterialName,
int  coreMaterialId
 

Creates or overwrites a string-to-core-material ID mapping.

This function makes a core material ID reference-able by a string name. Note that we don't verify that the ID is valid because the material may be added later. Also, if there is already a helper with this name, it will be overwritten without warning.

Parameters:
strMaterialName The string that will be associated with the ID.
coreMaterialId The core ID number of the material to be referenced by the string.

bool CalCoreModel::addMeshName const std::string &  strMeshName,
int  coreMeshId
 

Creates or overwrites a string-to-core-mesh ID mapping.

This function makes a core mesh ID reference-able by a string name. Note that we don't verify that the ID is valid because the mesh may be added later. Also, if there is already a helper with this name, it will be overwritten without warning.

Parameters:
strMeshName The string that will be associated with the ID.
coreMeshId The core ID number of the mesh to be referenced by the string.

bool CalCoreModel::create const std::string &  strName  ) 
 

Creates the core model instance.

This function creates the core model instance.

Parameters:
strName A string that should be used as the name of the core model instance.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

bool CalCoreModel::createCoreMaterialThread int  coreMaterialThreadId  ) 
 

Creates a core material thread.

This function creates a new core material thread with the given ID.

Parameters:
coreMaterialThreadId The ID of the core material thread that should be created.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

void CalCoreModel::destroy  ) 
 

Destroys the core model instance.

This function destroys all data stored in the core model instance and frees all allocated memory.

int CalCoreModel::getBoneId const std::string &  strBoneName  ) 
 

Retrieves the ID of the bone referenced by a string.

This function returns a bone ID

Parameters:
strBoneName A string that is associated with a bone ID number.
Returns:
Returns:
  • -1 if there is no bone ID associated with the input string
  • the ID number of the bone asssociated with the input string

CalCoreAnimation * CalCoreModel::getCoreAnimation int  coreAnimationId  ) 
 

Provides access to a core animation.

This function returns the core animation with the given ID.

Parameters:
coreAnimationId The ID of the core animation that should be returned.
Returns:
One of the following values:
  • a pointer to the core animation
  • 0 if an error happend

int CalCoreModel::getCoreAnimationCount  ) 
 

Returns the number of core animations.

This function returns the number of core animations in the core model instance.

Returns:
The number of core animations.

int CalCoreModel::getCoreAnimationId const std::string &  strAnimationName  ) 
 

Retrieves the ID of the animation referenced by a string.

This function returns an animation ID

Parameters:
strAnimationName A string that is associated with an anim ID number.
Returns:
Returns:
  • -1 if there is no anim ID associated with the input string
  • the ID number of the anim asssociated with the input string

CalCoreMaterial * CalCoreModel::getCoreMaterial int  coreMaterialId  ) 
 

Provides access to a core material.

This function returns the core material with the given ID.

Parameters:
coreMaterialId The ID of the core material that should be returned.
Returns:
One of the following values:
  • a pointer to the core material
  • 0 if an error happend

int CalCoreModel::getCoreMaterialCount  ) 
 

Returns the number of core materials.

This function returns the number of core materials in the core model instance.

Returns:
The number of core materials.

int CalCoreModel::getCoreMaterialId const std::string &  strMaterialName  ) 
 

Retrieves the ID of the core material referenced by a string.

This function returns a core material ID

Parameters:
strMaterialName A string that is associated with a core material ID number.
Returns:
Returns:
  • -1 if there is no core material ID associated with the input string
  • the core ID number of the material asssociated with the input string

int CalCoreModel::getCoreMaterialId int  coreMaterialThreadId,
int  coreMaterialSetId
 

Returns a specified core material ID.

This function returns the core material ID for a specified core material thread / core material set pair.

Parameters:
coreMaterialThreadId The ID of the core material thread.
coreMaterialSetId The ID of the core material set.
Returns:
One of the following values:
  • the ID of the core material
  • -1 if an error happend

CalCoreMesh * CalCoreModel::getCoreMesh int  coreMeshId  ) 
 

Provides access to a core mesh.

This function returns the core mesh with the given ID.

Parameters:
coreMeshId The ID of the core mesh that should be returned.
Returns:
One of the following values:
  • a pointer to the core mesh
  • 0 if an error happend

int CalCoreModel::getCoreMeshCount  ) 
 

Returns the number of core meshes.

This function returns the number of core meshes in the core model instance.

Returns:
The number of core meshes.

int CalCoreModel::getCoreMeshId const std::string &  strMeshName  ) 
 

Retrieves the ID of the core mesh referenced by a string.

This function returns a core mesh ID

Parameters:
strMeshName A string that is associated with a core mesh ID number.
Returns:
Returns:
  • -1 if there is no core mesh ID associated with the input string
  • the core ID number of the mesh asssociated with the input string

CalCoreMorphAnimation * CalCoreModel::getCoreMorphAnimation int  coreMorphAnimationId  ) 
 

Provides access to a core morph animation.

This function returns the core morph animation with the given ID.

Parameters:
coreMorphAnimationId The ID of the core morph animation that should be returned.
Returns:
One of the following values:
  • a pointer to the core morph animation
  • 0 if an error happend

int CalCoreModel::getCoreMorphAnimationCount  ) 
 

Returns the number of core morph animations.

This function returns the number of core morph animations in the core model instance.

Returns:
The number of core morph animations.

CalCoreSkeleton * CalCoreModel::getCoreSkeleton  ) 
 

Provides access to the core skeleton.

This function returns the core skeleton.

Returns:
One of the following values:
  • a pointer to the core skeleton
  • 0 if an error happend

Cal::UserData CalCoreModel::getUserData  ) 
 

Provides access to the user data.

This function returns the user data stored in the core model instance.

Returns:
The user data stored in the core model instance.

int CalCoreModel::loadCoreAnimation const std::string &  strFilename,
const std::string &  strAnimationName
 

Loads a core animation and bind it to a name.

This function loads a core animation from a file. It is equivalent to calling addAnimName(strAnimationName, loadCoreAnimation(strFilename)). If strAnimationName is already associated to a coreAnimationId because of a previous call to addAnimName, the same coreAnimationId will be used.

Parameters:
strFilename The file from which the core animation should be loaded from.
strAnimationName A string that is associated with an anim ID number.
Returns:
One of the following values:
  • the assigned ID of the loaded core animation
  • -1 if an error happend

int CalCoreModel::loadCoreAnimation const std::string &  strFilename  ) 
 

Loads a core animation.

This function loads a core animation from a file.

Parameters:
strFilename The file from which the core animation should be loaded from.
Returns:
One of the following values:
  • the assigned ID of the loaded core animation
  • -1 if an error happend

int CalCoreModel::loadCoreMaterial const std::string &  strFilename,
const std::string &  strMaterialName
 

Loads a core material and bind it to a name.

This function loads a core material from a file. It is equivalent to calling addMaterialName(strMaterialName, loadCoreMaterial(strFilename)). If strMaterialName is already associated to a coreMaterialId because of a previous call to addMaterialName, the same coreMaterialId will be used.

Parameters:
strFilename The file from which the core material should be loaded from.
strMaterialName A string that is associated with an anim ID number.
Returns:
One of the following values:
  • the assigned ID of the loaded core material
  • -1 if an error happend

int CalCoreModel::loadCoreMaterial const std::string &  strFilename  ) 
 

Loads a core material.

This function loads a core material from a file.

Parameters:
strFilename The file from which the core material should be loaded from.
Returns:
One of the following values:
  • the assigned ID of the loaded core material
  • -1 if an error happend

int CalCoreModel::loadCoreMesh const std::string &  strFilename,
const std::string &  strMeshName
 

Loads a core mesh and bind it to a name.

This function loads a core mesh from a file. It is equivalent to calling addMeshName(strMeshName, loadCoreMesh(strFilename)). If strMeshName is already associated to a coreMeshId because of a previous call to addMeshName, the same coreMeshId will be used.

Parameters:
strFilename The file from which the core mesh should be loaded from.
strMeshName A string that is associated with an anim ID number.
Returns:
One of the following values:
  • the assigned ID of the loaded core mesh
  • -1 if an error happend

int CalCoreModel::loadCoreMesh const std::string &  strFilename  ) 
 

Loads a core mesh.

This function loads a core mesh from a file.

Parameters:
strFilename The file from which the core mesh should be loaded from.
Returns:
One of the following values:
  • the assigned ID of the loaded core mesh
  • -1 if an error happend

bool CalCoreModel::loadCoreSkeleton const std::string &  strFilename  ) 
 

Loads the core skeleton.

This function loads the core skeleton from a file.

Parameters:
strFilename The file from which the core skeleton should be loaded from.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

bool CalCoreModel::saveCoreAnimation const std::string &  strFilename,
int  coreAnimationId
 

Saves a core animation.

This function saves a core animation to a file.

Parameters:
strFilename The file to which the core animation should be saved to.
coreAnimationId The ID of the core animation that should be saved.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

bool CalCoreModel::saveCoreMaterial const std::string &  strFilename,
int  coreMaterialId
 

Saves a core material.

This function saves a core material to a file.

Parameters:
strFilename The file to which the core material should be saved to.
coreMaterialId The ID of the core material that should be saved.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

bool CalCoreModel::saveCoreMesh const std::string &  strFilename,
int  coreMeshId
 

Saves a core mesh.

This function saves a core mesh to a file.

Parameters:
strFilename The file to which the core mesh should be saved to.
coreMeshId The ID of the core mesh that should be saved.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

bool CalCoreModel::saveCoreSkeleton const std::string &  strFilename  ) 
 

Saves the core skeleton.

This function saves the core skeleton to a file.

Parameters:
strFilename The file to which the core skeleton should be saved to.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

void CalCoreModel::scale float  factor  ) 
 

Scale the core model.

This function rescale all data that are in the core model instance

Parameters:
factor A float with the scale factor

bool CalCoreModel::setCoreMaterialId int  coreMaterialThreadId,
int  coreMaterialSetId,
int  coreMaterialId
 

Sets a core material ID.

This function sets a core material ID for a core material thread / core material set pair.

Parameters:
coreMaterialThreadId The ID of the core material thread.
coreMaterialSetId The ID of the core maetrial set.
coreMaterialId The ID of the core maetrial.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

void CalCoreModel::setCoreSkeleton CalCoreSkeleton pCoreSkeleton  ) 
 

Sets the core skeleton.

This function sets the core skeleton of the core model instance..

Parameters:
pCoreSkeleton The core skeleton that should be set.

void CalCoreModel::setUserData Cal::UserData  userData  ) 
 

Stores user data.

This function stores user data in the core model instance.

Parameters:
userData The user data that should be stored.

int CalCoreModel::unloadCoreAnimation int  coreAnimationId  ) 
 

Delete the resources used by a core animation.

The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.

Parameters:
coreAnimationId The ID of the core animation that should be unloaded.
Returns:
One of the following values:
  • the core ID of the unloaded core animation
  • -1 if an error happend

int CalCoreModel::unloadCoreAnimation const std::string &  name  ) 
 

Delete the resources used by the named core animation.

The name must be associated with a valid core animation Id with the function getAnimationId. The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.

Parameters:
name The symbolic name of the core animation to unload.
Returns:
One of the following values:
  • the core ID of the unloaded core animation
  • -1 if an error happend

int CalCoreModel::unloadCoreMaterial int  coreMaterialId  ) 
 

Delete the resources used by a core material.

The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.

Parameters:
coreMaterialId The ID of the core material that should be unloaded.
Returns:
One of the following values:
  • the core ID of the unloaded core material
  • -1 if an error happend

int CalCoreModel::unloadCoreMaterial const std::string &  name  ) 
 

Delete the resources used by the named core material.

The name must be associated with a valid core material Id with the function getMaterialId. The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.

Parameters:
name The symbolic name of the core material to unload.
Returns:
One of the following values:
  • the core ID of the unloaded core material
  • -1 if an error happend

int CalCoreModel::unloadCoreMesh int  coreMeshId  ) 
 

Delete the resources used by a core mesh.

The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.

Parameters:
coreMeshId The ID of the core mesh that should be unloaded.
Returns:
One of the following values:
  • the core ID of the unloaded core mesh
  • -1 if an error happend

int CalCoreModel::unloadCoreMesh const std::string &  name  ) 
 

Delete the resources used by the named core mesh.

The name must be associated with a valid core mesh Id with the function getMeshId. The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.

Parameters:
name The symbolic name of the core mesh to unload.
Returns:
One of the following values:
  • the core ID of the unloaded core mesh
  • -1 if an error happend


The documentation for this class was generated from the following files:
Generated at Thu Dec 2 20:28:10 2004 by The Cal3D Team with doxygen 1.3.9.1 © 1997-2001 Dimitri van Heesch