TriangleSet Class Reference

Container for Triangle objects. More...

#include <TriangleSet.h>

List of all members.

Public Member Functions

void add (Triangle *triangle)
 Add copy of triangle to container.
void add (TriangleSet *tset)
 Add copy of triangles to container.
size_t count ()
 Return current count of triangle stored in container.
Triangleoperator[] (unsigned index)
 Access triangle using its index.

Static Public Member Functions

static float distance (Vertex a, Vertex b)
 Compute distance of two vertexes.
static Vertex centre (Vertex a, Vertex b)
 Compute center of two vertexes.
template<int QUALITY>
static float size (Triangle *triangle)
 Compute triangle size.
static TriangleSetdivide (Triangle *triangle)
 Divide triangle to 4 triangles, each with 1/4 area.


Detailed Description

Container for Triangle objects.

There are also static methods to deal with Triangle object and its components to leave Triangle structure as POD.

Definition at line 25 of file TriangleSet.h.


Member Function Documentation

static float TriangleSet::distance ( Vertex  a,
Vertex  b 
) [inline, static]

Compute distance of two vertexes.

Parameters:
a Vertex a.
b Vertex b.
Returns:
Return distance of vertexes a and b.

Definition at line 33 of file TriangleSet.h.

References Vertex::x, Vertex::y, and Vertex::z.

static Vertex TriangleSet::centre ( Vertex  a,
Vertex  b 
) [inline, static]

Compute center of two vertexes.

Note:
Used for patch division.
Parameters:
a Vertex a.
b Vertex b.
Returns:
Return center of vertexes a and b as Vertex.

Definition at line 48 of file TriangleSet.h.

References Vertex::x, Vertex::y, and Vertex::z.

void TriangleSet::add ( Triangle triangle  ) 

Add copy of triangle to container.

Note:
There is no need to keep Triangle object in memory outside this class.
Parameters:
triangle Pointer to triangle to copy to container.

void TriangleSet::add ( TriangleSet tset  ) 

Add copy of triangles to container.

Note:
There is no need to keep Triangle objects in memory outside this class.
Parameters:
tset Pointer to TriangleSet containing source triangles.

size_t TriangleSet::count (  ) 

Return current count of triangle stored in container.

Returns:
Return current count of triangle stored in container.

Triangle& TriangleSet::operator[] ( unsigned  index  ) 

Access triangle using its index.

Parameters:
index Index of triangle - must be in range <0, count()-1>.
Returns:
Return reference to desired triangle.

float TriangleSet::size< 1 > ( Triangle triangle  )  [inline, static]

Compute triangle size.

Template parameter QUALITY Switch algorithm to express triangle size (0 - girth, 1 - area). There are two way to express triangle size - girth and area. The 1st is faster, the 2nd is realistic.

Parameters:
triangle Triangle to compute.
Returns:
Return triangle size using selected algorithm.

static TriangleSet* TriangleSet::divide ( Triangle triangle  )  [static]

Divide triangle to 4 triangles, each with 1/4 area.

Note:
Vertex oriantation is kept.
Parameters:
triangle Pointer to triangle to divide.
Returns:
Return TriangleSet object (allocated on the heap) containing 4 triangles.


The documentation for this class was generated from the following file:
Generated on Thu Dec 6 19:33:12 2007 for Radiosity Renderer and Visualizer by  doxygen 1.5.2