Panda3D
Loading...
Searching...
No Matches
vrmlToEggConverter.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file vrmlToEggConverter.h
10 * @author drose
11 * @date 2004-10-01
12 */
13
14#ifndef VRMLTOEGGCONVERTER_H
15#define VRMLTOEGGCONVERTER_H
16
17#include "pandatoolbase.h"
18
20#include "pmap.h"
21
22class VrmlNode;
23struct SFNodeRef;
24class EggGroupNode;
25class EggGroup;
26class LMatrix4d;
27
28/**
29 * This class supervises the construction of an EggData structure from a VRML
30 * file.
31 */
32class VRMLToEggConverter : public SomethingToEggConverter {
33public:
34 VRMLToEggConverter();
35 VRMLToEggConverter(const VRMLToEggConverter &copy);
36 ~VRMLToEggConverter();
37
38 virtual SomethingToEggConverter *make_copy();
39
40 virtual std::string get_name() const;
41 virtual std::string get_extension() const;
42 virtual bool supports_compressed() const;
43
44 virtual bool convert_file(const Filename &filename);
45
46private:
47 typedef pmap<std::string, VrmlNode *> Nodes;
48
49 void get_all_defs(SFNodeRef &vrml, Nodes &nodes);
50 void vrml_node(const SFNodeRef &vrml, EggGroupNode *egg,
51 const LMatrix4d &net_transform);
52
53 void vrml_grouping_node(const SFNodeRef &vrml, EggGroupNode *egg,
54 const LMatrix4d &net_transform,
55 void (VRMLToEggConverter::*process_func)
56 (const VrmlNode *node, EggGroup *group,
57 const LMatrix4d &net_transform));
58 void vrml_group(const VrmlNode *node, EggGroup *group,
59 const LMatrix4d &net_transform);
60 void vrml_transform(const VrmlNode *node, EggGroup *group,
61 const LMatrix4d &net_transform);
62 void vrml_shape(const VrmlNode *node, EggGroup *group,
63 const LMatrix4d &net_transform);
64};
65
66#endif
A base class for nodes in the hierarchy that are not leaf nodes.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition eggGroup.h:34
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
virtual std::string get_name() const
Returns the English name of the file type this converter supports.
virtual SomethingToEggConverter * make_copy()
Allocates and returns a new copy of the converter.
virtual std::string get_extension() const
Returns the common extension of the file type this converter supports.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.