Inherits qglviewer::Constraint.
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 |
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.
|
Create an empty TriangleSetConstraint. currentTriangle() set to 0. |
|
Virtual empty destructor. |
|
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(). |
|
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()). |
|
Constrain the translation Reimplemented from qglviewer::Constraint. |
|
The index of the triangle the frame is currently on. Changes as the frame moves on the triangle set. |
|
The current value of epsilon, used to determine identical points in addPoint(). |
|
Returns the index of point |
|
Returns the adjacent triangle of triangle |
|
Returns the coordinates of the point at |
|
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(). |
|
Set the current value of epsilon, used to determine identical points in addPoint(). Default value is 0.0. |
|
Returns the index of the |