Go::ParamCurveInt Class Reference
[Intersections]

This class represents the "intersection object" of a parametric curve. More...

#include <ParamCurveInt.h>

Inheritance diagram for Go::ParamCurveInt:

Go::ParamGeomInt Go::ParamObjectInt Go::GeomObjectInt Go::SplineCurveInt List of all members.

Public Member Functions

 ParamCurveInt (boost::shared_ptr< ParamCurve > curve, ParamGeomInt *parent=0)
 Constructor.
virtual ~ParamCurveInt ()
 Destructor.
virtual void point (Point &res, const double *par) const
 Evaluate the object in the input parameter.
virtual void point (std::vector< Point > &res, const double *par, int der, 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 ParamCurveIntgetParamCurveInt ()
 Return a pointer to this object.
virtual ParamSurfaceIntgetParamSurfaceInt ()
 Return a NULL pointer (as this object is not of the correct type).
boost::shared_ptr< ParamCurve > getParamCurve ()
 Return pointer to the parametric curve defining this object.
boost::shared_ptr< const ParamCurve > getParamCurve () const
 Return pointer to the parametric curve defining this object.
boost::shared_ptr< ParamCurve > getParentParamCurve (double &start, double &end)
 Return pointer to a subcurve of the parent curve for this object.
boost::shared_ptr< ParamCurve > getParentParamCurve ()
 Return pointer to the parent curve for this object.
virtual boost::shared_ptr<
ParamCurveInt
makeIntObject (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 void setCriticalVal (int pardir, double par)
 Set info about subdivision value.
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< ParamGeomInt > > &subdiv_objs, std::vector< boost::shared_ptr< ParamGeomInt > > &bd_objs)
 Subdivide the object in the specified parameter direction and parameter value.
virtual CompositeBox compositeBox () const
 Create the CompositeBox for the parametric object.
virtual DirectionCone directionCone () const
 A cone which contains all normals of the object.
virtual void getBoundaryObjects (std::vector< boost::shared_ptr< BoundaryGeomInt > > &bd_objs)
 Return the boundary objects of this object.
virtual int checkPeriodicity (int pardir=0) const
 Check if the object is periodic.
virtual int dimension () const
 The dimension of the geometric space.
double startparam () const
 The start parameter of the curve.
double endparam () const
 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
 Find 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, double tol) const
 Return the value of the knot next to the input parameter par.
virtual bool isDegenerate (double epsge, int dir, double *par)
 Verfify whether the object is degenerate in the specified direction and parameter.
virtual bool isSpline ()
 Verify whether the object is a spline.
virtual const SplineCurve * getSpline ()
virtual double getOptimizedConeAngle (Point &axis1, Point &axis2)
 We try to treat problems which will never result in a simple case by shrinking the domain slightly, resulting in smaller cones.
virtual RotatedBox getRotatedBox (std::vector< Point > &axis) const
 Create a box containing the geometric sample mesh in the input coordinate system.
void axisFromEndpts (Point &axis) const
 Create an axis by interpolating the end points.

Protected Attributes

boost::shared_ptr< ParamCurve > curve_
int dim_
std::vector< std::pair< double,
int > > 
segment_
std::vector< double > mesh_
bool lw_set_
double length_
double wiggle_

Detailed Description

This class represents the "intersection object" of a parametric curve.

Definition at line 52 of file ParamCurveInt.h.


Constructor & Destructor Documentation

Go::ParamCurveInt::ParamCurveInt ( boost::shared_ptr< ParamCurve >  curve,
ParamGeomInt parent = 0 
) [explicit]

Constructor.

Parameters:
curve the parametric curve defining the intersection object.
parent the parent object to this object. Can be either a curve or a surface.


Member Function Documentation

virtual void Go::ParamCurveInt::point ( Point &  res,
const double *  par 
) const [inline, virtual]

Evaluate the object in the input parameter.

Parameters:
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 69 of file ParamCurveInt.h.

References curve_.

