curve to pass through a point.
More...
#include <through_constraint.h>
Class diagram for through_constraint:

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... | |
![]() | ![]() | curve* | constrained_curve (void) |
![]() | ![]() | const curve* | constrained_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... | |
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.
| through_constraint::through_constraint (const double u, const double ox = 0.0, const double oy = 0.0) |
The only constructor for a through_constraint.
| 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
|
this->points()[0] itself.
assert( 0.0 < u ).
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.
| tol | is a dimensionless calculation tolerance. |
| p | are the point positions. |
| e | the energy. |
| dedp |
is the rate of change of energy with position.
|
assert( 3 <= p.size() ); assert( 0 < tol && tol < 1 );
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.
void assoc (through_constraint & tc, curve & cu, vector2 & p) [friend]
|
Associates a through_constraint with the point and curve it constrains.
assert( !tc.constrained_curve() ); assert( tc.points().empty() ); assert( 2 <= cu.param.size() );
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.
assert( !tc.constrained_curve() ); assert( c.points().empty() );
| 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.
1.0.0 written by Dimitri van Heesch,
© 1997-1999