7 #ifndef CAFU_MODEL_LOADER_HPP_INCLUDED
8 #define CAFU_MODEL_LOADER_HPP_INCLUDED
10 #include "Model_cmdl.hpp"
25 REMOVE_DEGEN_TRIANGLES=0x01,
26 REMOVE_UNUSED_VERTICES=0x02,
27 REMOVE_UNUSED_WEIGHTS =0x04
39 virtual const std::string&
GetFileName()
const {
return m_FileName; }
54 virtual bool Load(
unsigned int Level,
CafuModelT*& DlodModel,
float& DlodDist)=0;
81 const std::string m_FileName;
95 virtual std::string
GetPasswordFromUser(
const std::string& Message,
const std::string& Caption=
"Enter password")=0;
123 virtual const std::string&
GetFileName()
const {
return m_FileName; }
132 const std::string m_FileName;
This class represents a native Cafu model.
Definition: Model_cmdl.hpp:45
The base class for importing additional animations into an existing CafuModelT.
Definition: Loader.hpp:115
void RemoveDegenTriangles(CafuModelT::MeshT &Mesh)
Removes triangles with zero-length edges from the given mesh.
Definition: Loader.cpp:37
void RemoveUnusedWeights(CafuModelT::MeshT &Mesh)
Removes unused weights from the given mesh (should be called after RemoveUnusedVertices()).
Definition: Loader.cpp:97
The base class for importing arbitrary model files into Cafu models.
Definition: Loader.hpp:15
ModelLoaderT(const std::string &FileName, int Flags)
The constructor.
Definition: Loader.cpp:18
An interface for user callbacks.
Definition: Loader.hpp:89
This struct defines a triangle mesh in the model.
Definition: Model_cmdl.hpp:63
This class represents a surface material ("A datastructural representation of a scripts material def...
Definition: Material.hpp:22
virtual ArrayT< CafuModelT::AnimT > Import(const ArrayT< CafuModelT::JointT > &Joints, const ArrayT< CafuModelT::MeshT > &Meshes)=0
Imports and returns the animation sequences from the file, optionally referring to the joints and mes...
virtual std::string GetPasswordFromUser(const std::string &Message, const std::string &Caption="Enter password")=0
Asks the user for a password to open the model file.
AnimImporterT(const std::string &FileName)
The constructor.
Definition: Loader.cpp:148
This class implements the MaterialManagerI interface.
Definition: MaterialManagerImpl.hpp:23
virtual void Postprocess(ArrayT< CafuModelT::MeshT > &Meshes)
Postprocesses the file data according to flags given to the constructor.
Definition: Loader.cpp:25
virtual ~ModelLoaderT()
The virtual destructor.
Definition: Loader.hpp:35
A class that is thrown on model load errors.
Definition: Loader.hpp:106
virtual void Load(ArrayT< CafuModelT::JointT > &Joints, ArrayT< CafuModelT::MeshT > &Meshes, ArrayT< CafuModelT::AnimT > &Anims, MaterialManagerImplT &MaterialMan)=0
Actually loads the file data into the appropriate parts of the Cafu model.
virtual const std::string & GetFileName() const
Returns the file name of the imported model.
Definition: Loader.hpp:39
virtual const std::string & GetFileName() const
Returns the name of the file the animations are imported from.
Definition: Loader.hpp:123
void AbandonDuplicateWeights(CafuModelT::MeshT &Mesh)
Makes sure that vertices that are geo-dups of each other refer to the same set of weights...
Definition: Loader.cpp:86
void RemoveUnusedVertices(CafuModelT::MeshT &Mesh)
Removes unused vertices from the given mesh.
Definition: Loader.cpp:56
MaterialT CreateDefaultMaterial(const std::string &MatName, bool EditorSave=true) const
Creates and returns a fail-safe wire-frame material with the given name, for use when a material with...
Definition: Loader.cpp:129