Main Page   Class Hierarchy   Compound List   Compound Members  

qglviewer::TriangleSetConstraint Class Reference

A translation Constraint defined with respect to a set of triangles. More...

Inherits qglviewer::Constraint.

List of all members.

Public Methods

 TriangleSetConstraint ()
virtual ~TriangleSetConstraint ()
virtual void constrainTranslation (qglviewer::Vec &, Frame *const)
unsigned int addPoint (const Vec &p)
unsigned int addTriangle (const unsigned int i0, const unsigned int i1, const unsigned int i2)
int indexOfPoint (const Vec &p) const
unsigned int currentTriangle () const
void setCurrentTriangle (const unsigned int ct)
float epsilon () const
void setEpsilon (const float e)
qglviewer::Vec point (unsigned int index) const
int neighTriangle (unsigned int index, unsigned short edge) const
unsigned int trianglePoint (unsigned int index, unsigned short nb) const


Detailed Description

A translation Constraint defined with respect to a set of triangles.

Define your path (connex set of triangles) using addPoint() and addTriangle(). The frame will then be constrained to move on this path.

Devlopment version. Many things need to be cleared.


Constructor & Destructor Documentation

TriangleSetConstraint   [inline]
 

Create an empty TriangleSetConstraint. currentTriangle() set to 0.

virtual ~TriangleSetConstraint   [inline, virtual]
 

Virtual empty destructor.


Member Function Documentation

unsigned int addPoint const Vec   p
 

Add a point to the triangle set. Use addTriangle() to create a triangle with this point. Returns the index of the point in the internal list.

If this point is within a range of epsilon() around an allready entered point, the point is not added. The returned index is the one of the first point. See indexOfPoint().

unsigned int addTriangle const unsigned int    i0,
const unsigned int    i1,
const unsigned int    i2
 

Add a triangle between the three points whose indexes are given. Point are added with addPoint(), which returns their index. Returns the index of the created triangle (used by currentTriangle()).

void constrainTranslation qglviewer::Vec  ,
Frame   const
[virtual]
 

Constrain the translation trans with respect to a path defined by a triangle set. See addTriangle() and addPoint().

Reimplemented from qglviewer::Constraint.

unsigned int currentTriangle   const [inline]
 

The index of the triangle the frame is currently on. Changes as the frame moves on the triangle set.

float epsilon   const [inline]
 

The current value of epsilon, used to determine identical points in addPoint().

int indexOfPoint const Vec   p const
 

Returns the index of point in the point list. Returns -1 if not found. Two points are declared identical if their distance is lower or equal than epsilon().

int neighTriangle unsigned int    index,
unsigned short    edge
const [inline]
 

Returns the adjacent triangle of triangle index, along its edge edge.

qglviewer::Vec point unsigned int    index const [inline]
 

Returns the coordinates of the point at index.

void setCurrentTriangle const unsigned int    ct
 

Use this function to initialize the constraint. You should give the index of the triangle the frame is currently on (use setPosition() to move the frame if needed). If the constraint is lost and currentTriangle() is not valid, the frame will be positionned back to the center of the previous currentTriangle().

void setEpsilon const float    e [inline]
 

Set the current value of epsilon, used to determine identical points in addPoint(). Default value is 0.0.

unsigned int trianglePoint unsigned int    index,
unsigned short    nb
const [inline]
 

Returns the index of the nb point of triangle index.


Generated on Thu Jan 16 12:53:48 2003 for libQGLViewer by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002