55 return _x_file->write(filename);
72 if (!recurse_nodes(egg_data, _x_file)) {
78 for (mi = _meshes.begin(); mi != _meshes.end(); ++mi) {
79 if (!finalize_mesh((*mi).first, (*mi).second)) {
93 if (egg_node->
is_of_type(EggBin::get_class_type())) {
94 return add_bin(DCAST(
EggBin, egg_node), x_parent);
96 }
else if (egg_node->
is_of_type(EggGroup::get_class_type())) {
97 return add_group(DCAST(
EggGroup, egg_node), x_parent);
99 }
else if (egg_node->
is_of_type(EggGroupNode::get_class_type())) {
103 if (xfile_one_mesh) {
105 if (!recurse_nodes(egg_group, x_parent)) {
113 if (!recurse_nodes(egg_group, x_frame)) {
130 if (xfile_one_mesh) {
132 if (!recurse_nodes(egg_group, x_parent)) {
145 if (!recurse_nodes(egg_group, x_frame)) {
159 switch (egg_bin->get_bin_number()) {
160 case EggPolysetMaker::BN_polyset:
161 return add_polyset(egg_bin, x_parent);
165 <<
"Unexpected bin type " << egg_bin->get_bin_number() <<
"\n";
180 EggGroupNode::iterator ci;
181 for (ci = egg_bin->begin(); ci != egg_bin->end(); ++ci) {
183 DCAST_INTO_R(poly, *ci,
false);
198 EggGroupNode::iterator ci;
199 for (ci = egg_node->begin(); ci != egg_node->end(); ++ci) {
201 if (!add_node(child, x_parent)) {
215 Meshes::iterator mi = _meshes.find(x_parent);
216 if (mi != _meshes.end()) {
224 _meshes.insert(Meshes::value_type(x_parent, mesh));
237 std::string mesh_index = format_string(_mesh_index);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
XFileDataNode * add_Frame(const std::string &name)
Creates a new Frame instance, as a child of this node.
This is a collection of polygons; i.e.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for nodes in the hierarchy that are not leaf nodes.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the primary interface into all the egg data, and the root of the egg file structure.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool add_tree(EggData *egg_data)
Adds the egg tree rooted at the indicated node to the X structure.
void add_polygon(EggPolygon *egg_poly)
Adds the indicated polygon to the mesh.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
A single node of an X file.
The name of a file, such as a texture file or an Egg file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int remove_invalid_primitives(bool recurse)
Removes primitives at this level and below which appear to be degenerate; e.g.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
XFileDataNode * add_FrameTransformMatrix(const LMatrix4d &mat)
Creates a new FrameTransformMatrix instance, as a child of this node.
XFileDataNode * make_x_mesh(XFileNode *x_parent, const std::string &suffix)
Creates an X structure corresponding to the mesh.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for things that may be directly added into the egg hierarchy.
This is an abstract base class for an XFileNode which is also an XFileDataObject.
int make_bins(EggGroupNode *root_group)
The main entry point to EggBinMaker.
A specialization on EggBinMaker for making polysets that share the same basic rendering characteristi...
This represents the complete contents of an X file (file.x) in memory.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool write(const Filename &filename)
Writes the .x file data to the indicated filename; returns true on success, false otherwise.
A type of group node that holds related subnodes.