#include <xFileMesh.h>
Inheritance diagram for XFileMesh:
Public Member Functions | |
XFileMesh () | |
~XFileMesh () | |
void | clear () |
Empties all data from the mesh. | |
void | add_polygon (EggPolygon *egg_poly) |
Adds the indicated polygon to the mesh. | |
int | add_vertex (EggVertex *egg_vertex, EggPrimitive *egg_prim) |
Creates a new XFileVertex, if one does not already exist for the indicated vertex, and returns its index. | |
int | add_normal (EggVertex *egg_vertex, EggPrimitive *egg_prim) |
Creates a new XFileNormal, if one does not already exist for the indicated normal, and returns its index. | |
int | add_material (EggPrimitive *egg_prim) |
Creates a new XFileMaterial, if one does not already exist for the indicated material, and returns its index. | |
int | add_vertex (XFileVertex *vertex) |
Adds the newly-created XFileVertex unequivocally to the mesh, returning its index number. | |
int | add_normal (XFileNormal *normal) |
Adds the newly-created XFileNormal unequivocally to the mesh, returning its index number. | |
int | add_material (XFileMaterial *material) |
Adds the newly-created XFileMaterial unequivocally to the mesh, returning its index number. | |
bool | create_polygons (EggGroupNode *egg_parent, XFileToEggConverter *converter) |
Creates a slew of EggPolygons according to the faces in the mesh, and adds them to the indicated parent node. | |
bool | has_normals () const |
Returns true if any of the vertices or faces added to this mesh used a normal, false otherwise. | |
bool | has_colors () const |
Returns true if any of the vertices or faces added to this mesh used a color, false otherwise. | |
bool | has_uvs () const |
Returns true if any of the vertices added to this mesh used a texture coordinate, false otherwise. | |
bool | has_materials () const |
Returns true if any of the faces added to this mesh used a real material, false otherwise. | |
int | get_num_materials () const |
Returns the number of distinct materials associated with the mesh. | |
XFileMaterial * | get_material (int n) const |
Returns a pointer to the nth materials associated with the mesh. | |
void | make_mesh_data (Datagram &raw_data) |
Fills the datagram with the raw data for the DX Mesh template. | |
void | make_normal_data (Datagram &raw_data) |
Fills the datagram with the raw data for the DX MeshNormals template. | |
void | make_color_data (Datagram &raw_data) |
Fills the datagram with the raw data for the DX MeshVertexColors template. | |
void | make_uv_data (Datagram &raw_data) |
Fills the datagram with the raw data for the DX MeshTextureCoords template. | |
void | make_material_list_data (Datagram &raw_data) |
Fills the datagram with the raw data for the DX MeshMaterialList template. | |
bool | read_mesh_data (const Datagram &raw_data) |
Fills the structure based on the raw data from the Mesh template. | |
bool | read_normal_data (const Datagram &raw_data) |
Fills the structure based on the raw data from the MeshNormals template. | |
bool | read_color_data (const Datagram &raw_data) |
Fills the structure based on the raw data from the MeshVertexColors template. | |
bool | read_uv_data (const Datagram &raw_data) |
Fills the structure based on the raw data from the MeshTextureCoords template. | |
bool | read_material_list_data (const Datagram &raw_data) |
Fills the structure based on the raw data from the MaterialList template. | |
void | set_name (const string &name) |
void | clear_name () |
bool | has_name () const |
const string & | get_name () const |
void | output (ostream &out) const |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Protected Attributes | |
string | _name |
Static Protected Attributes | |
TypeHandle | _type_handle |
Private Types | |
typedef pvector< XFileVertex * > | Vertices |
typedef pvector< XFileNormal * > | Normals |
typedef pvector< XFileMaterial * > | Materials |
typedef pvector< XFileFace * > | Faces |
typedef pmap< XFileVertex *, int, IndirectCompareTo< XFileVertex > > | UniqueVertices |
typedef pmap< XFileNormal *, int, IndirectCompareTo< XFileNormal > > | UniqueNormals |
typedef pmap< XFileMaterial *, int, IndirectCompareTo< XFileMaterial > > | UniqueMaterials |
Private Attributes | |
Vertices | _vertices |
Normals | _normals |
Materials | _materials |
Faces | _faces |
UniqueVertices | _unique_vertices |
UniqueNormals | _unique_normals |
UniqueMaterials | _unique_materials |
bool | _has_normals |
bool | _has_colors |
bool | _has_uvs |
bool | _has_materials |
a polyset.
Definition at line 50 of file xFileMesh.h.
|
Definition at line 93 of file xFileMesh.h. |
|
Definition at line 92 of file xFileMesh.h. |
|
Definition at line 91 of file xFileMesh.h. |
|
Definition at line 102 of file xFileMesh.h. |
|
Definition at line 101 of file xFileMesh.h. |
|
Definition at line 100 of file xFileMesh.h. |
|
Definition at line 90 of file xFileMesh.h. |
|
Definition at line 41 of file xFileMesh.cxx. |
|
Definition at line 56 of file xFileMesh.cxx. |
|
Adds the newly-created XFileMaterial unequivocally to the mesh, returning its index number. The XFileMesh object becomes the owner of the XFileMaterial pointer, and will delete it when it destructs. Definition at line 293 of file xFileMesh.cxx. |
|
Creates a new XFileMaterial, if one does not already exist for the indicated material, and returns its index.
Definition at line 210 of file xFileMesh.cxx. References _unique_vertices, and _vertices. Referenced by XFileToEggConverter::convert_mesh_material_list(). |
|
Adds the newly-created XFileNormal unequivocally to the mesh, returning its index number. The XFileMesh object becomes the owner of the XFileNormal pointer, and will delete it when it destructs. Definition at line 271 of file xFileMesh.cxx. |
|
Creates a new XFileNormal, if one does not already exist for the indicated normal, and returns its index.
Definition at line 174 of file xFileMesh.cxx. References _has_materials, _materials, _unique_materials, XFileMaterial::has_material(), and XFileMaterial::set_from_egg(). |
|
Adds the indicated polygon to the mesh.
Definition at line 115 of file xFileMesh.cxx. References XFileVertex::_has_color, _has_colors, XFileVertex::_has_uv, _has_uvs, _unique_vertices, _vertices, and XFileVertex::set_from_egg(). |
|
Adds the newly-created XFileVertex unequivocally to the mesh, returning its index number. The XFileMesh object becomes the owner of the XFileVertex pointer, and will delete it when it destructs. Definition at line 249 of file xFileMesh.cxx. References _materials, and _unique_materials. |
|
Creates a new XFileVertex, if one does not already exist for the indicated vertex, and returns its index.
Definition at line 134 of file xFileMesh.cxx. Referenced by XFileFace::XFileFace(). |
|
Empties all data from the mesh.
Definition at line 69 of file xFileMesh.cxx. |
|
Creates a slew of EggPolygons according to the faces in the mesh, and adds them to the indicated parent node.
Definition at line 313 of file xFileMesh.cxx. References _materials. Referenced by XFileToEggConverter::convert_frame(). |
|
Returns a pointer to the nth materials associated with the mesh.
Definition at line 458 of file xFileMesh.cxx. References XFileVertex::_color, _vertices, Datagram::add_int32(), Datagram::clear(), and Colorf. |
|
Returns the number of distinct materials associated with the mesh.
Definition at line 443 of file xFileMesh.cxx. References _faces. |
|
Returns true if any of the vertices or faces added to this mesh used a color, false otherwise.
Definition at line 398 of file xFileMesh.cxx. |
|
Returns true if any of the faces added to this mesh used a real material, false otherwise.
Definition at line 428 of file xFileMesh.cxx. References XFileNormal::_normal, _normals, Datagram::add_float32(), Datagram::add_int32(), Datagram::clear(), and Normalf. |
|
Returns true if any of the vertices or faces added to this mesh used a normal, false otherwise.
Definition at line 383 of file xFileMesh.cxx. References _materials, nassertr, and NULL. |
|
Returns true if any of the vertices added to this mesh used a texture coordinate, false otherwise.
Definition at line 413 of file xFileMesh.cxx. |
|
Fills the datagram with the raw data for the DX MeshVertexColors template.
Definition at line 552 of file xFileMesh.cxx. |
|
Fills the datagram with the raw data for the DX MeshMaterialList template.
Definition at line 605 of file xFileMesh.cxx. References DatagramIterator::get_remaining_size(), and nout. |
|
Fills the datagram with the raw data for the DX Mesh template.
Definition at line 474 of file xFileMesh.cxx. |
|
Fills the datagram with the raw data for the DX MeshNormals template.
Definition at line 513 of file xFileMesh.cxx. References _faces. |
|
Fills the datagram with the raw data for the DX MeshTextureCoords template.
Definition at line 581 of file xFileMesh.cxx. |
|
Fills the structure based on the raw data from the MeshVertexColors template.
Definition at line 727 of file xFileMesh.cxx. |
|
Fills the structure based on the raw data from the MaterialList template.
Definition at line 801 of file xFileMesh.cxx. |
|
Fills the structure based on the raw data from the Mesh template.
Definition at line 627 of file xFileMesh.cxx. References _vertices, and nout. Referenced by XFileToEggConverter::convert_frame(). |
|
Fills the structure based on the raw data from the MeshNormals template.
Definition at line 675 of file xFileMesh.cxx. |
|
Fills the structure based on the raw data from the MeshTextureCoords template.
Definition at line 765 of file xFileMesh.cxx. Referenced by XFileToEggConverter::convert_mesh_data_object(). |
|
Definition at line 98 of file xFileMesh.h. Referenced by get_num_materials(), and make_normal_data(). |
|
Definition at line 108 of file xFileMesh.h. Referenced by add_polygon(). |
|
Definition at line 110 of file xFileMesh.h. Referenced by add_normal(). |
|
Definition at line 107 of file xFileMesh.h. |
|
Definition at line 109 of file xFileMesh.h. Referenced by add_polygon(). |
|
Definition at line 97 of file xFileMesh.h. Referenced by add_normal(), add_vertex(), create_polygons(), and has_normals(). |
|
Definition at line 96 of file xFileMesh.h. Referenced by has_materials(), and ~XFileMesh(). |
|
Definition at line 105 of file xFileMesh.h. Referenced by add_normal(), and add_vertex(). |
|
Definition at line 104 of file xFileMesh.h. |
|
Definition at line 103 of file xFileMesh.h. Referenced by add_material(), and add_polygon(). |
|
Definition at line 95 of file xFileMesh.h. Referenced by add_material(), add_normal(), add_polygon(), get_material(), has_colors(), read_mesh_data(), and ~XFileMesh(). |