- 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
23
24
25class CAL3D_API CalCoreModel
26{
27public:
28 CalCoreModel(const std::string& name);
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);
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);
52
53 // materials
54 int addCoreMaterial(CalCoreMaterial *pCoreMaterial);
55 bool createCoreMaterialThread(int coreMaterialThreadId);
56 CalCoreMaterial *getCoreMaterial(int coreMaterialId);
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
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
89private:
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//****************************************************************************//
Definition coreanimation.h:23
Definition corematerial.h:21
Definition coremesh.h:24
int getCoreMeshCount()
Returns the number of core meshes.
Definition coremodel.cpp:348
CalCoreAnimation * getCoreAnimation(int coreAnimationId)
Provides access to a core animation.
Definition coremodel.cpp:177
int getCoreMaterialId(int coreMaterialThreadId, int coreMaterialSetId)
Returns a specified core material ID.
Definition coremodel.cpp:291
void addBoneName(const std::string &strBoneName, int boneId)
Creates or overwrites a string-to-boneId mapping.
Definition coremodel.cpp:979
int addCoreAnimation(CalCoreAnimation *pCoreAnimation)
Adds a core animation.
Definition coremodel.cpp:70
int unloadCoreMesh(const std::string &name)
Delete the resources used by the named core mesh.
Definition coremodel.cpp:737
CalCoreMorphAnimation * getCoreMorphAnimation(int coreMorphAnimationId)
Provides access to a core morph animation.
Definition coremodel.cpp:200
int unloadCoreAnimation(const std::string &name)
Delete the resources used by the named core animation.
Definition coremodel.cpp:477
bool setCoreMaterialId(int coreMaterialThreadId, int coreMaterialSetId, int coreMaterialId)
Sets a core material ID.
Definition coremodel.cpp:916
bool loadCoreSkeleton(const std::string &strFilename)
Loads the core skeleton.
Definition coremodel.cpp:786
int addCoreMorphAnimation(CalCoreMorphAnimation *pCoreMorphAnimation)
Adds a core morph animation.
Definition coremodel.cpp:90
bool saveCoreMesh(const std::string &strFilename, int coreMeshId)
Saves a core mesh.
Definition coremodel.cpp:863
void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton)
Sets the core skeleton.
Definition coremodel.cpp:947
CalCoreModel(const std::string &name)
Constructs the core model instance.
Definition coremodel.cpp:35
bool saveCoreMaterial(const std::string &strFilename, int coreMaterialId)
Saves a core material.
Definition coremodel.cpp:837
Cal::UserData getUserData()
Provides access to the user data.
Definition coremodel.cpp:376
void scale(float factor)
Scale the core model.
Definition coremodel.cpp:1180
bool saveCoreAnimation(const std::string &strFilename, int coreAnimationId)
Saves a core animation.
Definition coremodel.cpp:806
int loadCoreMaterial(const std::string &strFilename)
Loads a core material.
Definition coremodel.cpp:525
int getCoreMorphAnimationCount()
Returns the number of core morph animations.
Definition coremodel.cpp:234
int loadCoreMesh(const std::string &strFilename)
Loads a core mesh.
Definition coremodel.cpp:654
int unloadCoreMaterial(const std::string &name)
Delete the resources used by the named core material.
Definition coremodel.cpp:607
CalCoreMesh * getCoreMesh(int coreMeshId)
Provides access to a core mesh.
Definition coremodel.cpp:329
bool addMaterialName(const std::string &strMaterialName, int coreMaterialId)
Creates or overwrites a string-to-core-material ID mapping.
Definition coremodel.cpp:1075
bool saveCoreSkeleton(const std::string &strFilename)
Saves the core skeleton.
Definition coremodel.cpp:888
int addCoreMaterial(CalCoreMaterial *pCoreMaterial)
Adds a core material.
Definition coremodel.cpp:113
int getCoreAnimationId(const std::string &strAnimationName)
Retrieves the ID of the animation referenced by a string.
Definition coremodel.cpp:1047
CalCoreMaterial * getCoreMaterial(int coreMaterialId)
Provides access to a core material.
Definition coremodel.cpp:252
int getCoreMaterialCount()
Returns the number of core materials.
Definition coremodel.cpp:272
bool addAnimationName(const std::string &strAnimationName, int coreAnimationId)
Creates or overwrites a string-to-animation ID mapping.
Definition coremodel.cpp:1022
int getCoreAnimationCount()
Returns the number of core animations.
Definition coremodel.cpp:220
CalCoreSkeleton * getCoreSkeleton()
Provides access to the core skeleton.
Definition coremodel.cpp:363
bool createCoreMaterialThread(int coreMaterialThreadId)
Creates a core material thread.
Definition coremodel.cpp:156
int loadCoreAnimation(const std::string &strFilename)
Loads a core animation.
Definition coremodel.cpp:394
int getBoneId(const std::string &strBoneName)
Retrieves the ID of the bone referenced by a string.
Definition coremodel.cpp:1000
int getCoreMeshId(const std::string &strMeshName)
Retrieves the ID of the core mesh referenced by a string.
Definition coremodel.cpp:1155
bool addMeshName(const std::string &strMeshName, int coreMeshId)
Creates or overwrites a string-to-core-mesh ID mapping.
Definition coremodel.cpp:1130
void setUserData(Cal::UserData userData)
Stores user data.
Definition coremodel.cpp:965
int addCoreMesh(CalCoreMesh *pCoreMesh)
Adds a core mesh.
Definition coremodel.cpp:135
Definition coremorphanimation.h:17
Definition coreskeleton.h:24

Generated by The Cal3D Team with Doxygen 1.15.0