GEE_TriangleMesh Class Reference

A triangle mesh model. More...

#include <gee_triangle_mesh.h>

Inheritance diagram for GEE_TriangleMesh:

Inheritance graph
[legend]
Collaboration diagram for GEE_TriangleMesh:

Collaboration graph
[legend]
List of all members.

Public Types

Public Member Functions

Static Public Member Functions

Protected Member Functions

Protected Attributes


Detailed Description

A triangle mesh model.

The mesh has a collection of indexed vertices that define the location, normal etc of each vertex (see GEE_PolygonVertex). The triangles are defined by indexing three vertices. The triangles are also indexed.

One can use triangle strips with this mesh. All triangles have a single flag that indicates if the next triangle is part of the same strip. There is also one mesh-specific flag that indicates if one should render the triangles as a strip.

The indexing can be sparse - one can have vertices 0, 1, 2, 7 and 987937 without any negative side effects.

Author:
Tommi Ilmonen


Member Typedef Documentation

typedef std::map<int, GEE_PolygonVertex>::iterator GEE_TriangleMesh::vertexIterator
 

typedef std::map<int, GEE_TriangleIndices>::iterator GEE_TriangleMesh::triangleIterator
 


Constructor & Destructor Documentation

GEE_TriangleMesh::GEE_TriangleMesh  ) 
 

GEE_TriangleMesh::~GEE_TriangleMesh  )  [virtual]
 


Member Function Documentation

GEE_Geometry * GEE_TriangleMesh::create  )  [static]
 

GEE_Geometry * GEE_TriangleMesh::clone  )  const [virtual]
 

Clone this object, creating an equivalent independent object.

Reimplemented from GEE_Geometry.

bool GEE_TriangleMesh::eraseData GEE_Containment  )  [virtual]
 

A virtual function that should be overridden to enable us to generically delete data within some volume.

Reimplemented from GEE_Geometry.

bool GEE_TriangleMesh::intersects GEE_Containment  )  [virtual]
 

Reimplemented from GEE_Geometry.

void GEE_TriangleMesh::selectVertices GEE_Containment ,
uint  mask,
uint  values
[virtual]
 

Reimplemented from GEE_Geometry.

void GEE_TriangleMesh::selectFaces GEE_Containment ,
uint  mask,
uint  values
[virtual]
 

Reimplemented from GEE_Geometry.

bool GEE_TriangleMesh::colorData GEE_ReColor  )  [virtual]
 

Color the vertices.

Reimplemented from GEE_Geometry.

bool GEE_TriangleMesh::moveData GEE_Mover  )  [virtual]
 

Reimplemented from GEE_Geometry.

void GEE_TriangleMesh::render GEE_Renderer  )  [virtual]
 

Render this object with the renderer.

Reimplemented from GEE_Geometry.

bool GEE_TriangleMesh::getBoundingBox VEE_BoundingBox  )  [virtual]
 

Get the bounding box of this data set.

Reimplemented from GEE_Geometry.

bool GEE_TriangleMesh::move const VEE_Vector3 offset  )  [virtual]
 

Moves the data elements by some offset.

Reimplemented from GEE_Geometry.

bool GEE_TriangleMesh::smooth GEE_Containment  )  [virtual]
 

bool GEE_TriangleMesh::read GEE_Io  )  [virtual]
 

Reads the data from a given file.

Reimplemented from GEE_Geometry.

bool GEE_TriangleMesh::write GEE_Io  )  [virtual]
 

Reads the data from a given stream.

Reimplemented from GEE_Geometry.

GEE_Geometry * GEE_TriangleMesh::removeData const VEE_Vector3 loc,
float  radius
 

void GEE_TriangleMesh::clear  ) 
 

int GEE_TriangleMesh::addVertex const GEE_PolygonVertex  ) 
 

Adds a new vertex point to the mesh and returns the index number of the vertex.

void GEE_TriangleMesh::setVertex int  ,
const GEE_PolygonVertex
 

GEE_PolygonVertex * GEE_TriangleMesh::getVertex int   )  [inline]
 

Returns a vertex (or NULL if not found).

bool GEE_TriangleMesh::removeVertex int  id  ) 
 

Removes a vertex.

Returns true if the operation was successful. Automatically erases also the triangles that did include this vertex.

Author:
Tommi Ilmonen

