Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# dexibuild.hpp

Go to the documentation of this file.

    00001 #ifndef DEXIBUILD_HPP
    00002 #define DEXIBUILD_HPP
    00003
    00004 #pragma warning (disable : 4786)
    00005 #pragma warning (push, 3)
    00006 #include "tinyxml_pull/tinyxml.h"
    00007 #include <map>
    00008 #pragma warning (pop)
    00009
    00010 #define USING_DESTINY3D
    00011 #define DESTINY3D_STATIC_LINK
    00012
    00013 #include "Destiny3D.hpp"
    00014 #include "deFileSystem.hpp"
    00015 #include "deFile.hpp"
    00016 #include "deWorld.hpp"
    00017 #include "deScene.hpp"
    00018 #include "deString.hpp"
    00019
    00020 typedef void (* dexiDocHandler)(TiXmlElement* pRoot, deString2 inputFileName);
    00021
    00022 class IDexiBuilder
    00023 {
    00024 protected:
    00025     virtual ~IDexiBuilder() {}
    00026 public:
    00027     virtual void RegisterDexiHandler(const char* targetName, dexiDocHandler h) = 0;
    00028 };
    00029
    00030 class DexiBuilder : public IDexiBuilder
    00031 {
    00032 public:
    00033     DexiBuilder();
    00034     ~DexiBuilder();
    00035     void RegisterDexiHandler(const char* targetName, dexiDocHandler h);
    00036
    00037     void loadFile(deString2 filename);
    00038     void loadBatch(deString2 batchDir, bool doSubDirs);
    00039     void handleDoc(TiXmlDocument* pDoc, deString2 inputFileName);
    00040
    00041 private:
    00042     typedef std::map<deString2, dexiDocHandler>handlermap;
    00043     handlermap m_Handlers;
    00044 };
    00045
    00046 enum LogLevel
    00047 {
    00048     Log_Info,
    00049     Log_Message,
    00050     Log_Warning,
    00051     Log_Error,
    00052 };
    00053 void LogExportMsg(int level, const char* format, ...);
    00054 class dexiException
    00055 {
    00056 private:
    00057     void operator=(const dexiException& ) { }
    00058 public:
    00059     const deString2 what;
    00060     dexiException() {}
    00061     dexiException(const deString & msg) : what(msg.const_str()) {}
    00062     dexiException(const char * msg) : what(msg) {}
    00063     ~dexiException() {}
    00064 };
    00065
    00066 struct dexiVertexSet
    00067 {
    00068 public:
    00069     deTArray<deVec3d> unique_positions;
    00070     deTArray<u32> pos_bindings;
    00071     deTArray<deVertex> vert_positions;
    00072     deTArray<deVertex> normals;
    00073     deTArray<deColor> colors;
    00074     deTArray< deTArray<deTexCoord3> > texcoords;
    00075 };
    00076
    00077 struct dexiTriMeshSub
    00078 {
    00079 public:
    00080     struct triface_t
    00081     {
    00082         u32 v0, v1, v2;
    00083     };
    00084     deString2 surface_name;
    00085     deTArray<triface_t> faces;
    00086 };
    00087
    00088 struct dexiTriMesh
    00089 {
    00090 public:
    00091     dexiTriMesh() : instance_template(NULL), instance_owner(deFALSE) {}
    00092     deString2 vertexpool;
    00093     deTArray<dexiTriMeshSub> submeshes;
    00094     IdeMesh* instance_template;
    00095     deBoolean instance_owner;
    00096 };
    00097
    00098 struct dexiScene
    00099 {
    00100 public:
    00101     deTArray<IdeSceneStaticMesh*> instance_meshes;
    00102     deTArray<IdeMesh*> fixed_meshes;
    00103     deTArray<deTransformInfo> fixed_transforms;
    00104 };
    00105
    00106 #endif