ScEng::PolyMesh Class Reference

This class describes a Mesh which all his faces are polygons. More...

#include <polymesh.h>

List of all members.

Public Types

enum  FLAGS { , USER = (1<<16) }

Public Member Functions

 PolyMesh ()
 Constructor.
 PolyMesh (TriMesh *tri_mesh)
void SetNumVerts (int nv)
int GetNumVerts ()
 Returns the number of verts.
void SetVertPosition (int i_v, float x, float y, float z)
void SetVertPosition (int i_v, GMT::Point3F v)
void SetVert (int i_v, Vert new_vert)
Vert GetVert (int i_v)
GMT::Point3F GetVertPosition (int i_v)
void SetNumFaces (int nf)
int GetNumFaces ()
 Returns the number of faces.
void SetFaceVert (int face, int vertex_index, int vertex)
void SetFaceDeg (int face, int deg)
int GetFaceVert (int face, int vertex_index)
 Returns one vertex of the specified face.
int GetFaceDeg (int face)
 Returns the deg for the specified face.
bool GetFaceFlag (int face, DWORD flag)
 Returns the state of a flag for the specified face.
void SetFaceFlag (int face, DWORD flag)
 Sets a the state of a flag for the specified face.
void ReplaceFaceVert (int face, int v1, int v2)
 Replaces one vert for the other in the specified face.
void SetFaceSmoothigGroup (int face, unsigned int sg)
 Sets the smoothing group for a specific face.
unsigned int GetFaceSmoothingGroup (int face)
 Returns the smoothing group for a specific face.
void SetFaceMaterialID (int face, unsigned short mat_id)
 Sets the material ID for a specific face.
unsigned short GetFaceMaterialID (int face)
 Returns the material ID for a specific face.
void SetNumTVerts (int i_m, int nv)
 Sets the number of tverts.
int GetNumTVerts (int i_m)
 Returns the number of tverts.
GMT::Point3F GetTVertPosition (int i_m, int i_v)
 Returns the position of an specific tvert.
Vert GetTVert (int i_m, int i_v)
 Returns a specific tvert.
void SetTVert (int i_m, int i_v, float u, float v, float w)
 Sets a tvert.
void SetTVert (int i_m, int i_v, GMT::Point3F tv)
 Sets a tvert.
void SetNumTFaces (int i_m, int nf)
 Sets the number of tfaces.
int GetNumTFaces (int i_m)
 Returns the number of tfaces.
void SetNumUVWMeshes (int new_num_uvm)
 Sets the number of UVWMeshes.
int GetNumUVWMeshes ()
 Gets the number of UVWMeshes.
void SetNumNormals (int nn)
 Sets the number of normals.
int GetNumNormals ()
 Returns the number of normals.
void SetNumNormalFaces ()
 Sets the number of normal faces.
int GetNumNormalFaces ()
 Returns the number of normal faces.
int GetNormalFaceIndex (int face, int n)
 Returns the normal index for the normal face.
void SetNormalFace (int i_f, int i_v, int id)
 Sets the info for a normal face.
void SetNormal (int id, float x, float y, float z)
 Sets a normal.
void SetNormal (int id, GMT::Point3F n)
 Sets a normal.
GMT::Point3F GetNormal (int index)
 Returns the specified normal.
bool DoesMapChannelExist (int ch)
void TriangulatePolygons ()
 Sets the info for the polygon triangulation.
TriMeshGetTriMesh ()
 Returns a TriMesh.
void DeleteFaces (std::vector< bool > faces_to_delete)
 Deletes the specified faces.
int AppendVerts (std::vector< GMT::Point3F > new_verts)
 Append new verts.
void DetachFaces ()
 Detach the selected faces.
void DeleteThis ()
 Deletes this class and all its members.
int Save (SceneSave *scene_save)
 Saves the info for this class.
int Load (SceneLoad *scene_load)
 Loads the info for this class.

Public Attributes

int num_verts
 The number of verts for this mesh.
int num_faces
 The number of faces for this mesh.
int use_smoothing_groups
 Please add comments here.
std::vector< PolyUVWMesh * > uvw_meshes
Vertverts
 The array to store the vertex info.