uint GEE_TriangleMesh::vertexCounter  )  const [inline]
 

int GEE_TriangleMesh::addTriangle const GEE_TriangleIndices tri,
int  id = -1
 

Adds a triangle and returns its index.

If the vertices of the triangle do not exist, then -1 returned and the triangle is not added.

GEE_TriangleIndices * GEE_TriangleMesh::getTriangle int  id  ) 
 

Gets a triangle with some id.

Returns NULL if the triangle is not found.

triangleIterator GEE_TriangleMesh::beginTriangle  )  [inline]
 

triangleIterator GEE_TriangleMesh::endTriangle  )  [inline]
 

uint GEE_TriangleMesh::triangleCount  )  const [inline]
 

vertexIterator GEE_TriangleMesh::beginVertex  )  [inline]
 

vertexIterator GEE_TriangleMesh::endVertex  )  [inline]
 

uint GEE_TriangleMesh::vertexCount  )  const [inline]
 

static GEE_TriangleIndices& GEE_TriangleMesh::getTriangle triangleIterator it  )  [inline, static]
 

void GEE_TriangleMesh::autoNormalize  ) 
 

Recalculate the normals at each vertex (assuming that the model is smooth).

void GEE_TriangleMesh::normalizeVertex vertexIterator it,
bool  adjustGeneration = true
 

Calculates the vertex normal based on the triangles that are connected to the vertex.

bool GEE_TriangleMesh::normalizeVertex int  index,
bool  adjustGeneration = true
[inline]
 

void GEE_TriangleMesh::createRectangularGrid uint  xdivision,
uint  ydivision,
float  width = 1.0f,
float  height = 1.0f
 

First create the vertices:

Now create triangle strips:

static GEE_TriangleMesh* GEE_TriangleMesh::cast GEE_Geometry d  )  [inline, static]
 

void GEE_TriangleMesh::setUseStrips bool  useStrips  )  [inline]
 

bool GEE_TriangleMesh::useStrips  )  const [inline]
 

void GEE_TriangleMesh::vertexWasMoved const VEE_Vector3 newLocation  )  [inline]
 

Tells the mesh that some of its vertices were moved by an outside agent.

Updates

VEE_Vector3 GEE_TriangleMesh::triangleNormal int  ,
int 
 

Returns the unnormalized triangle normal (calculated from the vertex locations).

float GEE_TriangleMesh::vertexWrinkliness int  vertex  ) 
 

float GEE_TriangleMesh::vertexWrinklinessLinked int  vertex  ) 
 

Returns the wrinkliness of this vertex plus the wrinkliness of all connected vertices.

VEE_Vector3 GEE_TriangleMesh::smoothVertex int  vertex,
float  effect
 

The vertex smoother works by using the gradient method to pull the vertex towards optimal locations.

The vertex is in fact not moved, but a new proposal for a location vector is returned.

VEE_Vector3 GEE_TriangleMesh::smoothVertex2 int  vertex,
int  iterations,
float  effect
 

Moves the vertex in the direction of the normal and returns the best place on that axis.

GEE_TriMeshList& GEE_TriangleMesh::list  )  [inline]
 

bool GEE_TriangleMesh::genList  ) 
 

Updates the display list if necessary.

Returns:
True if the list is now up-to-date. False of the list could not be generated.

void GEE_TriangleMesh::listifyVertex const GEE_PolygonVertex  )  [protected]
 

void GEE_TriangleMesh::eraseTriangleInternal int  tri  )  [inline, protected]
 

Erase a triangle without checking if it is necessary to do any other cleanups.


Member Data Documentation

std::map<int, GEE_PolygonVertex> GEE_TriangleMesh::m_vertices [protected]
 

std::map<int, GEE_TriangleIndices> GEE_TriangleMesh::m_triangles [protected]
 

int GEE_TriangleMesh::m_vertexCounter [protected]
 

int GEE_TriangleMesh::m_triangleCounter [protected]
 

bool GEE_TriangleMesh::m_useStrips [protected]
 

VEE_BoundingBox GEE_TriangleMesh::m_bbox [protected]
 

GEE_TriMeshList GEE_TriangleMesh::m_list [protected]
 


The documentation for this class was generated from the following files:
Generated on Mon Mar 12 21:09:17 2007 for VEE - The Visual Effects Engine by  doxygen 1.4.6