Main Page   Namespace List   Class Hierarchy   Compound List   File List   Header Files   Sources   Namespace Members   Compound Members   File Members  

through_constraint Class Reference

Constrain a curve to pass through a point. More...

#include <through_constraint.h>

Class diagram for through_constraint:

constraint

List of all members.


Public Members

 through_constraint ( const double u, const double ox = 0.0, const double oy = 0.0 )
The only constructor for a through_constraint. More...

virtual ~through_constraint (void)
virtual void energy ( const double tol, const vector< vector2 > &p, double &e, vector< vector2 > &dedp ) const
Calculate a dimensionless measure of the potential energy (e) of the constraint. More...

curveconstrained_curve (void)
const curveconstrained_curve (void) const
double x
The x coordinate of the offset of the point that the curve should pass through.

double y
The y coordinate of the offset of the point that the curve should pass through.


Friends

void assoc ( through_constraint &tc, curve &cu, vector2 &p )
Associates a through_constraint with the point and curve it constrains. More...

void unassoc ( through_constraint &c )
Disassociates a through_constraint from the point and curve it constrains. More...


Detailed Description

Constrain a curve to pass through a point.

(this->points()[0]+vector2(this->x,this->y)) is the point the curve should pass through. this->points()[1] is the start of the curve. this->points()[2] is the end of the curve. The remaining points are the parameters of the curve.

Definition at line 48 of file through_constraint.h.


Member Function Documentation

through_constraint::through_constraint (const double u, const double ox = 0.0, const double oy = 0.0)

The only constructor for a through_constraint.

Parameters:
u   the degree of uncertainty of the constraint
ox   the x coordinate offset of the point that the curve must pass through
oy   the y coordinate offset of the point that the curve must pass through

An offset of (0,0) corresponds to the requirement that the curve pass through the point this->points()[0] itself.

Preconditions:
 assert( 0.0 < u ).

Postconditions:
 assert( this->uncertainty() == u );
 assert( this->points().empty() );
 assert( !this->constrained_curve() );
 assert( this->x == ox );
 assert( this->y == oy );

Definition at line 42 of file through_constraint.cpp.

through_constraint::~through_constraint (void) [virtual]

Definition at line 65 of file through_constraint.cpp.

void through_constraint::energy (const double tol, const vector<vector2>& p, double & e, vector<vector2>& dedp) const [virtual]

Calculate a dimensionless measure of the potential energy (e) of the constraint.

This is equivalent to a measure of how poorly the constraint is satisfied. If *(this->points()[i]) had position p[i], it calculates the energy (e) and the rates of change of that energy (dedp) with respect to the point positions. Larger values indicate the constraint is less well satisfied. 0 is the minimum possible energy, and energy <= 1 indicates that the constraint is satisfied to within the uncertainty of the constraint.

Parameters:
tol   is a dimensionless calculation tolerance.
p   are the point positions.
Return values:
e   the energy.
dedp   is the rate of change of energy with position.

Preconditions:
 assert( 3 <= p.size() );
 assert( 0 < tol && tol < 1 );

Postconditions:
 assert( dedp.size() == p.size() );

Reimplemented from constraint.

Definition at line 72 of file through_constraint.cpp.

curve * through_constraint::constrained_curve (void) [inline]

Definition at line 163 of file through_constraint.h.

const curve * through_constraint::constrained_curve (void) const [inline]

Definition at line 170 of file through_constraint.h.


Friends And Related Function Documentation

void assoc (through_constraint & tc, curve & cu, vector2 & p) [friend]

Associates a through_constraint with the point and curve it constrains.

Preconditions:
 assert( !tc.constrained_curve() );
 assert( tc.points().empty() );
 assert( 2 <= cu.param.size() );

Postconditions:
 assert( tc.constrained_curve() == &cu );
 assert( tc.points()[0] == &p );
 assert( tc.points().size() == cu.param.size()+1 );
 tc.points[i+1] == tc.param[i] for i in [0 .. tc.param.size()-1];

Definition at line 155 of file through_constraint.h.

void unassoc (through_constraint & c) [friend]

Disassociates a through_constraint from the point and curve it constrains.

Postconditions:
 assert( !tc.constrained_curve() );
 assert( c.points().empty() );

Member Data Documentation

double through_constraint::x

The x coordinate of the offset of the point that the curve should pass through.

Definition at line 93 of file through_constraint.h.

double through_constraint::y

The y coordinate of the offset of the point that the curve should pass through.

Definition at line 99 of file through_constraint.h.


The documentation for this class was generated from the following files:
Generated at Sun Jul 14 20:38:21 2002 for Mapper by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999