PolyFacefaces
 The array to store the faces info.
int num_normals
 The number of normals for this mesh.
GMT::Point3F * normals
 The array to store the normals info.
int num_normal_faces
 The size of the array of normal faces. This must be the same as the number of faces, if not, the normals should be rebuilt.
Polynormal_faces
 The array to store the normal faces info.


Detailed Description

This class describes a Mesh which all his faces are polygons.

Please add comments here


Member Enumeration Documentation

enum ScEng::PolyMesh::FLAGS

Enum FLAGS Enum all the possible states for this PolyMesh

Enumerator:
USER  User flags


Constructor & Destructor Documentation

ScEng::PolyMesh::PolyMesh ( TriMesh tri_mesh  ) 

Constructor Creates a PolyMesh using the given TriMesh


Member Function Documentation

void ScEng::PolyMesh::SetNumVerts ( int  nv  ) 

Sets the number of verts Deletes the current vertex info, sets the number of verts and allocates the memory for the verts array.

Parameters:
nv the new number of verts

void ScEng::PolyMesh::SetVertPosition ( int  i_v,
float  x,
float  y,
float  z 
)

Sets the position for a vert

Parameters:
i_v the index for the vert
x the x position for the vert
y the y position for the vert
z the z position for the vert
See also:
SetVertPosition( int i_v, GMT::Point3F v ), SetVert(int i_v, Vert new_vert)

void ScEng::PolyMesh::SetVertPosition ( int  i_v,
GMT::Point3F  v 
)

Sets the position for a vert

Parameters:
i_v the index for the vert
v the position of the vert
See also:
SetVertPosition(int i_v,float x,float y,float z), SetVert(int i_v, Vert new_vert)

void ScEng::PolyMesh::SetVert ( int  i_v,
Vert  new_vert 
)

Sets a vert

Parameters:
i_v the index for the vert
new_vert the new Vert to be set

Vert ScEng::PolyMesh::GetVert ( int  i_v  ) 

Returns the specified vert

Parameters:
i_v the index for the vertex
Returns:
Returns the specified Vert

GMT::Point3F ScEng::PolyMesh::GetVertPosition ( int  i_v  ) 

Returns the position of the specified vert

Parameters:
i_v the index for the vertex
Returns:
The position of the vert

void ScEng::PolyMesh::SetNumFaces ( int  nf  ) 

Sets the number of faces Deletes the current faces info, sets the number of faces and allocates the memory for the faces array.

Parameters:
nf the new number of faces

void ScEng::PolyMesh::SetFaceVert ( int  face,
int  vertex_index,
int  vertex 
)

Sets one vertex for the specified face

Parameters:
face the index for the face
vertex_index the id for one of the verts in the verts array of the face
vertex_index the id for one of the verts in the verts array of the mesh

void ScEng::PolyMesh::SetFaceDeg ( int  face,
int  deg 
)

Sets the deg for the specified face

Parameters:
face the index for the face
deg the degree for the face

int ScEng::PolyMesh::GetFaceVert ( int  face,
int  vertex_index 
)

Returns one vertex of the specified face.

Parameters:
face the index for the face
vertex_index the id for one of the verts in the verts array of the face

int ScEng::PolyMesh::GetFaceDeg ( int  face  ) 

Returns the deg for the specified face.

Parameters:
face the index for the face

void ScEng::PolyMesh::SetNumTVerts ( int  i_m,
int  nv 
)

Sets the number of tverts.

Sets the number of tverts for the specified PolyUVWMesh

Parameters:
i_m the index for the PolyUVWMesh
nv the number of vertex to be set
See also:
PolyUVWMesh::SetNumTVerts(int n_tv)

int ScEng::PolyMesh::GetNumTVerts ( int  i_m  ) 

Returns the number of tverts.

Parameters:
i_m The index for the PolyUVWMesh
Returns:
Returns the number of tverts for the specified PolyUVWMesh

GMT::Point3F ScEng::PolyMesh::GetTVertPosition ( int  i_m,
int  i_v 
)

Returns the position of an specific tvert.

Parameters:
i_m the index for the PolyUVWMesh
i_v the index for the tvert
Returns:
Returns the position for the specified tvert
See also:
GetTVert( int i_m, int i_v )

