Go::ParamCurve Class Reference
['geometry' - a spline library]

Base class for parametric curves in Go. More...

#include <ParamCurve.h>

Inheritance diagram for Go::ParamCurve:

Go::GeomObject Go::Streamable Go::CurveOnSurface Go::SplineCurve List of all members.

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< Pointpoint (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 SplineCurvegeometryCurve ()=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 ParamCurvesubCurve (double from_par, double to_par, double fuzzy=DEFAULT_PARAMETER_EPSILON) const=0
 Returns a curve which is a part of this curve.
virtual ParamCurveclone () 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.

Detailed Description

Base class for parametric curves in Go.

Definition at line 57 of file ParamCurve.h.


Member Function Documentation

virtual void Go::ParamCurve::point ( Point pt,
double  tpar 
) const [pure virtual]

Evaluate the curve's position at a given parameter.

Parameters:
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.

Parameters:
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.

Parameters:
tpar the parameter for which we want to evaluate the curve's position
Returns:
the curve's position for the parameter 'tpar'. NB: This function is implemented in terms of the ParamCurve's virtual 'point(...)' functions, but is itself not virtual. If you make a concrete subclass and wish to make this function visible to the user, you must put a 'using ParamCurve::point' statement in the class definition.

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.

Parameters:
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.
Returns:
a STL vector containing the evaluated position and the specified number of derivatives. The first entry will be the position, the second entry will be the first derivative, etc. The total size of the returned vector will be 'derivs' + 1. NB: This function is implemented in terms of the ParamCurve's virtual 'point(...)' functions, but is itself not virtual. If you make a concrete subclass and wish to make this function visible to the user, you must put a 'using ParamCurve::point' in the class definition.

virtual double Go::ParamCurve::startparam (  )  const [pure virtual]

Query the start parameter of the curve.

Returns:
the curve's start parameter

Implemented in Go::CurveOnSurface, and Go::SplineCurve.

virtual double Go::ParamCurve::endparam (  )  const [pure virtual]

Query the end parameter of the curve.

Returns:
the curve's end parameter

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.

Parameters:
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.

Returns:
a pointer to the internal SplineCurve, if it exists. Null pointer otherwise.

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).

Parameters:
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.
Returns:
'true' if the curve is degenerate, 'false' otherwise.

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.

Parameters:
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.
Returns:
a pointer to a new subcurve which represents the part of the curve between 'from_par' and 'to_par'. It will be spline-based and have a k-regular knotvector. The user is responsible for deleting this subcurve when it is no longer needed.

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.

Returns:
the smallest DirectionCone containing 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.

Returns:
the CompositeBox enclosing the curve.

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.

Parameters:
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

Parameters:
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.

Parameters:
numpts number of sample points used
Returns:
the estimated curve length

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.

Parameters:
tmin parameter at start of interval
tmax parameter at end of interval
numpts number of sample points used
Returns:
the estimated curve length

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.

Parameters:
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).

Parameters:
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.

Parameters:
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.
Returns:
the parameter value of the next segment.

Reimplemented in Go::CurveOnSurface, and Go::SplineCurve.


The documentation for this class was generated from the following file:
Generated on Mon Jun 11 14:48:19 2007 for GoTools Core Library by  doxygen 1.5.1