00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_COREMODEL_H
00012 #define CAL_COREMODEL_H
00013
00014
00015 #include "cal3d/coreanimation.h"
00016 #include "cal3d/corematerial.h"
00017 #include "cal3d/coremesh.h"
00018 #include "cal3d/coreskeleton.h"
00019 #include "cal3d/global.h"
00020
00021
00022 class CalCoreMorphAnimation;
00023
00024
00025 class CAL3D_API CalCoreModel
00026 {
00027 public:
00028 CalCoreModel(const std::string& name);
00029 ~CalCoreModel();
00030
00031 Cal::UserData getUserData();
00032 void setUserData(Cal::UserData userData);
00033
00034 void scale(float factor);
00035
00036
00037 int addCoreAnimation(CalCoreAnimation *pCoreAnimation);
00038 CalCoreAnimation *getCoreAnimation(int coreAnimationId);
00039 int getCoreAnimationCount();
00040 int loadCoreAnimation(const std::string& strFilename);
00041 int loadCoreAnimation(const std::string& strFilename, const std::string& strAnimationName);
00042 int unloadCoreAnimation(const std::string& name);
00043 int unloadCoreAnimation(int coreAnimationId);
00044 bool saveCoreAnimation(const std::string& strFilename, int coreAnimationId);
00045 bool addAnimationName(const std::string& strAnimationName, int coreAnimationId);
00046 int getCoreAnimationId(const std::string& strAnimationName);
00047
00048
00049 int addCoreMorphAnimation(CalCoreMorphAnimation *pCoreMorphAnimation);
00050 CalCoreMorphAnimation *getCoreMorphAnimation(int coreMorphAnimationId);
00051 int getCoreMorphAnimationCount();
00052
00053
00054 int addCoreMaterial(CalCoreMaterial *pCoreMaterial);
00055 bool createCoreMaterialThread(int coreMaterialThreadId);
00056 CalCoreMaterial *getCoreMaterial(int coreMaterialId);
00057 int getCoreMaterialCount();
00058 int getCoreMaterialId(int coreMaterialThreadId, int coreMaterialSetId);
00059 int loadCoreMaterial(const std::string& strFilename);
00060 int loadCoreMaterial(const std::string& strFilename, const std::string& strMaterialName);
00061 int unloadCoreMaterial(const std::string& name);
00062 int unloadCoreMaterial(int coreMaterialId);
00063 bool saveCoreMaterial(const std::string& strFilename, int coreMaterialId);
00064 bool setCoreMaterialId(int coreMaterialThreadId, int coreMaterialSetId, int coreMaterialId);
00065 bool addMaterialName(const std::string& strMaterialName, int coreMaterialId);
00066 int getCoreMaterialId(const std::string& strMaterialName);
00067
00068
00069 int addCoreMesh(CalCoreMesh *pCoreMesh);
00070 CalCoreMesh *getCoreMesh(int coreMeshId);
00071 int getCoreMeshCount();
00072 int loadCoreMesh(const std::string& strFilename);
00073 int loadCoreMesh(const std::string& strFilename, const std::string& strMeshName);
00074 int unloadCoreMesh(const std::string& name);
00075 int unloadCoreMesh(int coreMeshId);
00076 bool saveCoreMesh(const std::string& strFilename, int coreMeshId);
00077 bool addMeshName(const std::string& strMeshName, int coreMeshId);
00078 int getCoreMeshId(const std::string& strMeshName);
00079
00080
00081 CalCoreSkeleton *getCoreSkeleton();
00082 bool loadCoreSkeleton(const std::string& strFilename);
00083 bool saveCoreSkeleton(const std::string& strFilename);
00084 void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton);
00085 void addBoneName(const std::string& strBoneName, int boneId);
00086 int getBoneId(const std::string& strBoneName);
00087
00088
00089 private:
00090 std::string m_strName;
00091 CalCoreSkeletonPtr m_pCoreSkeleton;
00092 std::vector<CalCoreAnimationPtr> m_vectorCoreAnimation;
00093 std::vector<CalCoreMorphAnimation *> m_vectorCoreMorphAnimation;
00094 std::vector<CalCoreMeshPtr> m_vectorCoreMesh;
00095 std::vector<CalCoreMaterialPtr> m_vectorCoreMaterial;
00096 std::map<int, std::map<int, int> > m_mapmapCoreMaterialThread;
00097 Cal::UserData m_userData;
00098 std::map<std::string, int> m_animationName;
00099 std::map<std::string, int> m_materialName;
00100 std::map<std::string, int> m_meshName;
00101 };
00102
00103 #endif
00104
00105