Panda3D
vrmlToEggConverter.h
1 // Filename: vrmlToEggConverter.h
2 // Created by: drose (01Oct04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef VRMLTOEGGCONVERTER_H
16 #define VRMLTOEGGCONVERTER_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "somethingToEggConverter.h"
21 #include "pmap.h"
22 
23 class VrmlNode;
24 struct SFNodeRef;
25 class EggGroupNode;
26 class EggGroup;
27 class LMatrix4d;
28 
29 ////////////////////////////////////////////////////////////////////
30 // Class : VRMLToEggConverter
31 // Description : This class supervises the construction of an EggData
32 // structure from a VRML file.
33 ////////////////////////////////////////////////////////////////////
35 public:
39 
41 
42  virtual string get_name() const;
43  virtual string get_extension() const;
44  virtual bool supports_compressed() const;
45 
46  virtual bool convert_file(const Filename &filename);
47 
48 private:
50 
51  void get_all_defs(SFNodeRef &vrml, Nodes &nodes);
52  void vrml_node(const SFNodeRef &vrml, EggGroupNode *egg,
53  const LMatrix4d &net_transform);
54 
55  void vrml_grouping_node(const SFNodeRef &vrml, EggGroupNode *egg,
56  const LMatrix4d &net_transform,
57  void (VRMLToEggConverter::*process_func)
58  (const VrmlNode *node, EggGroup *group,
59  const LMatrix4d &net_transform));
60  void vrml_group(const VrmlNode *node, EggGroup *group,
61  const LMatrix4d &net_transform);
62  void vrml_transform(const VrmlNode *node, EggGroup *group,
63  const LMatrix4d &net_transform);
64  void vrml_shape(const VrmlNode *node, EggGroup *group,
65  const LMatrix4d &net_transform);
66 };
67 
68 #endif
69 
70 
This is our own Panda specialization on the default STL map.
Definition: pmap.h:52
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
virtual string get_extension() const
Returns the common extension of the file type this converter supports.
A base class for nodes in the hierarchy that are not leaf nodes.
Definition: eggGroupNode.h:51
virtual SomethingToEggConverter * make_copy()
Allocates and returns a new copy of the converter.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition: eggGroup.h:36
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
virtual string get_name() const
Returns the English name of the file type this converter supports.
This class supervises the construction of an EggData structure from a VRML file.
virtual bool supports_compressed() const
Returns true if this file type can transparently load compressed files (with a .pz extension)...
virtual bool convert_file(const Filename &filename)
Handles the reading of the input file and converting it to egg.
This is a base class for a family of converter classes that manage a conversion from some file type t...