- Cal3D 0.11 API Reference -

Public Member Functions | List of all members
CalCoreModel Class Reference

Public Member Functions

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

Constructor & Destructor Documentation

CalCoreModel::CalCoreModel ( const std::string &  name)

Constructs the core model instance.

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

CalCoreModel::~CalCoreModel ( )

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
strAnimationNameThe string that will be associated with the ID.
coreAnimationIdThe 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
strBoneNameThe string that will be associated with the ID.
boneIdThe 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
pCoreAnimationA pointer to the core animation that should be added.
Returns
  • the assigned animation ID of the added core animation
int CalCoreModel::addCoreMaterial ( CalCoreMaterial pCoreMaterial)

Adds a core material.

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

Parameters
pCoreMaterialA 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
pCoreMeshA 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
pCoreMorphAnimationA 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
strMaterialNameThe string that will be associated with the ID.
coreMaterialIdThe 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
strMeshNameThe string that will be associated with the ID.
coreMeshIdThe core ID number of the mesh to be referenced by the string.
bool CalCoreModel::createCoreMaterialThread ( int  coreMaterialThreadId)

Creates a core material thread.

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

Parameters
coreMaterialThreadIdThe ID of the core material thread that should be created.
Returns
One of the following values:
  • true if successful
  • false if an error happend
int CalCoreModel::getBoneId ( const std::string &  strBoneName)

Retrieves the ID of the bone referenced by a string.

This function returns a bone ID

Parameters
strBoneNameA 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
coreAnimationIdThe 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
strAnimationNameA 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
coreMaterialIdThe 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 ( 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
coreMaterialThreadIdThe ID of the core material thread.
coreMaterialSetIdThe ID of the core material set.
Returns
One of the following values:
  • the ID of the core material
  • -1 if an error happend
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
strMaterialNameA 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
CalCoreMesh * CalCoreModel::getCoreMesh ( int  coreMeshId)

Provides access to a core mesh.

This function returns the core mesh with the given ID.

Parameters
coreMeshIdThe 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
strMeshNameA 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
coreMorphAnimationIdThe 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)

Loads a core animation.

This function loads a core animation from a file.

Parameters
strFilenameThe 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::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
strFilenameThe file from which the core animation should be loaded from.
strAnimationNameA 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::loadCoreMaterial ( const std::string &  strFilename)

Loads a core material.

This function loads a core material from a file.

Parameters
strFilenameThe 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::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
strFilenameThe file from which the core material should be loaded from.
strMaterialNameA 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::loadCoreMesh ( const std::string &  strFilename)

Loads a core mesh.

This function loads a core mesh from a file.

Parameters
strFilenameThe 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
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
strFilenameThe file from which the core mesh should be loaded from.
strMeshNameA 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
bool CalCoreModel::loadCoreSkeleton ( const std::string &  strFilename)

Loads the core skeleton.

This function loads the core skeleton from a file.

Parameters
strFilenameThe 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
strFilenameThe file to which the core animation should be saved to.
coreAnimationIdThe 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
strFilenameThe file to which the core material should be saved to.
coreMaterialIdThe 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
strFilenameThe file to which the core mesh should be saved to.
coreMeshIdThe 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
strFilenameThe 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
factorA 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
coreMaterialThreadIdThe ID of the core material thread.
coreMaterialSetIdThe ID of the core maetrial set.
coreMaterialIdThe 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
pCoreSkeletonThe 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
userDataThe user data that should be stored.
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
nameThe 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::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
coreAnimationIdThe 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::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
nameThe 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::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
coreMaterialIdThe 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::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
nameThe 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
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
coreMeshIdThe 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

The documentation for this class was generated from the following files:

Generated at Wed Nov 26 2014 05:33:20 by The Cal3D Team with Doxygen 1.8.7