arsa  2.7
IMeshLoader.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2012 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_LOADER_H_INCLUDED__
6 #define __I_MESH_LOADER_H_INCLUDED__
7 
8 #include "IReferenceCounted.h"
9 #include "path.h"
10 #include "IMeshTextureLoader.h"
11 
12 namespace irr
13 {
14 namespace io
15 {
16  class IReadFile;
17 } // end namespace io
18 namespace scene
19 {
20  class IAnimatedMesh;
21 
23 
27 class IMeshLoader : public virtual IReferenceCounted
28 {
29 public:
30 
33 
35  virtual ~IMeshLoader()
36  {
37  if ( TextureLoader )
39  }
40 
42 
46  virtual bool isALoadableFileExtension(const io::path& filename) const = 0;
47 
49 
53  virtual IAnimatedMesh* createMesh(io::IReadFile* file) = 0;
54 
56 
61  virtual void setMeshTextureLoader(IMeshTextureLoader* textureLoader)
62  {
63  if ( textureLoader != TextureLoader )
64  {
65  if ( textureLoader )
66  textureLoader->grab();
67  if ( TextureLoader )
69  TextureLoader = textureLoader;
70  }
71  }
72 
74 
77  {
78  return TextureLoader;
79  }
80 
81 protected:
83 };
84 
85 
86 } // end namespace scene
87 } // end namespace irr
88 
89 #endif
bool drop() const
Drops the object. Decrements the reference counter by one.
virtual ~IMeshLoader()
Destructor.
Definition: IMeshLoader.h:35
Interface providing read access to a file.
Definition: IReadFile.h:18
Finding and loading textures inside meshloaders.
Everything in the Irrlicht Engine can be found in this namespace.
Definition: CARSADPad.h:6
virtual IMeshTextureLoader * getMeshTextureLoader() const
Get the texture loader used when this meshloader searches for textures.
Definition: IMeshLoader.h:76
virtual IAnimatedMesh * createMesh(io::IReadFile *file)=0
Creates/loads an animated mesh from the file.
virtual bool isALoadableFileExtension(const io::path &filename) const =0
Returns true if the file might be loaded by this class.
IMeshTextureLoader * TextureLoader
Definition: IMeshLoader.h:82
IMeshLoader()
Constructor.
Definition: IMeshLoader.h:32
Class which is able to load an animated mesh from a file.
Definition: IMeshLoader.h:27
virtual void setMeshTextureLoader(IMeshTextureLoader *textureLoader)
Set a new texture loader which this meshloader can use when searching for textures.
Definition: IMeshLoader.h:61
void grab() const
Grabs the object. Increments the reference counter by one.
Base class of most objects of the Irrlicht Engine.
Interface for an animated mesh.
Definition: IAnimatedMesh.h:20