Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

pandatool/src/xfile/xFileToEggConverter.h

Go to the documentation of this file.
00001 // Filename: xFileToEggConverter.h
00002 // Created by:  drose (21Jun01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef XFILETOEGGCONVERTER_H
00020 #define XFILETOEGGCONVERTER_H
00021 
00022 #include "pandatoolbase.h"
00023 #include "somethingToEggConverter.h"
00024 #include "eggTextureCollection.h"
00025 #include "eggMaterialCollection.h"
00026 
00027 #define WIN32_LEAN_AND_MEAN
00028 #include <windows.h>
00029 #include <d3d.h>
00030 #include <dxfile.h>
00031 #include <rmxfguid.h>
00032 #undef WIN32_LEAN_AND_MEAN
00033 
00034 class EggGroupNode;
00035 class Datagram;
00036 class XFileMesh;
00037 class XFileMaterial;
00038 class EggTexture;
00039 class EggMaterial;
00040 
00041 ////////////////////////////////////////////////////////////////////
00042 //       Class : XFileToEggConverter
00043 // Description : 
00044 ////////////////////////////////////////////////////////////////////
00045 class XFileToEggConverter : public SomethingToEggConverter {
00046 public:
00047   XFileToEggConverter();
00048   XFileToEggConverter(const XFileToEggConverter &copy);
00049   ~XFileToEggConverter();
00050 
00051   virtual SomethingToEggConverter *make_copy();
00052 
00053   virtual string get_name() const;
00054   virtual string get_extension() const;
00055 
00056   virtual bool convert_file(const Filename &filename);
00057   void close();
00058 
00059   EggTexture *create_unique_texture(const EggTexture &copy);
00060   EggMaterial *create_unique_material(const EggMaterial &copy);
00061 
00062 private:
00063   bool get_toplevel();
00064   bool convert_object(LPDIRECTXFILEOBJECT obj, EggGroupNode *egg_parent);
00065   bool convert_data_object(LPDIRECTXFILEDATA obj, EggGroupNode *egg_parent);
00066   bool convert_frame(LPDIRECTXFILEDATA obj, EggGroupNode *egg_parent);
00067   bool convert_transform(LPDIRECTXFILEDATA obj, EggGroupNode *egg_parent);
00068   bool convert_mesh(LPDIRECTXFILEDATA obj, EggGroupNode *egg_parent);
00069 
00070   bool convert_mesh_object(LPDIRECTXFILEOBJECT obj, XFileMesh &mesh);
00071   bool convert_mesh_data_object(LPDIRECTXFILEDATA obj, XFileMesh &mesh);
00072   bool convert_mesh_normals(LPDIRECTXFILEDATA obj, XFileMesh &mesh);
00073   bool convert_mesh_colors(LPDIRECTXFILEDATA obj, XFileMesh &mesh);
00074   bool convert_mesh_uvs(LPDIRECTXFILEDATA obj, XFileMesh &mesh);
00075   bool convert_mesh_material_list(LPDIRECTXFILEDATA obj, XFileMesh &mesh);
00076   bool convert_material_list_object(LPDIRECTXFILEOBJECT obj, XFileMesh &mesh);
00077   bool convert_material_list_data_object(LPDIRECTXFILEDATA obj, XFileMesh &mesh);
00078   bool convert_material(LPDIRECTXFILEDATA obj, XFileMesh &mesh);
00079   bool convert_material_object(LPDIRECTXFILEOBJECT obj, XFileMaterial &material);
00080   bool convert_material_data_object(LPDIRECTXFILEDATA obj, XFileMaterial &material);
00081   bool convert_texture(LPDIRECTXFILEDATA obj, XFileMaterial &material);
00082 
00083   string get_object_name(LPDIRECTXFILEOBJECT obj);
00084   bool get_data(LPDIRECTXFILEDATA obj, Datagram &raw_data);
00085 
00086   LPDIRECTXFILE _dx_file;
00087   LPDIRECTXFILEENUMOBJECT _dx_file_enum;
00088 
00089   EggTextureCollection _textures;
00090   EggMaterialCollection _materials;
00091 };
00092 
00093 #endif

Generated on Fri May 2 03:21:55 2003 for Panda-Tool by doxygen1.3