IrrlichtEngine
IMeshCache.h
Go to the documentation of this file.
00001 // Copyright (C) 2002-2011 Nikolaus Gebhardt
00002 // This file is part of the "Irrlicht Engine".
00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
00004 
00005 #ifndef __I_MESH_CACHE_H_INCLUDED__
00006 #define __I_MESH_CACHE_H_INCLUDED__
00007 
00008 #include "IReferenceCounted.h"
00009 #include "path.h"
00010 
00011 namespace irr
00012 {
00013 
00014 namespace scene
00015 {
00016         class IMesh;
00017         class IAnimatedMesh;
00018         class IAnimatedMeshSceneNode;
00019         class IMeshLoader;
00020 
00022 
00027         class IMeshCache : public virtual IReferenceCounted
00028         {
00029         public:
00030 
00032                 virtual ~IMeshCache() {}
00033 
00035 
00050                 virtual void addMesh(const io::path& name, IAnimatedMesh* mesh) = 0;
00051 
00053 
00057                 virtual void removeMesh(const IMesh* const mesh) = 0;
00058 
00060 
00065                 virtual u32 getMeshCount() const = 0;
00066 
00068 
00070                 virtual s32 getMeshIndex(const IMesh* const mesh) const = 0;
00071 
00073 
00079                 virtual IAnimatedMesh* getMeshByIndex(u32 index) = 0;
00080 
00082 
00084                 _IRR_DEPRECATED_ IAnimatedMesh* getMeshByFilename(const io::path& filename)
00085                 {
00086                         return getMeshByName(filename);
00087                 }
00088 
00090 
00092                 _IRR_DEPRECATED_ const io::path& getMeshFilename(u32 index) const
00093                 {
00094                         return getMeshName(index).getInternalName();
00095                 }
00096 
00098 
00100                 _IRR_DEPRECATED_ const io::path& getMeshFilename(const IMesh* const mesh) const
00101                 {
00102                         return getMeshName(mesh).getInternalName();
00103                 }
00104 
00106 
00108                 _IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename)
00109                 {
00110                         return renameMesh(index, filename);
00111                 }
00112 
00114 
00116                 _IRR_DEPRECATED_ bool setMeshFilename(const IMesh* const mesh, const io::path& filename)
00117                 {
00118                         return renameMesh(mesh, filename);
00119                 }
00120 
00122 
00124                 virtual IAnimatedMesh* getMeshByName(const io::path& name) = 0;
00125 
00127 
00129                 virtual const io::SNamedPath& getMeshName(u32 index) const = 0;
00130 
00132 
00134                 virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0;
00135 
00137 
00143                 virtual bool renameMesh(u32 index, const io::path& name) = 0;
00144 
00146 
00152                 virtual bool renameMesh(const IMesh* const mesh, const io::path& name) = 0;
00153 
00155 
00157                 virtual bool isMeshLoaded(const io::path& name) = 0;
00158 
00160 
00164                 virtual void clear() = 0;
00165 
00167 
00169                 virtual void clearUnusedMeshes() = 0;
00170         };
00171 
00172 
00173 } // end namespace scene
00174 } // end namespace irr
00175 
00176 #endif
00177