Loading...
Searching...
No Matches
IMeshCache.h
Go to the documentation of this file.
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_MESH_CACHE_H_INCLUDED__
#define __I_MESH_CACHE_H_INCLUDED__
#include "IReferenceCounted.h"
#include "path.h"
namespace irr
{
namespace scene
{
class IMesh;
class IAnimatedMesh;
class IAnimatedMeshSceneNode;
class IMeshLoader;
class IMeshCache : public virtual IReferenceCounted
{
public:
virtual ~IMeshCache() {}
virtual void addMesh(const io::path& name, IAnimatedMesh* mesh) = 0;
virtual void removeMesh(const IMesh* const mesh) = 0;
virtual u32 getMeshCount() const = 0;
virtual s32 getMeshIndex(const IMesh* const mesh) const = 0;
virtual IAnimatedMesh* getMeshByIndex(u32 index) = 0;
_IRR_DEPRECATED_ IAnimatedMesh* getMeshByFilename(const io::path& filename)
{
return getMeshByName(filename);
}
_IRR_DEPRECATED_ const io::path& getMeshFilename(u32 index) const
{
return getMeshName(index).getInternalName();
}
_IRR_DEPRECATED_ const io::path& getMeshFilename(const IMesh* const mesh) const
{
return getMeshName(mesh).getInternalName();
}
_IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename)
{
return renameMesh(index, filename);
}
_IRR_DEPRECATED_ bool setMeshFilename(const IMesh* const mesh, const io::path& filename)
{
return renameMesh(mesh, filename);
}
virtual IAnimatedMesh* getMeshByName(const io::path& name) = 0;
virtual const io::SNamedPath& getMeshName(u32 index) const = 0;
virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0;
virtual bool renameMesh(u32 index, const io::path& name) = 0;
virtual bool renameMesh(const IMesh* const mesh, const io::path& name) = 0;
virtual bool isMeshLoaded(const io::path& name) = 0;
virtual void clear() = 0;
virtual void clearUnusedMeshes() = 0;
};
} // end namespace scene
} // end namespace irr
#endif
IReferenceCounted.h
irr::IReferenceCounted::IReferenceCounted
IReferenceCounted()
Constructor.
Definition IReferenceCounted.h:46
irr::scene::IAnimatedMesh
Interface for an animated mesh.
Definition IAnimatedMesh.h:63
irr::scene::IAnimatedMeshSceneNode
Scene node capable of displaying an animated mesh and its shadow.
Definition IAnimatedMeshSceneNode.h:54
irr::scene::IMeshCache
The mesh cache stores already loaded meshes and provides an interface to them.
Definition IMeshCache.h:28
irr::scene::IMeshCache::getMeshByFilename
_IRR_DEPRECATED_ IAnimatedMesh * getMeshByFilename(const io::path &filename)
Returns a mesh based on its name (often a filename).
Definition IMeshCache.h:84
irr::scene::IMeshCache::addMesh
virtual void addMesh(const io::path &name, IAnimatedMesh *mesh)=0
Adds a mesh to the internal list of loaded meshes.
irr::scene::IMeshCache::getMeshIndex
virtual s32 getMeshIndex(const IMesh *const mesh) const =0
Returns current index number of the mesh or -1 when not found.
irr::scene::IMeshCache::isMeshLoaded
virtual bool isMeshLoaded(const io::path &name)=0
Check if a mesh was already loaded.
irr::scene::IMeshCache::renameMesh
virtual bool renameMesh(const IMesh *const mesh, const io::path &name)=0
Renames the loaded mesh.
irr::scene::IMeshCache::setMeshFilename
_IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path &filename)
Renames a loaded mesh.
Definition IMeshCache.h:108
irr::scene::IMeshCache::getMeshByIndex
virtual IAnimatedMesh * getMeshByIndex(u32 index)=0
Returns a mesh based on its index number.
irr::scene::IMeshCache::~IMeshCache
virtual ~IMeshCache()
Destructor.
Definition IMeshCache.h:32
irr::scene::IMeshCache::getMeshFilename
_IRR_DEPRECATED_ const io::path & getMeshFilename(u32 index) const
Get the name of a loaded mesh, based on its index. (Name is often identical to the filename).
Definition IMeshCache.h:92
irr::scene::IMeshCache::renameMesh
virtual bool renameMesh(u32 index, const io::path &name)=0
Renames a loaded mesh.
irr::scene::IMeshCache::getMeshFilename
_IRR_DEPRECATED_ const io::path & getMeshFilename(const IMesh *const mesh) const
Get the name of a loaded mesh, if there is any. (Name is often identical to the filename).
Definition IMeshCache.h:100
irr::scene::IMeshCache::setMeshFilename
_IRR_DEPRECATED_ bool setMeshFilename(const IMesh *const mesh, const io::path &filename)
Renames a loaded mesh.
Definition IMeshCache.h:116
irr::scene::IMeshCache::getMeshCount
virtual u32 getMeshCount() const =0
Returns amount of loaded meshes in the cache.
irr::scene::IMeshCache::clearUnusedMeshes
virtual void clearUnusedMeshes()=0
Clears all meshes that are held in the mesh cache but not used anywhere else.
irr::scene::IMeshCache::removeMesh
virtual void removeMesh(const IMesh *const mesh)=0
Removes the mesh from the cache.
irr::scene::IMeshCache::getMeshName
virtual const io::SNamedPath & getMeshName(u32 index) const =0
Get the name of a loaded mesh, based on its index.
irr::scene::IMeshCache::getMeshByName
virtual IAnimatedMesh * getMeshByName(const io::path &name)=0
Returns a mesh based on its name.
irr::scene::IMeshCache::clear
virtual void clear()=0
Clears the whole mesh cache, removing all meshes.
irr::scene::IMeshCache::getMeshName
virtual const io::SNamedPath & getMeshName(const IMesh *const mesh) const =0
Get the name of the loaded mesh if there is any.
irr::scene::IMesh
Class which holds the geometry of an object.
Definition IMesh.h:24
irr::scene::IMeshLoader
Class which is able to load an animated mesh from a file.
Definition IMeshLoader.h:27
_IRR_DEPRECATED_
#define _IRR_DEPRECATED_
Defines a deprecated macro which generates a warning at compile time.
Definition irrTypes.h:195
irr::io::path
core::string< fschar_t > path
Type used for all file system related strings.
Definition path.h:17
irr::scene
All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees a...
Definition CDynamicMeshBuffer.h:16
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
irr::s32
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
path.h
irr::io::SNamedPath
Used in places where we identify objects by a filename, but don't actually work with the real filenam...
Definition path.h:24
irr::io::SNamedPath::getInternalName
const path & getInternalName() const
Definition path.h:54
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0