void ScEng::PolyMesh::SetTVert ( int  i_m,
int  i_v,
float  u,
float  v,
float  w 
)

Sets a tvert.

Parameters:
i_m the index for the PolyUVWMesh
i_v the index for the tvert
u the u value for the tvert
v the v value for the tvert
w the w value for the tvert
See also:
SetTVert( int i_m, int i_v, GMT::Point3F tv )

void ScEng::PolyMesh::SetTVert ( int  i_m,
int  i_v,
GMT::Point3F  tv 
)

Sets a tvert.

Parameters:
i_m the index for the PolyUVWMesh
i_v the index for the tvert
tv the uvw values for the tvert

void ScEng::PolyMesh::SetNumTFaces ( int  i_m,
int  nf 
)

Sets the number of tfaces.

Sets the number of tfaces for the specified PolyUVWMesh.

Parameters:
i_m the index for the PolyUVWMesh
nf the number of tfaces

int ScEng::PolyMesh::GetNumTFaces ( int  i_m  ) 

Returns the number of tfaces.

Parameters:
i_m the index of the PolyUVWMesh
Returns:
Returns the number of faces for the specified PolyUVWMesh

void ScEng::PolyMesh::SetNumUVWMeshes ( int  new_num_uvm  ) 

Sets the number of UVWMeshes.

Resizes the UVW mesh channels. If the new number of channels is greater than the old number of channels, this method creates the new channels. If the new number of channels is less than the old number of channels this method deletes the old channels that are not needed.

Parameters:
new_num_uvm the new number of UVWMeshes

int ScEng::PolyMesh::GetNumUVWMeshes (  ) 

Gets the number of UVWMeshes.

Returns the number of UVW channels.

void ScEng::PolyMesh::SetNumNormals ( int  nn  ) 

Sets the number of normals.

Deletes the current normals info, sets the number of normals and allocates the memory for the normals array.

Parameters:
nn the new number of normals

void ScEng::PolyMesh::SetNumNormalFaces (  ) 

Sets the number of normal faces.

Deletes the current normal faces info, sets the number of normal faces and allocates the memory for the normal faces array.

void ScEng::PolyMesh::SetNormalFace ( int  i_f,
int  i_v,
int  id 
)

Sets the info for a normal face.

Parameters:
i_f the index for the normal face
i_v the index for the vertex in the normal faces's verts array
id the index for the vertex in the PolyMesh's verts array

void ScEng::PolyMesh::SetNormal ( int  id,
float  x,
float  y,
float  z 
)

Sets a normal.

Parameters:
id the index for the normal
x the x value for the normal
y the y value for the normal
z the z value for the normal
See also:
SetNormal( int id, GMT::Point3F n )

void ScEng::PolyMesh::SetNormal ( int  id,
GMT::Point3F  n 
)

Sets a normal.

Parameters:
id the index for the normal
n the normal vector
See also:
SetNormal( int id, float x, float y, float z )

bool ScEng::PolyMesh::DoesMapChannelExist ( int  ch  ) 

Does this mapping channel exist? Returns true is the mapping channel exists.

Parameters:
ch Specifies the uvw channel

void ScEng::PolyMesh::TriangulatePolygons (  ) 

Sets the info for the polygon triangulation.

Please add comments here

TriMesh * ScEng::PolyMesh::GetTriMesh (  ) 

Returns a TriMesh.

Using the triangulation info, this function creates a triangular mesh an return it.

void ScEng::PolyMesh::DeleteFaces ( std::vector< bool >  faces_to_delete  ) 

Deletes the specified faces.

Parameters:
faces_to_delete the array with the faces to be deleted.

int ScEng::PolyMesh::AppendVerts ( std::vector< GMT::Point3F >  new_verts  ) 

Append new verts.

Parameters:
new_verts the verts to be appended
Returns:
Return the index for the first vertex appended


Member Data Documentation

std::vector<PolyUVWMesh*> ScEng::PolyMesh::uvw_meshes

An array to hold the info for the UVW coords for this mesh Please add comments here


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 10:49:23 2007 for SceneEngine by  doxygen 1.5.1-p1