ScEng::TriMesh Class Reference

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

#include <trimesh.h>

List of all members.

Public Types

enum  FLAGS { USE_SPECIFIED_NORMALS = (1<<0), USER = (1<<16) }
 Enum FLAGS. More...

Public Member Functions

 TriMesh ()
 Constructor.
 ~TriMesh ()
 Destructor.
void SetNumVerts (int nv)
 Sets the number of verts.
int GetNumVerts ()
 Returns the number of verts.
void SetNumNormalFaces ()
 Sets the number of normal faces.
int GetNumNormalFaces ()
 Returns the number of normal faces.
TriFace GetFace (int i)
 Returns the specified face.
void SetFace (int i_f, TriFace new_face)
 Sets the specified face.
void SetNumFaces (int nf)
 Sets the number of faces.
void SetFaceVert (int face, int vertex_index, int vertex)
 Sets one vertex for the specified face.
void SetFaceDeg (int face, int deg)
 All the faces of a TriMesh have a degree of three.
int GetFaceVert (int face, int vertex_index)
 Returns one vertex of the specified face.
int GetFaceDeg (int face)
 All the faces of a TriMesh have a degree of three.
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 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 ReplaceFaceVert (int face, int v1, int v2)
 Replaces one vert for the other in the specified face.
int GetNumFaces ()
 Returns the number of faces.
void SetNumNormals (int nn)
void SetNormal (int i_n, GMT::Point3F normal)
int GetNumNormals ()
 Returns the number of normals.
GMT::Point3F GetNormal (int index)
 Returns the specified normal.
void SetNormalFace (int i_f, int i_v, int id)
void SetNormalFace (int i_f, Tri n)
void SetNormalFace (int i_f, int n0, int n1, int n2)
Tri GetNormalFace (int i_f)
 Returns the specified normal face.
int GetNormalFaceIndex (int face, int n)
 Returns the normal index for the normal 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 texture faces.
void SetTFace (int i_m, int i_f, int v0, int v1, int v2)
 Sets a TFace.
void SetTFace (int i_m, int i_f, int id, int v)
 Sets a TFace.
TriUVWFace GetTFace (int i_m, int i_f)
 Returns a specific TFace.
void SetVertPosition (int i_v, float x, float y, float z)
 Sets the postion for a vert.
void SetVertPosition (int i_v, GMT::Point3F p3)
 Sets the postion for a vert.
void SetVert (int i_v, Vert new_vert)
 Sets a vert.
GMT::Point3F GetVertPosition (int i_v)
 Returns the position of the specified vert.
Vert GetVert (int i_v)
 Returns the specified vert.
void SetNumUVWMeshes (int new_num_uvm)
int GetNumUVWMeshes ()
bool DoesMapChannelExist (int ch)
bool AddMapChannel (int ch)
void BuildTangentSpace (int ch, GMT::Matrix3F node_tm)
void DeleteFaces (std::vector< bool > &faces_to_delete, std::vector< bool > *isolated_verts=NULL)
void DeleteVerts (std::vector< bool > &verts_to_delete)
int AppendVerts (std::vector< GMT::Point3F > new_verts)
int AppendNormals (std::vector< GMT::Point3F > new_normals)
TriMeshDetachFaces (std::vector< bool > &faces_to_detach, bool as_mesh, bool delete_faces)
 Detach the selected faces.
void AttachFaces (TriMesh *other_mesh, GMT::Matrix3F tm)
void ExtrudeFaces (float distance)
 Extrudes the selected faces.
void CloneFaces (std::vector< bool > &faces_to_clone)
void CopyFromTriMesh (TriMesh *mesh)
 Copy the elements from other TriMesh.
void DeleteThis ()
 Deletes this class.
int Save (SceneSave *scene_save)
 Saves the info for this class.
int Load (SceneLoad *scene_load)
 Loads the info for this class.
PolyMeshGetPolyMesh ()
 Creates a PolyMesh by grouping all faces with common hidden edges into PolyFaces.

Public Attributes

int num_verts
 The number of verts.
int num_faces
 The number of faces.
Vertverts
 The array of verts.
TriFacefaces
 The array of faces.
std::vector< TriUVWMesh * > uvw_meshes
 The array with te UVWMeshes.
int num_normals
 The number of normals.
GMT::Point3F * normals
 The array with the normals.
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.
Trinormal_faces
 The array with the normal faces.


Detailed Description

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

Please add comments here


Member Enumeration Documentation

enum ScEng::TriMesh::FLAGS

Enum FLAGS.

Enum all the possible states for this TriMesh

Enumerator:
USE_SPECIFIED_NORMALS  Defines if this mesh uses the normals arrays, if true it'd never builds the normals unless the topology changes
USER  User flags


Constructor & Destructor Documentation

ScEng::TriMesh::TriMesh (  ) 

Constructor.

Sets all arrays to NULL

ScEng::TriMesh::~TriMesh (  ) 

Destructor.

Calls DeleteThis


Member Function Documentation

void ScEng::TriMesh::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::TriMesh::SetNumNormalFaces (  ) 

Sets the number of normal faces.

Sets the number of normal faces and allocates the necessary memory, using for this the number of faces.

