Panda3D
Loading...
Searching...
No Matches
xFileMaker.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 xFileMaker.h
10 * @author drose
11 * @date 2001-06-19
12 */
13
14#ifndef XFILEMAKER_H
15#define XFILEMAKER_H
16
17#include "pandatoolbase.h"
18
19#include "filename.h"
20#include "pmap.h"
21#include "luse.h"
22#include "xFile.h"
23
24class EggNode;
25class EggGroupNode;
26class EggGroup;
27class EggBin;
28class EggData;
29class EggVertexPool;
30class Datagram;
31class XFileMesh;
32
33/**
34 * This class converts a Panda scene graph into a .X file and writes it out.
35 */
37public:
38 XFileMaker();
40
41 bool write(const Filename &filename);
42
43 bool add_tree(EggData *egg_data);
44
45private:
46 bool add_node(EggNode *egg_node, XFileNode *x_parent);
47 bool add_group(EggGroup *egg_group, XFileNode *x_parent);
48 bool add_bin(EggBin *egg_bin, XFileNode *x_parent);
49 bool add_polyset(EggBin *egg_bin, XFileNode *x_parent);
50
51 bool recurse_nodes(EggGroupNode *egg_node, XFileNode *x_parent);
52
53 XFileMesh *get_mesh(XFileNode *x_parent);
54 bool finalize_mesh(XFileNode *x_parent, XFileMesh *mesh);
55
56 PT(XFile) _x_file;
57
58 int _mesh_index;
59
61 Meshes _meshes;
62};
63
64#endif
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition datagram.h:38
A type of group node that holds related subnodes.
Definition eggBin.h:26
This is the primary interface into all the egg data, and the root of the egg file structure.
Definition eggData.h:37
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
A base class for things that may be directly added into the egg hierarchy.
Definition eggNode.h:36
A collection of vertices.
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
This class converts a Panda scene graph into a .X file and writes it out.
Definition xFileMaker.h:36
bool write(const Filename &filename)
Writes the .x file data to the indicated filename; returns true on success, false otherwise.
bool add_tree(EggData *egg_data)
Adds the egg tree rooted at the indicated node to the X structure.
This is a collection of polygons; i.e.
Definition xFileMesh.h:45
A single node of an X file.
Definition xFileNode.h:40
This represents the complete contents of an X file (file.x) in memory.
Definition xFile.h:32
This is our own Panda specialization on the default STL map.
Definition pmap.h:49
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.