#include <xFileMaker.h>
Public Member Functions | |
XFileMaker () | |
~XFileMaker () | |
bool | open (const Filename &filename) |
Opens the indicated filename for writing, and writes the .x header information; returns true on success, false otherwise. | |
void | close () |
Finalizes and closes the file previously opened via open(). | |
bool | add_tree (EggData &egg_data) |
Adds the egg tree rooted at the indicated node to the DX structure. | |
Private Types | |
typedef pmap< LPDIRECTXFILEDATA, XFileMesh * > | Meshes |
Private Member Functions | |
bool | add_node (EggNode *egg_node, LPDIRECTXFILEDATA dx_parent) |
Adds the node to the DX structure, in whatever form it is supported. | |
bool | add_group (EggGroup *egg_group, LPDIRECTXFILEDATA dx_parent) |
Adds a frame for the indicated group node. | |
bool | add_bin (EggBin *egg_bin, LPDIRECTXFILEDATA dx_parent) |
Determines what kind of object needs to be added for the indicated bin node. | |
bool | add_polyset (EggBin *egg_bin, LPDIRECTXFILEDATA dx_parent) |
Adds a mesh object corresponding to the collection of polygons within the indicated bin. | |
bool | recurse_nodes (EggGroupNode *egg_node, LPDIRECTXFILEDATA dx_parent) |
Adds each child of the indicated Node as a child of the indicated DX object. | |
bool | create_object (LPDIRECTXFILEDATA &obj, REFGUID template_id, const string &name, const Datagram &dg) |
Creates a DX data object. | |
bool | create_frame (LPDIRECTXFILEDATA &obj, const string &name) |
Creates a "frame" object with the indicated name. | |
bool | add_frame_transform (LPDIRECTXFILEDATA obj, const LMatrix4f &mat) |
Adds a transformation matrix to the indicated frame. | |
bool | attach_and_release (LPDIRECTXFILEDATA obj, LPDIRECTXFILEDATA dx_parent) |
Assigns the indicated X data object to the indicated parent, and releases the pointer. | |
XFileMesh * | get_mesh (LPDIRECTXFILEDATA dx_parent) |
Returns a suitable XFileMesh object for creating meshes within the indicated dx_parent object. | |
bool | finalize_mesh (LPDIRECTXFILEDATA dx_parent) |
Creates the actual DX mesh object corresponding to the indicated dx_parent object. | |
Static Private Member Functions | |
string | make_nice_name (const string &str) |
Transforms the indicated egg name to a name that is acceptable to the DirectX format. | |
Private Attributes | |
LPDIRECTXFILE | _dx_file |
LPDIRECTXFILESAVEOBJECT | _dx_file_save |
int | _mesh_index |
Meshes | _meshes |
Definition at line 56 of file xFileMaker.h.
|
Definition at line 91 of file xFileMaker.h. |
|
Definition at line 50 of file xFileMaker.cxx. References close(). |
|
Definition at line 64 of file xFileMaker.cxx. References _dx_file, close(), D3DRM_XTEMPLATES, d3drm_xtemplates_length, and nout. |
|
Determines what kind of object needs to be added for the indicated bin node.
Definition at line 299 of file xFileMaker.cxx. Referenced by add_tree(). |
|
Adds a transformation matrix to the indicated frame.
Definition at line 417 of file xFileMaker.cxx. |
|
Adds a frame for the indicated group node.
Definition at line 255 of file xFileMaker.cxx. Referenced by add_tree(). |
|
Adds the node to the DX structure, in whatever form it is supported.
Definition at line 204 of file xFileMaker.cxx. |
|
Adds a mesh object corresponding to the collection of polygons within the indicated bin.
Definition at line 321 of file xFileMaker.cxx. References _dx_file_save, Datagram::get_data(), Datagram::get_length(), make_nice_name(), nout, and NULL. |
|
Adds the egg tree rooted at the indicated node to the DX structure. This may be somewhat destructive of the egg tree. Returns true on success, false on failure. Definition at line 172 of file xFileMaker.cxx. References add_bin(), add_group(), create_frame(), DCAST, EggGroupNode::get_class_type(), EggGroup::get_class_type(), EggBin::get_class_type(), EggGroupNode::get_name(), EggNode::is_of_type(), and recurse_nodes(). |
|
Assigns the indicated X data object to the indicated parent, and releases the pointer.
Definition at line 444 of file xFileMaker.cxx. |
|
Finalizes and closes the file previously opened via open().
Definition at line 146 of file xFileMaker.cxx. References _meshes, finalize_mesh(), EggPolysetMaker::make_bins(), nassertr, NULL, and recurse_nodes(). Referenced by XFileMaker(), and ~XFileMaker(). |
|
Creates a "frame" object with the indicated name.
Definition at line 404 of file xFileMaker.cxx. Referenced by add_tree(). |
|
Creates a DX data object.
Definition at line 371 of file xFileMaker.cxx. Referenced by recurse_nodes(). |
|
Creates the actual DX mesh object corresponding to the indicated dx_parent object.
Definition at line 544 of file xFileMaker.cxx. Referenced by close(). |
|
Returns a suitable XFileMesh object for creating meshes within the indicated dx_parent object.
Definition at line 518 of file xFileMaker.cxx. |
|
Transforms the indicated egg name to a name that is acceptable to the DirectX format.
Definition at line 486 of file xFileMaker.cxx. References _mesh_index, and _meshes. Referenced by add_polyset(). |
|
Opens the indicated filename for writing, and writes the .x header information; returns true on success, false otherwise.
Definition at line 81 of file xFileMaker.cxx. References nout. |
|
Adds each child of the indicated Node as a child of the indicated DX object.
Definition at line 350 of file xFileMaker.cxx. References create_object(). Referenced by add_tree(), and close(). |
|
Definition at line 86 of file xFileMaker.h. Referenced by ~XFileMaker(). |
|
Definition at line 87 of file xFileMaker.h. Referenced by add_polyset(). |
|
Definition at line 89 of file xFileMaker.h. Referenced by make_nice_name(). |
|
Definition at line 92 of file xFileMaker.h. Referenced by close(), and make_nice_name(). |