GEE_TriangleMesh Class Reference
A triangle mesh model.
More...
#include <gee_triangle_mesh.h>
Inheritance diagram for GEE_TriangleMesh:
[legend]Collaboration diagram for GEE_TriangleMesh:
[legend]List of all members.Public Types
Public Member Functions
- GEE_TriangleMesh ()
- virtual ~GEE_TriangleMesh ()
- virtual GEE_Geometry * clone () const
- Clone this object, creating an equivalent independent object.
- virtual bool eraseData (GEE_Containment *)
- A virtual function that should be overridden to enable us to generically delete data within some volume.
- virtual bool intersects (GEE_Containment *)
- virtual void selectVertices (GEE_Containment *, uint mask, uint values)
- virtual void selectFaces (GEE_Containment *, uint mask, uint values)
- virtual bool colorData (GEE_ReColor *)
- Color the vertices.
- virtual bool moveData (GEE_Mover *)
- virtual void render (GEE_Renderer *)
- Render this object with the renderer.
- virtual bool getBoundingBox (VEE_BoundingBox *)
- Get the bounding box of this data set.
- virtual bool move (const VEE_Vector3 &offset)
- Moves the data elements by some offset.
- virtual bool smooth (GEE_Containment *)
- virtual bool read (GEE_Io *)
- Reads the data from a given file.
- virtual bool write (GEE_Io *)
- Reads the data from a given stream.
- GEE_Geometry * removeData (const VEE_Vector3 &loc, float radius)
- void clear ()
- int addVertex (const GEE_PolygonVertex &)
- Adds a new vertex point to the mesh and returns the index number of the vertex.
- void setVertex (int, const GEE_PolygonVertex &)
- GEE_PolygonVertex * getVertex (int)
- Returns a vertex (or NULL if not found).
- bool removeVertex (int index)
- Removes a vertex.
- uint vertexCounter () const
- int addTriangle (const GEE_TriangleIndices &, int id=-1)
- Adds a triangle and returns its index.
- GEE_TriangleIndices * getTriangle (int)
- Gets a triangle with some id.
- triangleIterator beginTriangle ()
- triangleIterator endTriangle ()
- uint triangleCount () const
- vertexIterator beginVertex ()
- vertexIterator endVertex ()
- uint vertexCount () const
- void autoNormalize ()
- Recalculate the normals at each vertex (assuming that the model is smooth).
- void normalizeVertex (vertexIterator &it, bool adjustGeneration=true)
- Calculates the vertex normal based on the triangles that are connected to the vertex.
- bool normalizeVertex (int index, bool adjustGeneration=true)
- void createRectangularGrid (uint xdivision, uint ydivision, float width=1.0f, float height=1.0f)
- void setUseStrips (bool useStrips)
- bool useStrips () const
- void vertexWasMoved (const VEE_Vector3 &newLocation)
- Tells the mesh that some of its vertices were moved by an outside agent.
- VEE_Vector3 triangleNormal (int, int)
- Returns the unnormalized triangle normal (calculated from the vertex locations).
- float vertexWrinkliness (int vertex)
- float vertexWrinklinessLinked (int vertex)
- Returns the wrinkliness of this vertex plus the wrinkliness of all connected vertices.
- VEE_Vector3 smoothVertex (int vertex, float effect)
- The vertex smoother works by using the gradient method to pull the vertex towards optimal locations.
- VEE_Vector3 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 & list ()
- bool genList ()
- Updates the display list if necessary.
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
Constructor & Destructor Documentation
GEE_TriangleMesh::GEE_TriangleMesh |
( |
|
) |
|
|
GEE_TriangleMesh::~GEE_TriangleMesh |
( |
|
) |
[virtual] |
|
Member Function Documentation
|
Clone this object, creating an equivalent independent object.
Reimplemented from GEE_Geometry. |
|
A virtual function that should be overridden to enable us to generically delete data within some volume.
Reimplemented from GEE_Geometry. |
void GEE_TriangleMesh::selectVertices |
( |
GEE_Containment * |
, |
|
|
uint |
mask, |
|
|
uint |
values |
|
) |
[virtual] |
|
void GEE_TriangleMesh::selectFaces |
( |
GEE_Containment * |
, |
|
|
uint |
mask, |
|
|
uint |
values |
|
) |
[virtual] |
|
bool GEE_TriangleMesh::colorData |
( |
GEE_ReColor * |
|
) |
[virtual] |
|
bool GEE_TriangleMesh::moveData |
( |
GEE_Mover * |
|
) |
[virtual] |
|
|
Render this object with the renderer.
Reimplemented from GEE_Geometry. |
|
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::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. |
void GEE_TriangleMesh::clear |
( |
|
) |
|
|
|
Adds a new vertex point to the mesh and returns the index number of the vertex.
|
|
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] |
|
|
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. |
|
Gets a triangle with some id.
Returns NULL if the triangle is not found. |
uint GEE_TriangleMesh::triangleCount |
( |
|
) |
const [inline] |
|
uint GEE_TriangleMesh::vertexCount |
( |
|
) |
const [inline] |
|
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: |
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.
|
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::eraseTriangleInternal |
( |
int |
tri |
) |
[inline, protected] |
|
|
Erase a triangle without checking if it is necessary to do any other cleanups.
|
Member Data Documentation
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
1.4.6