- Cal3D 0.11 API Reference -

coremodel.h
1//****************************************************************************//
2// coremodel.h //
3// Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger //
4//****************************************************************************//
5// This library is free software; you can redistribute it and/or modify it //
6// under the terms of the GNU Lesser General Public License as published by //
7// the Free Software Foundation; either version 2.1 of the License, or (at //
8// your option) any later version. //
9//****************************************************************************//
10
11#ifndef CAL_COREMODEL_H
12#define CAL_COREMODEL_H
13
14
15#include "cal3d/coreanimation.h"
16#include "cal3d/corematerial.h"
17#include "cal3d/coremesh.h"
18#include "cal3d/coreskeleton.h"
19#include "cal3d/global.h"
20
21
22 class CalCoreMorphAnimation;
23
24
25 class CAL3D_API CalCoreModel
26{
27 public:
28 CalCoreModel(const std::string& name);
29 ~CalCoreModel();
30
31 Cal::UserData getUserData();
32 void setUserData(Cal::UserData userData);
33
34 void scale(float factor);
35
36 // animations
37 int addCoreAnimation(CalCoreAnimation *pCoreAnimation);
38 CalCoreAnimation *getCoreAnimation(int coreAnimationId);
39 int getCoreAnimationCount();
40 int loadCoreAnimation(const std::string& strFilename);
41 int loadCoreAnimation(const std::string& strFilename, const std::string& strAnimationName);
42 int unloadCoreAnimation(const std::string& name);
43 int unloadCoreAnimation(int coreAnimationId);
44 bool saveCoreAnimation(const std::string& strFilename, int coreAnimationId);
45 bool addAnimationName(const std::string& strAnimationName, int coreAnimationId);
46 int getCoreAnimationId(const std::string& strAnimationName);
47
48 // morph animations
49 int addCoreMorphAnimation(CalCoreMorphAnimation *pCoreMorphAnimation);
50 CalCoreMorphAnimation *getCoreMorphAnimation(int coreMorphAnimationId);
51 int getCoreMorphAnimationCount();
52
53 // materials
54 int addCoreMaterial(CalCoreMaterial *pCoreMaterial);
55 bool createCoreMaterialThread(int coreMaterialThreadId);
56 CalCoreMaterial *getCoreMaterial(int coreMaterialId);
57 int getCoreMaterialCount();
58 int getCoreMaterialId(int coreMaterialThreadId, int coreMaterialSetId);
59 int loadCoreMaterial(const std::string& strFilename);
60 int loadCoreMaterial(const std::string& strFilename, const std::string& strMaterialName);
61 int unloadCoreMaterial(const std::string& name);
62 int unloadCoreMaterial(int coreMaterialId);
63 bool saveCoreMaterial(const std::string& strFilename, int coreMaterialId);
64 bool setCoreMaterialId(int coreMaterialThreadId, int coreMaterialSetId, int coreMaterialId);
65 bool addMaterialName(const std::string& strMaterialName, int coreMaterialId);
66 int getCoreMaterialId(const std::string& strMaterialName);
67
68 // meshes
69 int addCoreMesh(CalCoreMesh *pCoreMesh);
70 CalCoreMesh *getCoreMesh(int coreMeshId);
71 int getCoreMeshCount();
72 int loadCoreMesh(const std::string& strFilename);
73 int loadCoreMesh(const std::string& strFilename, const std::string& strMeshName);
74 int unloadCoreMesh(const std::string& name);
75 int unloadCoreMesh(int coreMeshId);
76 bool saveCoreMesh(const std::string& strFilename, int coreMeshId);
77 bool addMeshName(const std::string& strMeshName, int coreMeshId);
78 int getCoreMeshId(const std::string& strMeshName);
79
80 // skeleton
81 CalCoreSkeleton *getCoreSkeleton();
82 bool loadCoreSkeleton(const std::string& strFilename);
83 bool saveCoreSkeleton(const std::string& strFilename);
84 void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton);
85 void addBoneName(const std::string& strBoneName, int boneId);
86 int getBoneId(const std::string& strBoneName);
87
88// member variables
89 private:
90 std::string m_strName;
91 CalCoreSkeletonPtr m_pCoreSkeleton;
92 std::vector<CalCoreAnimationPtr> m_vectorCoreAnimation;
93 std::vector<CalCoreMorphAnimation *> m_vectorCoreMorphAnimation;
94 std::vector<CalCoreMeshPtr> m_vectorCoreMesh;
95 std::vector<CalCoreMaterialPtr> m_vectorCoreMaterial;
96 std::map<int, std::map<int, int> > m_mapmapCoreMaterialThread;
97 Cal::UserData m_userData;
98 std::map<std::string, int> m_animationName;
99 std::map<std::string, int> m_materialName;
100 std::map<std::string, int> m_meshName;
101};
102
103#endif
104
105//****************************************************************************//
CalCoreAnimation
Definition coreanimation.h:23
CalCoreMaterial
Definition corematerial.h:21
CalCoreMesh
Definition coremesh.h:24
CalCoreModel::getCoreMeshCount
int getCoreMeshCount()
Returns the number of core meshes.
Definition coremodel.cpp:348
CalCoreModel::getCoreAnimation
CalCoreAnimation * getCoreAnimation(int coreAnimationId)
Provides access to a core animation.
Definition coremodel.cpp:177
CalCoreModel::getCoreMaterialId
int getCoreMaterialId(int coreMaterialThreadId, int coreMaterialSetId)
Returns a specified core material ID.
Definition coremodel.cpp:291
CalCoreModel::addBoneName
void addBoneName(const std::string &strBoneName, int boneId)
Creates or overwrites a string-to-boneId mapping.
Definition coremodel.cpp:979
CalCoreModel::addCoreAnimation
int addCoreAnimation(CalCoreAnimation *pCoreAnimation)
Adds a core animation.
Definition coremodel.cpp:70
CalCoreModel::unloadCoreMesh
int unloadCoreMesh(const std::string &name)
Delete the resources used by the named core mesh.
Definition coremodel.cpp:737
CalCoreModel::getCoreMorphAnimation
CalCoreMorphAnimation * getCoreMorphAnimation(int coreMorphAnimationId)
Provides access to a core morph animation.
Definition coremodel.cpp:200
CalCoreModel::unloadCoreAnimation
int unloadCoreAnimation(const std::string &name)
Delete the resources used by the named core animation.
Definition coremodel.cpp:477
CalCoreModel::setCoreMaterialId
bool setCoreMaterialId(int coreMaterialThreadId, int coreMaterialSetId, int coreMaterialId)
Sets a core material ID.
Definition coremodel.cpp:916
CalCoreModel::loadCoreSkeleton
bool loadCoreSkeleton(const std::string &strFilename)
Loads the core skeleton.
Definition coremodel.cpp:786
CalCoreModel::addCoreMorphAnimation
int addCoreMorphAnimation(CalCoreMorphAnimation *pCoreMorphAnimation)
Adds a core morph animation.
Definition coremodel.cpp:90
CalCoreModel::saveCoreMesh
bool saveCoreMesh(const std::string &strFilename, int coreMeshId)
Saves a core mesh.
Definition coremodel.cpp:863
CalCoreModel::setCoreSkeleton
void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton)
Sets the core skeleton.
Definition coremodel.cpp:947
CalCoreModel::CalCoreModel
CalCoreModel(const std::string &name)
Constructs the core model instance.
Definition coremodel.cpp:35
CalCoreModel::saveCoreMaterial
bool saveCoreMaterial(const std::string &strFilename, int coreMaterialId)
Saves a core material.
Definition coremodel.cpp:837
CalCoreModel::getUserData
Cal::UserData getUserData()
Provides access to the user data.
Definition coremodel.cpp:376
CalCoreModel::scale
void scale(float factor)
Scale the core model.
Definition coremodel.cpp:1180
CalCoreModel::saveCoreAnimation
bool saveCoreAnimation(const std::string &strFilename, int coreAnimationId)
Saves a core animation.
Definition coremodel.cpp:806
CalCoreModel::loadCoreMaterial
int loadCoreMaterial(const std::string &strFilename)
Loads a core material.
Definition coremodel.cpp:525
CalCoreModel::getCoreMorphAnimationCount
int getCoreMorphAnimationCount()
Returns the number of core morph animations.
Definition coremodel.cpp:234
CalCoreModel::loadCoreMesh
int loadCoreMesh(const std::string &strFilename)
Loads a core mesh.
Definition coremodel.cpp:654
CalCoreModel::unloadCoreMaterial
int unloadCoreMaterial(const std::string &name)
Delete the resources used by the named core material.
Definition coremodel.cpp:607
CalCoreModel::getCoreMesh
CalCoreMesh * getCoreMesh(int coreMeshId)
Provides access to a core mesh.
Definition coremodel.cpp:329
CalCoreModel::addMaterialName
bool addMaterialName(const std::string &strMaterialName, int coreMaterialId)
Creates or overwrites a string-to-core-material ID mapping.
Definition coremodel.cpp:1075
CalCoreModel::saveCoreSkeleton
bool saveCoreSkeleton(const std::string &strFilename)
Saves the core skeleton.
Definition coremodel.cpp:888
CalCoreModel::addCoreMaterial
int addCoreMaterial(CalCoreMaterial *pCoreMaterial)
Adds a core material.
Definition coremodel.cpp:113
CalCoreModel::getCoreAnimationId
int getCoreAnimationId(const std::string &strAnimationName)
Retrieves the ID of the animation referenced by a string.
Definition coremodel.cpp:1047
CalCoreModel::getCoreMaterial
CalCoreMaterial * getCoreMaterial(int coreMaterialId)
Provides access to a core material.
Definition coremodel.cpp:252
CalCoreModel::getCoreMaterialCount
int getCoreMaterialCount()
Returns the number of core materials.
Definition coremodel.cpp:272
CalCoreModel::addAnimationName
bool addAnimationName(const std::string &strAnimationName, int coreAnimationId)
Creates or overwrites a string-to-animation ID mapping.
Definition coremodel.cpp:1022
CalCoreModel::getCoreAnimationCount
int getCoreAnimationCount()
Returns the number of core animations.
Definition coremodel.cpp:220
CalCoreModel::getCoreSkeleton
CalCoreSkeleton * getCoreSkeleton()
Provides access to the core skeleton.
Definition coremodel.cpp:363
CalCoreModel::createCoreMaterialThread
bool createCoreMaterialThread(int coreMaterialThreadId)
Creates a core material thread.
Definition coremodel.cpp:156
CalCoreModel::loadCoreAnimation
int loadCoreAnimation(const std::string &strFilename)
Loads a core animation.
Definition coremodel.cpp:394
CalCoreModel::getBoneId
int getBoneId(const std::string &strBoneName)
Retrieves the ID of the bone referenced by a string.
Definition coremodel.cpp:1000
CalCoreModel::getCoreMeshId
int getCoreMeshId(const std::string &strMeshName)
Retrieves the ID of the core mesh referenced by a string.
Definition coremodel.cpp:1155
CalCoreModel::addMeshName
bool addMeshName(const std::string &strMeshName, int coreMeshId)
Creates or overwrites a string-to-core-mesh ID mapping.
Definition coremodel.cpp:1130
CalCoreModel::setUserData
void setUserData(Cal::UserData userData)
Stores user data.
Definition coremodel.cpp:965
CalCoreModel::addCoreMesh
int addCoreMesh(CalCoreMesh *pCoreMesh)
Adds a core mesh.
Definition coremodel.cpp:135
CalCoreMorphAnimation
Definition coremorphanimation.h:17
CalCoreSkeleton
Definition coreskeleton.h:24

Generated by The Cal3D Team with Doxygen 1.15.0