00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef XFILEMAKER_H
00016 #define XFILEMAKER_H
00017
00018 #include "pandatoolbase.h"
00019
00020 #include "filename.h"
00021 #include "pmap.h"
00022 #include "luse.h"
00023 #include "xFile.h"
00024
00025 class EggNode;
00026 class EggGroupNode;
00027 class EggGroup;
00028 class EggBin;
00029 class EggData;
00030 class EggVertexPool;
00031 class Datagram;
00032 class XFileMesh;
00033
00034
00035
00036
00037
00038
00039 class XFileMaker {
00040 public:
00041 XFileMaker();
00042 ~XFileMaker();
00043
00044 bool write(const Filename &filename);
00045
00046 bool add_tree(EggData *egg_data);
00047
00048 private:
00049 bool add_node(EggNode *egg_node, XFileNode *x_parent);
00050 bool add_group(EggGroup *egg_group, XFileNode *x_parent);
00051 bool add_bin(EggBin *egg_bin, XFileNode *x_parent);
00052 bool add_polyset(EggBin *egg_bin, XFileNode *x_parent);
00053
00054 bool recurse_nodes(EggGroupNode *egg_node, XFileNode *x_parent);
00055
00056 XFileMesh *get_mesh(XFileNode *x_parent);
00057 bool finalize_mesh(XFileNode *x_parent, XFileMesh *mesh);
00058
00059 PT(XFile) _x_file;
00060
00061 int _mesh_index;
00062
00063 typedef pmap<XFileNode *, XFileMesh *> Meshes;
00064 Meshes _meshes;
00065 };
00066
00067 #endif
00068