In file contour/Constraints2D.h:

class AttachmentContour2DConstraint : public Constraint

a class corresponding to a force constraint where a spring force is added on a vertex attached to a fixed point

Inheritance:


Public Classes

class MissingVertex : public Exception
Exception thrown when no vertex is given to create an attachment constraint

Public Methods

virtual void apply ()
the apply fonction that adds an external force to the vertex
double getStiffness () const
returns the stiffness of the spring force
Vec2 getFixedPosition () const
returns the position where the vertex is fixed
ActiveVertexContour2D* getVertex () const
returns the vertex where the constraint is applied
void setStiffness (const double s)
sets the stiffness of the spring force
void setFixedPosition (const Vec2 &p)
sets the maximum distance between two vertices

Public

constructor
AttachmentContour2DConstraint (const Vec2 &p, const double s, ActiveVertexContour2D *v) throw(MissingVertex)
create an attachment constraint
destructor
virtual ~AttachmentContour2DConstraint (void)
empty destructor

Private Fields

Vec2 position
the position where the vertex is attached
double stiffness
the stiffness of the spring
ActiveVertexContour2D* vertex
the ActiveVertex2D that is attached to a fixed point

Documentation

a class corresponding to a force constraint where a spring force is added on a vertex attached to a fixed point
class MissingVertex: public Exception
Exception thrown when no vertex is given to create an attachment constraint

Vec2 position
the position where the vertex is attached

double stiffness
the stiffness of the spring

ActiveVertexContour2D* vertex
the ActiveVertex2D that is attached to a fixed point

virtual void apply()
the apply fonction that adds an external force to the vertex

double getStiffness() const
returns the stiffness of the spring force

Vec2 getFixedPosition() const
returns the position where the vertex is fixed

ActiveVertexContour2D* getVertex() const
returns the vertex where the constraint is applied

void setStiffness(const double s)
sets the stiffness of the spring force

void setFixedPosition(const Vec2 &p)
sets the maximum distance between two vertices

constructor

AttachmentContour2DConstraint(const Vec2 &p, const double s, ActiveVertexContour2D *v) throw(MissingVertex)
create an attachment constraint
Throws:
MissingVertex thrown when v is NULL
Parameters:
p - the 2D position to attract the vertex
s - the stiffness parameter (between 0.0 and 1.0) used to compute the attracting force
v - the vertex on which the constraint applies

destructor

virtual ~AttachmentContour2DConstraint(void)
empty destructor


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de