#include <ParamCurve.h>
Inheritance diagram for Go::ParamCurve:
Public Member Functions | |
virtual | ~ParamCurve () |
virtual destructor - ensures safe inheritance | |
virtual void | point (Point &pt, double tpar) const=0 |
Evaluate the curve's position at a given parameter. | |
virtual void | point (std::vector< Point > &pts, double tpar, int derivs, bool from_right=true) const=0 |
Evaluate the curve's position and a certain number of derivatives at a given parameter. | |
Point | point (double tpar) const |
Evaluate the curve's position at a certain parameter. | |
std::vector< Point > | point (double tpar, int derivs, bool from_right=true) const |
Evaluate the curve's position and a certain number of derivatives at a given parameter. | |
virtual double | startparam () const=0 |
Query the start parameter of the curve. | |
virtual double | endparam () const=0 |
Query the end parameter of the curve. | |
virtual void | reverseParameterDirection (bool switchparam=false)=0 |
Set the parameter direction of the curve. | |
virtual SplineCurve * | geometryCurve ()=0 |
If the definition of this ParamCurve contains a SplineCurve describing its spatial shape, then this function will return a pointer to this SplineCurve. | |
virtual bool | isDegenerate (double degenerate_epsilon)=0 |
Query whether the curve is degenerate (collapsed into a single point). | |
virtual ParamCurve * | subCurve (double from_par, double to_par, double fuzzy=DEFAULT_PARAMETER_EPSILON) const=0 |
Returns a curve which is a part of this curve. | |
virtual ParamCurve * | clone () const=0 |
The clone-function is herited from GeomObject, but overridden here to get a covariant return type (for those compilers that allow this). | |
virtual DirectionCone | directionCone () const=0 |
Creates a DirectionCone which covers all tangent directions of this curve. | |
virtual CompositeBox | compositeBox () const |
Creates a composite box enclosing the curve. | |
virtual void | appendCurve (ParamCurve *cv, bool reparam=true)=0 |
append a curve to this curve, with eventual reparametrization NB: This virtual member function currently only works for SplineCurves and CurveOnSurfaces. | |
virtual void | appendCurve (ParamCurve *cv, int continuity, double &dist, bool reparam=true)=0 |
append a curve to this curve, with eventual reparmetrization | |
double | estimatedCurveLength (int numpts=4) const |
Estimate the length of the curve, by sampling it at a certain number of points and calculating the linear approximation to the curve through these points. | |
double | estimatedCurveLength (double tmin, double tmax, int numpts=4) const |
Estimate the length of an interval of the curve, by sampling it at a certain number of points in the interval and calculating the linear approximation through these points. | |
virtual void | closestPoint (const Point &pt, double tmin, double tmax, double &clo_t, Point &clo_pt, double &clo_dist, double const *seed=0) const=0 |
Compute the closest point from an interval of this curve to a specified point. | |
void | closestPoint (const Point &pt, double &clo_t, Point &clo_pt, double &clo_dist) const |
Compute the closest point from this curve to a specified point, taking the whole curve into account (not just an interval of it). | |
virtual double | nextSegmentVal (double par, bool forward, double tol) const |
If the ParamCurve is divided up into logical segments, this function will return the parameter value of the "next segment", starting from a parameter given by the user. |
Definition at line 57 of file ParamCurve.h.
virtual void Go::ParamCurve::point | ( | Point & | pt, | |
double | tpar | |||
) | const [pure virtual] |
Evaluate the curve's position at a given parameter.
pt | the evaluated position will be written to this Point | |
tpar | the parameter for which we wish to evaluate the curve |
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
virtual void Go::ParamCurve::point | ( | std::vector< Point > & | pts, | |
double | tpar, | |||
int | derivs, | |||
bool | from_right = true | |||
) | const [pure virtual] |
Evaluate the curve's position and a certain number of derivatives at a given parameter.
pts | the evaluated position and derivatives (tangent, curvature vector, etc.) will be written to this vector. The first entry will be the position, the second entry will be the first derivative, etc. The size of this vector must be set to 'derivs'+ 1 prior to calling this function. | |
tpar | the parameter for which we want to evaluate the curve | |
derivs | the number of derivatives we want to have calculated | |
from_right | specify whether we should calculate derivatives 'from the right' or 'from the left' (default is from the right). This matters only when the curve presents discontinuities in its derivatives. |
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
Point Go::ParamCurve::point | ( | double | tpar | ) | const |
Evaluate the curve's position at a certain parameter.
tpar | the parameter for which we want to evaluate the curve's position |
std::vector<Point> Go::ParamCurve::point | ( | double | tpar, | |
int | derivs, | |||
bool | from_right = true | |||
) | const |
Evaluate the curve's position and a certain number of derivatives at a given parameter.
tpar | the parameter for which we want to evaluate the curve | |
derivs | the number of derivatives we want to have calculated | |
from_right | specify whether we should calculate derivatives 'from the right' or 'from the left' (default is from the right). This matters only when the curve presents discontinuities in its derivatives. |
virtual double Go::ParamCurve::startparam | ( | ) | const [pure virtual] |
Query the start parameter of the curve.
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
virtual double Go::ParamCurve::endparam | ( | ) | const [pure virtual] |
Query the end parameter of the curve.
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
virtual void Go::ParamCurve::reverseParameterDirection | ( | bool | switchparam = false |
) | [pure virtual] |
Set the parameter direction of the curve.
The curve's parameter interval will always remain constant, but by flipping the parameter direction, the curve will be traced the opposite way when moving a parameter over the parameter interval.
switchparam | if true, and the curve is 2D, the x and y coordinates should be swapped. This is used when turning the orientation of bounded (trimmed) surfaces. |
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
virtual SplineCurve* Go::ParamCurve::geometryCurve | ( | ) | [pure virtual] |
If the definition of this ParamCurve contains a SplineCurve describing its spatial shape, then this function will return a pointer to this SplineCurve.
Otherwise it will return a null pointer.
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
virtual bool Go::ParamCurve::isDegenerate | ( | double | degenerate_epsilon | ) | [pure virtual] |
Query whether the curve is degenerate (collapsed into a single point).
degenerate_epsilon | the tolerance used in determine whether the curve is degenerate. A curve is considered degenerate if its total length is shorter than this value. |
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
virtual ParamCurve* Go::ParamCurve::subCurve | ( | double | from_par, | |
double | to_par, | |||
double | fuzzy = DEFAULT_PARAMETER_EPSILON | |||
) | const [pure virtual] |
Returns a curve which is a part of this curve.
The result is NEWed, so the user is responsible for deleting it. NB: This function only work for derived classes of ParamCurve, namely those who are spline-based.
from_par | start value of parameter interval that will define the subcurve | |
to_par | end value of parameter interval that will define the subcurve | |
fuzzy | since subCurve works on those curves who are spline-based, this tolerance defines how close the start and end parameter must be to an existing knot in order to be considered on the knot. |
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
virtual DirectionCone Go::ParamCurve::directionCone | ( | ) | const [pure virtual] |
Creates a DirectionCone which covers all tangent directions of this curve.
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
virtual CompositeBox Go::ParamCurve::compositeBox | ( | ) | const [virtual] |
Creates a composite box enclosing the curve.
The composite box consists of an inner and an edge box. The inner box is supposed to be made from the interior of the curve, while the edge box is made from the start and end points. The default implementation simply makes both boxes identical to the regular bounding box.
Reimplemented in Go::SplineCurve.
virtual void Go::ParamCurve::appendCurve | ( | ParamCurve * | cv, | |
bool | reparam = true | |||
) | [pure virtual] |
append a curve to this curve, with eventual reparametrization NB: This virtual member function currently only works for SplineCurves and CurveOnSurfaces.
Moreover, 'this' curve and the 'cv' curve must be of the same type.
cv | the curve to append to 'this' curve. | |
reparam | specify whether or not there should be reparametrization |
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
virtual void Go::ParamCurve::appendCurve | ( | ParamCurve * | cv, | |
int | continuity, | |||
double & | dist, | |||
bool | reparam = true | |||
) | [pure virtual] |
append a curve to this curve, with eventual reparmetrization
cv | the curve to append to 'this' curve. | |
continuity | the required continuity at the transition. Can be G^(-1) and upwards. | |
dist | a measure of the local distorsion around the transition in order to achieve the specified continuity. | |
reparam | specify whether or not there should be reparametrization |
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
double Go::ParamCurve::estimatedCurveLength | ( | int | numpts = 4 |
) | const |
Estimate the length of the curve, by sampling it at a certain number of points and calculating the linear approximation to the curve through these points.
numpts | number of sample points used |
double Go::ParamCurve::estimatedCurveLength | ( | double | tmin, | |
double | tmax, | |||
int | numpts = 4 | |||
) | const |
Estimate the length of an interval of the curve, by sampling it at a certain number of points in the interval and calculating the linear approximation through these points.
tmin | parameter at start of interval | |
tmax | parameter at end of interval | |
numpts | number of sample points used |
virtual void Go::ParamCurve::closestPoint | ( | const Point & | pt, | |
double | tmin, | |||
double | tmax, | |||
double & | clo_t, | |||
Point & | clo_pt, | |||
double & | clo_dist, | |||
double const * | seed = 0 | |||
) | const [pure virtual] |
Compute the closest point from an interval of this curve to a specified point.
pt | point we want to find the closest point to | |
tmin | start parameter of search interval | |
tmax | end parameter of search interval | |
clo_t | upon function return, 'clo_t' will contain the parameter value of the closest point found. | |
clo_pt | upon function return, 'clo_pt' will contain the position of the closest point found. | |
clo_dist | upon function return, 'clo_dist' will containn the distance between 'pt' and the closest point found. | |
seed | pointer to initial guess value, provided by the user (can be 0, for which the algorithm will determine a (hopefully) reasonable choice). |
Implemented in Go::CurveOnSurface, and Go::SplineCurve.
void Go::ParamCurve::closestPoint | ( | const Point & | pt, | |
double & | clo_t, | |||
Point & | clo_pt, | |||
double & | clo_dist | |||
) | const |
Compute the closest point from this curve to a specified point, taking the whole curve into account (not just an interval of it).
pt | point we want to find the closest point to | |
clo_t | upon function return, 'clo_t' will contain the parameter value of the closest point found. | |
clo_pt | upon function return, 'clo_pt' will contain the position of the closest point found. | |
clo_dist | upon function return, 'clo_dist' will containn the distance between 'pt' and the closest point found. |
virtual double Go::ParamCurve::nextSegmentVal | ( | double | par, | |
bool | forward, | |||
double | tol | |||
) | const [virtual] |
If the ParamCurve is divided up into logical segments, this function will return the parameter value of the "next segment", starting from a parameter given by the user.
If no division into logical segments exist, then it is the start- or end parameter that is returned.
par | the parameter from which we start the search for the next segment. | |
forward | whether to search forwards or backwards along the parameter domain. | |
tol | the tolerance to determine or not 'par' is already located on the start of the next segment. |
Reimplemented in Go::CurveOnSurface, and Go::SplineCurve.