#include <Param1FunctionInt.h>
Inheritance diagram for Go::Param1FunctionInt:
Public Member Functions | |
Param1FunctionInt (boost::shared_ptr< ParamCurve > curve) | |
Constructor. | |
Param1FunctionInt (boost::shared_ptr< ParamCurve > curve, ParamFunctionInt *parent) | |
Constructor. | |
virtual | ~Param1FunctionInt () |
Destructor. | |
virtual void | point (Point &res, const double *par) const |
Evaluate the object in the input parameter. | |
virtual void | point (std::vector< Point > &res, double par, int der) |
Evaluate the object in the input parameter, with the specified number of derivatives. | |
virtual void | point (std::vector< Point > &pt, const double *tpar, int derivs, const bool *from_right=0, double resolution=1.0e-12) const |
Evaluate the object in the input parameter, with the specified number of derivatives. | |
virtual Param1FunctionInt * | getParam1FunctionInt () |
Return pointer to this object. | |
boost::shared_ptr< ParamCurve > | getParamCurve () |
Return pointer to the parametric curve. | |
boost::shared_ptr< const ParamCurve > | getParamCurve () const |
Return pointer to the parametric curve. | |
boost::shared_ptr< ParamCurve > | getParentParamCurve (double &start, double &end) |
Return pointer to a subpart of the parent curve of this object. | |
boost::shared_ptr< ParamCurve > | getParentParamCurve () |
Return pointer to the parent curve of this object. | |
virtual boost::shared_ptr< Param1FunctionInt > | makeIntFunction (boost::shared_ptr< ParamCurve > curve) |
Return an intersection object for the input curve. | |
virtual int | numParams () const |
The number of parameters in the object. | |
virtual void | getLengthAndWiggle (double *length, double *wiggle) |
Return an estimate on the size and wiggle of the object. | |
virtual bool | hasInnerKnots (int pardir) const |
Return true if the object has any inner knots in the specified parameter direction. | |
virtual bool | hasCriticalVals (int pardir) const |
Return true if the object has any critical parameter values in the specified parameter direction. | |
virtual bool | hasCriticalValsOrKnots (int pardir) const |
Return true if the object has any critical parameter values or inner knots in the specified parameter direction. | |
virtual bool | canDivide (int pardir) |
Return true if we are allowed to divide in the specified parameter direction. | |
virtual std::vector< double > | getCriticalVals (int pardir) const |
Return the critical parameter values in the specified direction. | |
virtual std::vector< double > | getInnerKnotVals (int pardir, bool sort=false) const |
Return the inner knot values in the specified direction. | |
virtual std::vector< double > | getCriticalValsAndKnots (int pardir) const |
Return the critical parameter values and inner knots for object. | |
virtual int | getMeshSize (int dir) |
Return the size of the geometric sample mesh in the specified direction. | |
virtual double | paramFromMesh (int dir, int idx) |
Return the corresponding mesh parameter. | |
virtual std::vector< double >::iterator | getMesh () |
Return the geometric sample mesh for the parametric function. | |
virtual double | startParam (int pardir) const |
Return the start parameter value in the specified direction. | |
virtual double | endParam (int pardir) const |
Return the end parameter in the specified direction. | |
virtual bool | boundaryPoint (const double *par, double eps) const |
Return true if the specified point lies within eps from the boundary. | |
virtual void | subdivide (int pardir, double par, std::vector< boost::shared_ptr< ParamFunctionInt > > &subdiv_objs, std::vector< boost::shared_ptr< ParamFunctionInt > > &bd_objs) |
Subdivide the object in the specified parameter direction and parameter value. | |
virtual bool | monotone (Point &dir, double tol=1.0e-15) const |
Return true if the curve is monotone. | |
virtual CompositeBox | compositeBox () const |
Return the CompositeBox for the parametric object. | |
virtual void | getBoundaryObjects (std::vector< boost::shared_ptr< BoundaryFunctionInt > > &bd_objs) |
Return the boundary objects of this object. | |
int | dimension () |
Return the dimension of the geometric space. | |
double | startparam () const |
Return the start parameter of the curve. | |
double | endparam () const |
Return the end parameter of the curve. | |
void | assureInRange (double &t) |
Make sure that the input parameter lies inside the range of the parametric curve. | |
virtual int | knotIntervalFuzzy (double &t, double tol) const |
Return the knot interval for which t lies inside, moving the value t if it lies close to a knot. | |
virtual double | nextSegmentVal (double par, bool forward) const |
Return the value of the knot next to the input parameter par. | |
virtual bool | isDegenerate (double epsge, int dir, double *par) |
Return true if the object is degenerate in the specified direction and parameter. | |
Protected Attributes | |
boost::shared_ptr< ParamCurve > | curve_ |
int | dim_ |
Param1FunctionInt * | parentcurve_ |
std::vector< std::pair< double, int > > | segment_ |
std::vector< double > | mesh_ |
double | deg_tol_ |
Definition at line 50 of file Param1FunctionInt.h.
Go::Param1FunctionInt::Param1FunctionInt | ( | boost::shared_ptr< ParamCurve > | curve | ) | [explicit] |
Constructor.
curve | the parametric 1-dimensional curve defining the intersection object. |
Go::Param1FunctionInt::Param1FunctionInt | ( | boost::shared_ptr< ParamCurve > | curve, | |
ParamFunctionInt * | parent | |||
) | [explicit] |
Constructor.
curve | the parametric 1-dimensional curve defining the intersection object. | |
parent | the parent object to this object. Can be either a curve or a surface. |
virtual void Go::Param1FunctionInt::point | ( | Point & | res, | |
const double * | par | |||
) | const [inline, virtual] |
Evaluate the object in the input parameter.
res | the Point to be returned. | |
par | the parameter in which to evaluate. The size of the array should be equal to numParams(). |
Implements Go::ParamObjectInt.
Definition at line 72 of file Param1FunctionInt.h.
References curve_.
virtual void Go::Param1FunctionInt::point | ( | std::vector< Point > & | res, | |
double | par, | |||
int | der | |||
) | [inline, virtual] |
Evaluate the object in the input parameter, with the specified number of derivatives.
res | the Point to be returned. | |
par | the parameter in which to evaluate. The size of the array should be equal to numParams(). | |
der | the number of derivatives to calculate. |
Definition at line 81 of file Param1FunctionInt.h.
References curve_.
virtual void Go::Param1FunctionInt::point | ( | std::vector< Point > & | pt, | |
const double * | tpar, | |||
int | derivs, | |||
const bool * | from_right = 0 , |
|||
double | resolution = 1.0e-12 | |||
) | const [inline, virtual] |
Evaluate the object in the input parameter, with the specified number of derivatives.
pt | the Point to be returned. | |
tpar | the parameter in which to evaluate. The size of the array should be equal to numParams(). | |
derivs | the number of derivatives to calculate. | |
from_right | if true the evaluation is to be performed from the right side of the parameter value. | |
resolution | tolerance used when determining whether parameters are located at special values of the parameter domain (in particualar: knot values in case of spline objects. |
Implements Go::ParamObjectInt.
Definition at line 95 of file Param1FunctionInt.h.
References curve_.
boost::shared_ptr<ParamCurve> Go::Param1FunctionInt::getParentParamCurve | ( | double & | start, | |
double & | end | |||
) |
Return pointer to a subpart of the parent curve of this object.
If a parent curve does not exist, return pointer to curve in this object. To reduce numerical noise we go straight to the source (undivided) curve.
boost::shared_ptr<ParamCurve> Go::Param1FunctionInt::getParentParamCurve | ( | ) |
Return pointer to the parent curve of this object.
If a parent curve does not exist, return pointer to curve in this object. To reduce numerical noise we go straight to the source (undivided) curve.
virtual boost::shared_ptr<Param1FunctionInt> Go::Param1FunctionInt::makeIntFunction | ( | boost::shared_ptr< ParamCurve > | curve | ) | [virtual] |
Return an intersection object for the input curve.
This object is used as the parent for the intersection object.
curve | the parametric curve defining the intersection object. |
Reimplemented in Go::Spline1FunctionInt.
virtual void Go::Param1FunctionInt::getLengthAndWiggle | ( | double * | length, | |
double * | wiggle | |||
) | [virtual] |
Return an estimate on the size and wiggle of the object.
length | the approximative length of the object in the corresponding parameter directions. The size of the array should be equal to numParams(). | |
wiggle | a scalar representing the wiggle of the object in the corresponding parameter directions. The size of the array should be equal to numParams(). |
Implements Go::ParamObjectInt.
virtual bool Go::Param1FunctionInt::hasInnerKnots | ( | int | pardir | ) | const [virtual] |
Return true if the object has any inner knots in the specified parameter direction.
pardir | the parameter direction in question. Indexing starts at 0. |
Implements Go::ParamObjectInt.
Reimplemented in Go::Spline1FunctionInt.
virtual bool Go::Param1FunctionInt::hasCriticalVals | ( | int | pardir | ) | const [virtual] |
Return true if the object has any critical parameter values in the specified parameter direction.
pardir | the parameter direction in question. Indexing starts at 0. |
Implements Go::ParamObjectInt.
virtual bool Go::Param1FunctionInt::hasCriticalValsOrKnots | ( | int | pardir | ) | const [virtual] |
Return true if the object has any critical parameter values or inner knots in the specified parameter direction.
pardir | the parameter direction in question. Indexing starts at 0. |
Implements Go::ParamObjectInt.
Reimplemented in Go::Spline1FunctionInt.
virtual bool Go::Param1FunctionInt::canDivide | ( | int | pardir | ) | [virtual] |
Return true if we are allowed to divide in the specified parameter direction.
pardir | the parameter direction in question. |
Implements Go::ParamObjectInt.
virtual std::vector<double> Go::Param1FunctionInt::getCriticalVals | ( | int | pardir | ) | const [virtual] |
Return the critical parameter values in the specified direction.
pardir | the parameter direction in question. Indexing starts at 0. |
Implements Go::ParamObjectInt.
virtual std::vector<double> Go::Param1FunctionInt::getInnerKnotVals | ( | int | pardir, | |
bool | sort = false | |||
) | const [virtual] |
Return the inner knot values in the specified direction.
pardir | the parameter direction in question. Indexing starts at 0. | |
sort | the returned values may be sorted by the function. |
Implements Go::ParamObjectInt.
Reimplemented in Go::Spline1FunctionInt.
virtual std::vector<double> Go::Param1FunctionInt::getCriticalValsAndKnots | ( | int | pardir | ) | const [virtual] |
Return the critical parameter values and inner knots for object.
pardir | the parameter direction in question. Indexing starts at 0. |
Implements Go::ParamObjectInt.
Reimplemented in Go::Spline1FunctionInt.
virtual int Go::Param1FunctionInt::getMeshSize | ( | int | dir | ) | [virtual] |
Return the size of the geometric sample mesh in the specified direction.
dir | the parameter direction in question. Indexing starts at 0. |
Implements Go::ParamFunctionInt.
Reimplemented in Go::Spline1FunctionInt.
virtual double Go::Param1FunctionInt::paramFromMesh | ( | int | dir, | |
int | idx | |||
) | [virtual] |
Return the corresponding mesh parameter.
dir | the parameter direction in question. Indexing starts at 0. | |
idx | the mesh idx in the specified direction. Indexing starts at 0. |
Implements Go::ParamFunctionInt.
Reimplemented in Go::Spline1FunctionInt.
virtual double Go::Param1FunctionInt::startParam | ( | int | pardir | ) | const [inline, virtual] |
Return the start parameter value in the specified direction.
pardir | the parameter direction in question. Indexing starts at 0. |
Implements Go::ParamObjectInt.
Definition at line 205 of file Param1FunctionInt.h.
References curve_.
virtual double Go::Param1FunctionInt::endParam | ( | int | pardir | ) | const [inline, virtual] |
Return the end parameter in the specified direction.
pardir | the parameter direction in question. Indexing starts at 0. |
Implements Go::ParamObjectInt.
Definition at line 211 of file Param1FunctionInt.h.
References curve_.
virtual bool Go::Param1FunctionInt::boundaryPoint | ( | const double * | par, | |
double | eps | |||
) | const [virtual] |
Return true if the specified point lies within eps from the boundary.
par | the parameter in which to evaluate. Size of array should be equal to numParams(). | |
eps | the tolerance defining boundary neighbourhood. |
Implements Go::ParamObjectInt.
virtual void Go::Param1FunctionInt::subdivide | ( | int | pardir, | |
double | par, | |||
std::vector< boost::shared_ptr< ParamFunctionInt > > & | subdiv_objs, | |||
std::vector< boost::shared_ptr< ParamFunctionInt > > & | bd_objs | |||
) | [virtual] |
Subdivide the object in the specified parameter direction and parameter value.
pardir | direction in which to subdive. Indexing starts at 0. | |
par | parameter in which to subdivide. | |
subdiv_objs | The subparts of this object. Of the same geometric dimension as this object. | |
bd_objs | the boundaries between the returned subdiv_objs. Of geometric dimension 1 less than this object. |
Implements Go::ParamFunctionInt.
virtual bool Go::Param1FunctionInt::monotone | ( | Point & | dir, | |
double | tol = 1.0e-15 | |||
) | const [virtual] |
Return true if the curve is monotone.
dir | the direction in which the object is monotone. Is not of interest here as the curve has only 1 parameter direction. |
Implements Go::ParamFunctionInt.
Reimplemented in Go::Spline1FunctionInt.
virtual void Go::Param1FunctionInt::getBoundaryObjects | ( | std::vector< boost::shared_ptr< BoundaryFunctionInt > > & | bd_objs | ) | [virtual] |
Return the boundary objects of this object.
bd_objs | the boundary objects of this object. |
Implements Go::ParamFunctionInt.
void Go::Param1FunctionInt::assureInRange | ( | double & | t | ) |
Make sure that the input parameter lies inside the range of the parametric curve.
Set t equal to tmin if it lies below tmin, or tmax if it lies above tmax.
t | the input parameter |
virtual int Go::Param1FunctionInt::knotIntervalFuzzy | ( | double & | t, | |
double | tol | |||
) | const [virtual] |
Return the knot interval for which t lies inside, moving the value t if it lies close to a knot.
t | the parameter value | |
tol | the parametric tolerance deciding if the input parameter t should be moved. |
Reimplemented in Go::Spline1FunctionInt.
virtual double Go::Param1FunctionInt::nextSegmentVal | ( | double | par, | |
bool | forward | |||
) | const [virtual] |
Return the value of the knot next to the input parameter par.
par | the parameter value | |
forward | if true we return the closest knot to the right, otherwise the closest knot to the left. |
Reimplemented in Go::Spline1FunctionInt.
virtual bool Go::Param1FunctionInt::isDegenerate | ( | double | epsge, | |
int | dir, | |||
double * | par | |||
) | [virtual] |
Return true if the object is degenerate in the specified direction and parameter.
epsge | the geometric tolerance defining degeneracy. | |
dir | the parameter direction in question. | |
par | the parameter in which to evaluate. Size of array should be equal to numParams(). |
Reimplemented from Go::ParamObjectInt.