void ScEng::TriMesh::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::TriMesh::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

int ScEng::TriMesh::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::TriMesh::GetFaceDeg ( int  face  ) 

All the faces of a TriMesh have a degree of three.

Returns:
Return 3

void ScEng::TriMesh::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::TriMesh::SetNormal ( int  i_n,
GMT::Point3F  normal 
)

Sets a normal

Parameters:
i_n the index for the normal
nn the normal vector

void ScEng::TriMesh::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 TriMesh's verts array

void ScEng::TriMesh::SetNormalFace ( int  i_f,
Tri  n 
)

Sets the info for a normal face

Parameters:
i_f the index for the normal face
n the triangel with the normal face info

void ScEng::TriMesh::SetNormalFace ( int  i_f,
int  n0,
int  n1,
int  n2 
)

Sets the info for a normal face

Parameters:
i_f the index for the normal face
n0 the first normal for this face
n1 the second normal for this face
n2 the third normal for this face

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

Sets the number of tverts.

Sets the number of tverts for the specified TriUVWMesh

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

int ScEng::TriMesh::GetNumTVerts ( int  i_m  ) 

Returns the number of tverts.

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

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

Returns the position of an specific tvert.

Parameters:
i_m the index for the TriUVWMesh
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::TriMesh::SetTVert ( int  i_m,
int  i_v,
float  u,
float  v,
float  w 
)

Sets a tvert.

Parameters:
i_m the index for the TriUVWMesh
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

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

Sets a tvert.

Parameters:
i_m the index for the TriUVWMesh
i_v the index for the tvert
tv the texture vertex

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

Sets the number of tfaces.

Sets the number of tfaces for the specified TriUVWMesh.

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

int ScEng::TriMesh::GetNumTFaces ( int  i_m  ) 

Returns the number of texture faces.

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

void ScEng::TriMesh::SetTFace ( int  i_m,
int  i_f,
int  v0,
int  v1,
int  v2 
)

Sets a TFace.

Parameters:
i_m the index for the TriUVWMesh
i_f the index for the face
v0 the first vertex for this face
v1 the second vertex for this face
v2 the third vertex for this face

void ScEng::TriMesh::SetTFace ( int  i_m,
int  i_f,
int  id,
int  v 
)

Sets a TFace.

Parameters:
i_m the index for the TriUVWMesh
i_f the index for the face
id the index for the vertex into the face's verts array
v the index for the vertex into the TriMesh's verts array

TriUVWFace ScEng::TriMesh::GetTFace ( int  i_m,
int  i_f 
)

Returns a specific TFace.

Parameters:
i_m the index for the TriUVWMesh
i_f the index for the face

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

Sets the postion 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::TriMesh::SetVertPosition ( int  i_v,
GMT::Point3F  p3 
)

Sets the postion for a vert.

Parameters:
i_v the index for the vert
p3 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::TriMesh::SetVert ( int  i_v,
Vert  new_vert 
)

Sets a vert.

Parameters:
i_v the index for the vert
new_vert the Vert to be set
See also:
SetVertPosition( int i_v, float x, float y, float z ), SetVertPosition( int i_v, GMT::Point3F p3 )

GMT::Point3F ScEng::TriMesh::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

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

Returns the specified vert.

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

void ScEng::TriMesh::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::TriMesh::GetNumUVWMeshes (  ) 

Gets the number of UVWMeshes Returns the number of UVW channels.

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

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

Parameters:
ch Specifies the uvw channel

bool ScEng::TriMesh::AddMapChannel ( int  ch  ) 

Creates a new UVW Mesh into the map channel.

Parameters:
ch the uvw channel return Returns true if the uvw mesh was created, false if it wasn't.

void ScEng::TriMesh::BuildTangentSpace ( int  ch,
GMT::Matrix3F  node_tm 
)

Builds the tangent space for the specified mapping channel. Builds the tangent space for the specified mapping channel.

Parameters:
ch Specifies the uvw channel
node_tm the node's transform matrix.

void ScEng::TriMesh::DeleteFaces ( std::vector< bool > &  faces_to_delete,
std::vector< bool > *  isolated_verts = NULL 
)

Deletes the specified faces

Parameters:
faces_to_delete the array with the faces to be deleted.
Returns:
Returns an array of isolated verts

void ScEng::TriMesh::DeleteVerts ( std::vector< bool > &  verts_to_delete  ) 

Deletes the specified verts

Parameters:
verts_to_delete the array with the verts to be deleted.

int ScEng::TriMesh::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

int ScEng::TriMesh::AppendNormals ( std::vector< GMT::Point3F >  new_normals  ) 

Append new normals

Parameters:
new_normals the normals to be appended
Returns:
Return the index for the first normal appended

void ScEng::TriMesh::AttachFaces ( TriMesh other_mesh,
GMT::Matrix3F  tm 
)

Attach a new mesh to this one

Parameters:
other_mesh the mesh to be attached

void ScEng::TriMesh::CloneFaces ( std::vector< bool > &  faces_to_clone  ) 

Make a clone for the given faces

Parameters:
faces_to_clone a bool vector with the size of the faces. If the i position is true then that face will be cloned


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