Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
IMeshCache.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2010 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_MESH_CACHE_H_INCLUDED__
6 #define __I_MESH_CACHE_H_INCLUDED__
7 
8 #include "IReferenceCounted.h"
9 #include "path.h"
10 
11 namespace irr
12 {
13 
14 namespace scene
15 {
16  class IMesh;
17  class IAnimatedMesh;
18  class IAnimatedMeshSceneNode;
19  class IMeshLoader;
20 
22 
27  class IMeshCache : public virtual IReferenceCounted
28  {
29  public:
30 
32  virtual ~IMeshCache() {}
33 
35 
50  virtual void addMesh(const io::path& name, IAnimatedMesh* mesh) = 0;
51 
53 
57  virtual void removeMesh(const IAnimatedMesh* const mesh) = 0;
58 
60 
64  virtual void removeMesh(const IMesh* const mesh) = 0;
65 
67 
72  virtual u32 getMeshCount() const = 0;
73 
75 
77  virtual s32 getMeshIndex(const IAnimatedMesh* const mesh) const = 0;
78 
80 
82  virtual s32 getMeshIndex(const IMesh* const mesh) const = 0;
83 
85 
91  virtual IAnimatedMesh* getMeshByIndex(u32 index) = 0;
92 
94 
96  {
97  return getMeshByName(filename);
98  }
99 
101 
103  {
104  return getMeshName(index).getInternalName();
105  }
106 
108 
109  _IRR_DEPRECATED_ const io::path& getMeshFilename(const IAnimatedMesh* const mesh) const
110  {
111  return getMeshName(mesh).getInternalName();
112  }
113 
115 
116  _IRR_DEPRECATED_ const io::path& getMeshFilename(const IMesh* const mesh) const
117  {
118  return getMeshName(mesh).getInternalName();
119  }
120 
122 
123  _IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename)
124  {
125  return renameMesh(index, filename);
126  }
127 
129 
130  _IRR_DEPRECATED_ bool setMeshFilename(const IAnimatedMesh* const mesh, const io::path& filename)
131  {
132  return renameMesh(mesh, filename);
133  }
134 
136 
137  _IRR_DEPRECATED_ bool setMeshFilename(const IMesh* const mesh, const io::path& filename)
138  {
139  return renameMesh(mesh, filename);
140  }
141 
143 
145  virtual IAnimatedMesh* getMeshByName(const io::path& name) = 0;
146 
148 
150  virtual const io::SNamedPath& getMeshName(u32 index) const = 0;
151 
153 
155  virtual const io::SNamedPath& getMeshName(const IAnimatedMesh* const mesh) const = 0;
156 
158 
160  virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0;
161 
163 
169  virtual bool renameMesh(u32 index, const io::path& name) = 0;
170 
172 
178  virtual bool renameMesh(const IAnimatedMesh* const mesh, const io::path& name) = 0;
179 
181 
187  virtual bool renameMesh(const IMesh* const mesh, const io::path& name) = 0;
188 
190 
192  virtual bool isMeshLoaded(const io::path& name) = 0;
193 
195 
199  virtual void clear() = 0;
200 
202 
204  virtual void clearUnusedMeshes() = 0;
205  };
206 
207 
208 } // end namespace scene
209 } // end namespace irr
210 
211 #endif
212 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Tue Jun 5 2012 17:57:12 by Doxygen (1.8.1)