00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_COREMESH_H
00012 #define CAL_COREMESH_H
00013
00014
00015 #include "cal3d/global.h"
00016 #include "cal3d/refcounted.h"
00017 #include "cal3d/refptr.h"
00018
00019
00020 class CalCoreSubmesh;
00021
00022
00023 class CAL3D_API CalCoreMesh : public cal3d::RefCounted
00024 {
00025 protected:
00026 ~CalCoreMesh();
00027
00028 public:
00029 CalCoreMesh();
00030
00031 typedef std::vector<CalCoreSubmesh *> CalCoreSubmeshVector;
00032 unsigned int size();
00033 int addCoreSubmesh(CalCoreSubmesh *pCoreSubmesh);
00034 CalCoreSubmesh *getCoreSubmesh(int id);
00035 const CalCoreSubmesh *getCoreSubmesh(int id) const;
00036 void removeCoreSubmesh( int submeshID );
00037 int getCoreSubmeshCount() const;
00038 void reserve(int submeshes) { m_vectorCoreSubmesh.reserve(submeshes); }
00039 std::vector<CalCoreSubmesh *>& getVectorCoreSubmesh();
00040 const std::vector<CalCoreSubmesh *>& getVectorCoreSubmesh() const;
00042 int addAsMorphTarget(CalCoreMesh *pCoreMesh, std::string const & morphTargetName);
00044 int getMorphTargetId(std::string const & morphTargetName);
00046 inline bool hasMorphTargets(){return !m_morphTargets.empty();}
00047 void scale(float factor);
00048 void setFilename(const std::string& filename);
00049 const std::string& getFilename(void) const;
00050 void setName(const std::string& name);
00051 const std::string& getName(void) const;
00052
00053
00054 private:
00055 std::map<std::string,int> m_morphTargets;
00056 std::vector<CalCoreSubmesh *> m_vectorCoreSubmesh;
00057 std::string m_name;
00058 std::string m_filename;
00059 };
00060 typedef cal3d::RefPtr<CalCoreMesh> CalCoreMeshPtr;
00061
00062 #endif