Panda3D

vrmlToEggConverter.h

00001 // Filename: vrmlToEggConverter.h
00002 // Created by:  drose (01Oct04)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef VRMLTOEGGCONVERTER_H
00016 #define VRMLTOEGGCONVERTER_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include "somethingToEggConverter.h"
00021 #include "pmap.h"
00022 
00023 class VrmlNode;
00024 struct SFNodeRef;
00025 class EggGroupNode;
00026 class EggGroup;
00027 class LMatrix4d;
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //       Class : VRMLToEggConverter
00031 // Description : This class supervises the construction of an EggData
00032 //               structure from a VRML file.
00033 ////////////////////////////////////////////////////////////////////
00034 class VRMLToEggConverter : public SomethingToEggConverter {
00035 public:
00036   VRMLToEggConverter();
00037   VRMLToEggConverter(const VRMLToEggConverter &copy);
00038   ~VRMLToEggConverter();
00039 
00040   virtual SomethingToEggConverter *make_copy();
00041 
00042   virtual string get_name() const;
00043   virtual string get_extension() const;
00044   virtual bool supports_compressed() const;
00045 
00046   virtual bool convert_file(const Filename &filename);
00047 
00048 private:
00049   typedef pmap<string, VrmlNode *> Nodes;
00050 
00051   void get_all_defs(SFNodeRef &vrml, Nodes &nodes);
00052   void vrml_node(const SFNodeRef &vrml, EggGroupNode *egg, 
00053                  const LMatrix4d &net_transform);
00054 
00055   void vrml_grouping_node(const SFNodeRef &vrml, EggGroupNode *egg,
00056                           const LMatrix4d &net_transform,
00057                           void (VRMLToEggConverter::*process_func)
00058                           (const VrmlNode *node, EggGroup *group,
00059                            const LMatrix4d &net_transform));
00060   void vrml_group(const VrmlNode *node, EggGroup *group,
00061                   const LMatrix4d &net_transform);
00062   void vrml_transform(const VrmlNode *node, EggGroup *group,
00063                       const LMatrix4d &net_transform);
00064   void vrml_shape(const VrmlNode *node, EggGroup *group,
00065                   const LMatrix4d &net_transform);
00066 };
00067 
00068 #endif
00069 
00070 
 All Classes Functions Variables Enumerations