17 #ifndef INC_StdMeshLoader
18 #define INC_StdMeshLoader
54 void StoreSkeleton(
const char* groupname,
const char* filename, std::shared_ptr<StdMeshSkeleton> skeleton);
61 void LoadSkeletonXml(
const char* groupname,
const char* filename,
const char *sourcefile,
size_t size);
62 void LoadSkeletonBinary(
const char* groupname,
const char* filename,
const char *sourcefile,
size_t size);
77 AppendtoSkeletons.clear();
78 IncludeSkeletons.clear();
82 typedef std::map<StdCopyStrBuf, std::shared_ptr<StdMeshSkeleton>>
SkeletonMap;
89 void AddSkeleton(
const StdCopyStrBuf& filepath, std::shared_ptr<StdMeshSkeleton> skeleton);
90 void DoResetSkeletons();
91 void DoAppendSkeletons();
92 void DoIncludeSkeletons();
100 std::map<StdCopyStrBuf, StdCopyStrBuf> AppendtoSkeletons;
101 std::map<StdCopyStrBuf, StdCopyStrBuf> IncludeSkeletons;
104 #define DEFINE_EXCEPTION(_cls, _text) class _cls : public StdMeshLoader::LoaderException { public: _cls(const char *msg = _text) : LoaderException(msg) {} }
113 DEFINE_EXCEPTION(SharedVertexGeometryForbidden,
"A CID_Geometry chunk was found in a submesh with shared vertices");
114 DEFINE_EXCEPTION(InvalidSubmeshOp,
"The render operation of a CID_Submesh_Op chunk was invalid");
115 DEFINE_EXCEPTION(InvalidVertexType,
"The vertex type of a CID_Geometry_Vertex_Decl_Element chunk was invalid");
116 DEFINE_EXCEPTION(InvalidVertexSemantic,
"The vertex semantic of a CID_Geometry_Vertex_Decl_Element chunk was invalid");
117 DEFINE_EXCEPTION(InvalidVertexDeclaration,
"The vertex declaration of a CID_Geometry chunk was invalid");
118 DEFINE_EXCEPTION(InvalidMaterial,
"The material referenced by a mesh or submesh is not defined");
133 #undef DEFINE_EXCEPTION
LoaderException(const char *msg)
static StdMesh * LoadMeshXml(const char *sourcefile, size_t size, const StdMeshMatManager &mat_mgr, StdMeshSkeletonLoader &loader, const char *filename=nullptr)
static StdMesh * LoadMeshBinary(const char *sourcefile, size_t size, const StdMeshMatManager &mat_mgr, StdMeshSkeletonLoader &loader, const char *filename=nullptr)
virtual StdMeshSkeleton * GetSkeletonByDefinition(const char *definition) const =0
void LoadSkeletonBinary(const char *groupname, const char *filename, const char *sourcefile, size_t size)
static void MakeFullSkeletonPath(StdCopyStrBuf &out, const char *groupname, const char *filename)
virtual ~StdMeshSkeletonLoader()=default
skeleton_iterator skeletons_end() const
std::map< StdCopyStrBuf, std::shared_ptr< StdMeshSkeleton > > SkeletonMap
void StoreSkeleton(const char *groupname, const char *filename, std::shared_ptr< StdMeshSkeleton > skeleton)
std::shared_ptr< StdMeshSkeleton > GetSkeletonByName(const StdStrBuf &name) const
skeleton_iterator skeletons_begin() const
SkeletonMap::const_iterator skeleton_iterator
void RemoveSkeletonsInGroup(const char *groupname)
void LoadSkeletonXml(const char *groupname, const char *filename, const char *sourcefile, size_t size)
void ResolveIncompleteSkeletons()
void RemoveSkeleton(const StdCopyStrBuf &filepath)
void Append(const char *pnData, size_t iChars)
DEFINE_EXCEPTION(InvalidVersion, "Mesh header does not contain the expected version")
DEFINE_EXCEPTION(InvalidVersion, "Skeleton header does not contain the expected version")
DEFINE_EXCEPTION(InsufficientData, "Premature end of data stream")
StdMeshVector TransformVector(const StdMeshVector &vector)
StdMeshVector TransformScaleVector(const StdMeshVector &vector)
StdMeshQuaternion TransformQuaternion(const StdMeshQuaternion &quaternion)
StdSubMesh::Vertex TransformVertex(const StdSubMesh::Vertex &vertex)
StdMeshVector TransformPseudoVector(const StdMeshVector &vector)
StdMeshTransformation TransformTransformation(const StdMeshTransformation &trans)
StdMeshVector TransformNormalVector(const StdMeshVector &vector)