virtual void Go::ParamCurveInt::point ( std::vector< Point > &  res,
const double *  par,
int  der,
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.

Parameters:
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.
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 83 of file ParamCurveInt.h.

References curve_.

virtual ParamCurveInt* Go::ParamCurveInt::getParamCurveInt (  )  [virtual]

Return a pointer to this object.

Returns:
Pointer to this object.

Reimplemented from Go::ParamObjectInt.

virtual ParamSurfaceInt* Go::ParamCurveInt::getParamSurfaceInt (  )  [inline, virtual]

Return a NULL pointer (as this object is not of the correct type).

Returns:
NULL pointer (as this object is not of the correct type).

Reimplemented from Go::ParamObjectInt.

Definition at line 102 of file ParamCurveInt.h.

boost::shared_ptr<ParamCurve> Go::ParamCurveInt::getParamCurve (  ) 

Return pointer to the parametric curve defining this object.

Returns:
Pointer to the parametric curve defining this object.

boost::shared_ptr<const ParamCurve> Go::ParamCurveInt::getParamCurve (  )  const

Return pointer to the parametric curve defining this object.

Returns:
Pointer to the parametric curve defining this object.

boost::shared_ptr<ParamCurve> Go::ParamCurveInt::getParentParamCurve ( double &  start,
double &  end 
)

Return pointer to a subcurve of the parent curve for this object.

If no such curve exist, we use the curve of this object instead.

Parameters:
start the start parameter of the subcurve.
end the end parameter of the subcurve.
Returns:
Pointer to a subcurve of the parent curve for this object.

boost::shared_ptr<ParamCurve> Go::ParamCurveInt::getParentParamCurve (  ) 

Return pointer to the parent curve for this object.

If no such curve exist, we use the curve of this object instead.

Returns:
Pointer to a subcurve of the parent curve for this object.

virtual boost::shared_ptr<ParamCurveInt> Go::ParamCurveInt::makeIntObject ( 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.

Parameters:
curve the parametric curve defining the intersection object.

Reimplemented in Go::SplineCurveInt.

virtual void Go::ParamCurveInt::getLengthAndWiggle ( double *  length,
double *  wiggle 
) [virtual]

Return an estimate on the size and wiggle of the object.

Parameters:
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::ParamCurveInt::hasInnerKnots ( int  pardir  )  const [virtual]

Return true if the object has any inner knots in the specified parameter direction.

Parameters:
pardir the parameter direction in question. Indexing starts at 0.

Implements Go::ParamObjectInt.

Reimplemented in Go::SplineCurveInt.

virtual bool Go::ParamCurveInt::hasCriticalVals ( int  pardir  )  const [virtual]

Return true if the object has any critical parameter values in the specified parameter direction.

Parameters:
pardir the parameter direction in question. Indexing starts at 0.

Implements Go::ParamObjectInt.

virtual bool Go::ParamCurveInt::hasCriticalValsOrKnots ( int  pardir  )  const [virtual]

Return true if the object has any critical parameter values or inner knots in the specified parameter direction.

Parameters:
pardir the parameter direction in question. Indexing starts at 0.

Implements Go::ParamObjectInt.

Reimplemented in Go::SplineCurveInt.

virtual bool Go::ParamCurveInt::canDivide ( int  pardir  )  [virtual]

Return true if we are allowed to divide in the specified parameter direction.

Parameters:
pardir the parameter direction in question.

Implements Go::ParamObjectInt.

virtual std::vector<double> Go::ParamCurveInt::getCriticalVals ( int  pardir  )  const [virtual]

Return the critical parameter values in the specified direction.

Parameters:
pardir the parameter direction in question. Indexing starts at 0.

Implements Go::ParamObjectInt.

virtual std::vector<double> Go::ParamCurveInt::getInnerKnotVals ( int  pardir,
bool  sort = false 
) const [virtual]

Return the inner knot values in the specified direction.

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

virtual std::vector<double> Go::ParamCurveInt::getCriticalValsAndKnots ( int  pardir  )  const [virtual]

Return the critical parameter values and inner knots for object.

Parameters:
pardir the parameter direction in question. Indexing starts at 0.

Implements Go::ParamObjectInt.

Reimplemented in Go::SplineCurveInt.

virtual int Go::ParamCurveInt::getMeshSize ( int  dir  )  [virtual]

Return the size of the geometric sample mesh in the specified direction.

Parameters:
dir the parameter direction in question. Indexing starts at 0.

Implements Go::ParamGeomInt.

Reimplemented in Go::SplineCurveInt.

virtual double Go::ParamCurveInt::paramFromMesh ( int  dir,
int  idx 
) [virtual]

Return the corresponding mesh parameter.

Parameters:
dir the parameter direction in question. Indexing starts at 0.
idx the mesh idx in the specified direction. Indexing starts at 0.

Implements Go::ParamGeomInt.

Reimplemented in Go::SplineCurveInt.

virtual double Go::ParamCurveInt::startParam ( int  pardir  )  const [inline, virtual]

Return the start parameter value in the specified direction.

Parameters:
pardir the parameter direction in question. Indexing starts at 0.

Implements Go::ParamObjectInt.

Definition at line 212 of file ParamCurveInt.h.

References curve_.

virtual double Go::ParamCurveInt::endParam ( int  pardir  )  const [inline, virtual]

Return the end parameter in the specified direction.

Parameters:
pardir the parameter direction in question. Indexing starts at 0.

Implements Go::ParamObjectInt.

Definition at line 218 of file ParamCurveInt.h.

References curve_.

virtual bool Go::ParamCurveInt::boundaryPoint ( const double *  par,
double  eps 
) const [virtual]

Return true if the specified point lies within eps from the boundary.

Parameters:
par the parameter in which to evaluate. Size of array should be equal to numParams().
eps the tolerance defining the boundary neighbourhood.

Implements Go::ParamObjectInt.

virtual void Go::ParamCurveInt::subdivide ( int  pardir,
double  par,
std::vector< boost::shared_ptr< ParamGeomInt > > &  subdiv_objs,
std::vector< boost::shared_ptr< ParamGeomInt > > &  bd_objs 
) [virtual]

Subdivide the object in the specified parameter direction and parameter value.

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

virtual CompositeBox Go::ParamCurveInt::compositeBox (  )  const [virtual]

Create the CompositeBox for the parametric object.

Returns:
The CompositeBox for the parametric object.

Implements Go::ParamGeomInt.

virtual DirectionCone Go::ParamCurveInt::directionCone (  )  const [virtual]

A cone which contains all normals of the object.

Returns:
A cone which contains all normals of the object.

Implements Go::ParamGeomInt.

virtual void Go::ParamCurveInt::getBoundaryObjects ( std::vector< boost::shared_ptr< BoundaryGeomInt > > &  bd_objs  )  [virtual]

Return the boundary objects of this object.

Parameters:
bd_objs the boundary objects of this object.

Implements Go::ParamGeomInt.

virtual int Go::ParamCurveInt::checkPeriodicity ( int  pardir = 0  )  const [virtual]

Check if the object is periodic.

Analyze periodicity of curve based on number of repeating knots and control points. The return value is -1 if the curve ends are disjoint, otherwise k if cv is C^k continuous. These are sufficient but not necessary conditions for periodicity, so it is possible that a higher degree of periodicity exists. Should not be called on this layer, should be overruled by inherited class.

Parameters:
pardir the parameter direction in question. Does not pertain to for a curve.
Returns:
-1 if the curve ends are disjoint, or k if the curve is proven to be C^k continuous.

Reimplemented from Go::ParamGeomInt.

Reimplemented in Go::SplineCurveInt.

double Go::ParamCurveInt::startparam (  )  const [inline]

The start parameter of the curve.

Returns:
The start parameter of the curve.

Definition at line 275 of file ParamCurveInt.h.

References curve_.

double Go::ParamCurveInt::endparam (  )  const [inline]

The end parameter of the curve.

Returns:
The end parameter of the curve.

Definition at line 280 of file ParamCurveInt.h.

References curve_.

void Go::ParamCurveInt::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.

Parameters:
t the input parameter

virtual int Go::ParamCurveInt::knotIntervalFuzzy ( double &  t,
double  tol 
) const [virtual]

Find the knot interval for which t lies inside, moving the value t if it lies close to a knot.

Parameters:
t the parameter value
tol the parametric tolerance deciding if the input parameter t should be moved.

Reimplemented in Go::SplineCurveInt.

virtual double Go::ParamCurveInt::nextSegmentVal ( double  par,
bool  forward,
double  tol 
) const [virtual]

Return the value of the knot next to the input parameter par.

Parameters:
par the parameter value
forward if true we return the closest knot to the right, otherwise the closest knot to the left.
tol the tolerance to determine if par is already located on the start of the next segment.
Returns:
The knot closest to the input parameter.

Reimplemented in Go::SplineCurveInt.

virtual bool Go::ParamCurveInt::isDegenerate ( double  epsge,
int  dir,
double *  par 
) [virtual]

Verfify whether the object is degenerate in the specified direction and parameter.

Parameters:
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().
Returns:
True if the object is degenerate.

Implements Go::ParamGeomInt.

virtual bool Go::ParamCurveInt::isSpline (  )  [virtual]

Verify whether the object is a spline.

Returns:
True if the object is a spline.

Implements Go::ParamGeomInt.

Reimplemented in Go::SplineCurveInt.

virtual double Go::ParamCurveInt::getOptimizedConeAngle ( Point &  axis1,
Point &  axis2 
) [virtual]

We try to treat problems which will never result in a simple case by shrinking the domain slightly, resulting in smaller cones.

This is useful for scenarios where the normals are parallell in a boundary point.

Parameters:
axis1 first vector defining a projection plane
axis2 second vector defining a projection plane
Returns:
The optimized cone angle

Implements Go::ParamGeomInt.

Reimplemented in Go::SplineCurveInt.

virtual RotatedBox Go::ParamCurveInt::getRotatedBox ( std::vector< Point > &  axis  )  const [virtual]

Create a box containing the geometric sample mesh in the input coordinate system.

Parameters:
axis the axis defining the coordinate system. The size of vector axis is 2, the last point is given as the cross product axis[0]axis[1].
Returns:
The rotated box

Reimplemented in Go::SplineCurveInt.

void Go::ParamCurveInt::axisFromEndpts ( Point &  axis  )  const

Create an axis by interpolating the end points.

Returns:
The created axis.


The documentation for this class was generated from the following file:
Generated on Fri Nov 23 12:24:34 2007 for GoTools Intersections Library by  doxygen 1.5.1