#include <ParamSurface.h>
Inheritance diagram for Go::ParamSurface:
Public Member Functions | |
virtual | ~ParamSurface () |
Virtual destructor, enables safe inheritance. | |
virtual ParamSurface * | clone () const=0 |
make a clone of this surface and return a pointer to it (user is responsible for clearing up memory afterwards). | |
virtual const Domain & | parameterDomain () const=0 |
Return the parameter domain of the surface. | |
virtual RectDomain | containingDomain () const=0 |
Get a rectangular parameter domain that is guaranteed to contain the surface's parameterDomain(). | |
virtual CurveLoop | outerBoundaryLoop (double degenerate_epsilon=DEFAULT_SPACE_EPSILON) const =0 |
Returns the anticlockwise, outer boundary loop of the surface. | |
virtual std::vector< CurveLoop > | allBoundaryLoops (double degenerate_epsilon=DEFAULT_SPACE_EPSILON) const =0 |
Returns the anticlockwise outer boundary loop of the surface, together with clockwise loops of any interior boundaries, such that the surface always is 'to the left of' the loops. | |
virtual DirectionCone | normalCone () const=0 |
Creates a DirectionCone covering all normals to this surface. | |
virtual DirectionCone | tangentCone (bool pardir_is_u) const =0 |
Creates a DirectionCone covering all tangents to this surface along a given parameter direction. | |
virtual CompositeBox | compositeBox () const |
Creates a composite box enclosing the surface. | |
virtual void | point (Point &pt, double upar, double vpar) const=0 |
Evaluates the surface's position for a given parameter pair. | |
virtual void | point (std::vector< Point > &pts, double upar, double vpar, int derivs, bool u_from_right=true, bool v_from_right=true, double resolution=1.0e-12) const =0 |
Evaluates the surface's position and a certain number of derivatives for a given parameter pair. | |
Point | point (double upar, double vpar) const |
Evaluate the surface's position at a certain parameter pair. | |
std::vector< Point > | point (double upar, double vpar, int derivs) const |
entries will be the surface tangents along the first and second parameter direction. | |
virtual void | normal (Point &n, double upar, double vpar) const=0 |
Evaluates the surface normal for a given parameter pair. | |
virtual std::vector< boost::shared_ptr< ParamCurve > > | constParamCurves (double parameter, bool pardir_is_u) const=0 |
Get the curve(s) obtained by intersecting the surface with one of its constant parameter curves. | |
virtual std::vector< boost::shared_ptr< ParamSurface > > | subSurfaces (double from_upar, double from_vpar, double to_upar, double to_vpar, double fuzzy=DEFAULT_PARAMETER_EPSILON) const=0 |
Get the surface(s) obtained by cropping the parameter domain of this surface between given values for the first and second parameter. | |
virtual double | nextSegmentVal (int dir, double par, bool forward, double tol) const=0 |
Determine the parameter value of the start of the 'next segment' from a parameter value, along a given parameter direction. | |
virtual void | closestPoint (const Point &pt, double &clo_u, double &clo_v, Point &clo_pt, double &clo_dist, double epsilon, const RectDomain *domain_of_interest=NULL, double *seed=0) const=0 |
Iterates to the closest point to pt on the surface. | |
virtual void | closestBoundaryPoint (const Point &pt, double &clo_u, double &clo_v, Point &clo_pt, double &clo_dist, double epsilon, const RectDomain *rd=NULL, double *seed=0) const=0 |
Iterates to the closest point to pt on the boundary of the surface. | |
virtual void | getBoundaryInfo (Point &pt1, Point &pt2, double epsilon, SplineCurve *&cv, SplineCurve *&crosscv, double knot_tol=1e-05) const=0 |
Get the boundary curve segment between two points on the boundary, as well as the cross-tangent curve. | |
virtual void | turnOrientation ()=0 |
Turns the direction of the normal of the surface. | |
virtual void | reverseParameterDirection (bool direction_is_u)=0 |
Reverses the direction of the basis in input direction. | |
virtual void | swapParameterDirection ()=0 |
Swaps the two parameter directions. | |
virtual bool | isDegenerate (bool &b, bool &r, bool &t, bool &l, double tolerance) const=0 |
Query whether any of the four boundary curves are degenerate (zero length) within a certain tolerance. |
Definition at line 54 of file ParamSurface.h.
virtual ParamSurface* Go::ParamSurface::clone | ( | ) | const [pure virtual] |
make a clone of this surface and return a pointer to it (user is responsible for clearing up memory afterwards).
Implements Go::GeomObject.
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual const Domain& Go::ParamSurface::parameterDomain | ( | ) | const [pure virtual] |
Return the parameter domain of the surface.
This may be a simple rectangular domain (RectDomain) or any other subclass of Domain (such as GoCurveBoundedDomain, found in the sisl_dependent
module).
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual RectDomain Go::ParamSurface::containingDomain | ( | ) | const [pure virtual] |
Get a rectangular parameter domain that is guaranteed to contain the surface's parameterDomain().
It may be the same. There is no guarantee that this is the smallest domain containing the actual domain.
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual CurveLoop Go::ParamSurface::outerBoundaryLoop | ( | double | degenerate_epsilon = DEFAULT_SPACE_EPSILON |
) | const [pure virtual] |
Returns the anticlockwise, outer boundary loop of the surface.
degenerate_epsilon | edges whose length is smaller than this value are ignored. |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual std::vector<CurveLoop> Go::ParamSurface::allBoundaryLoops | ( | double | degenerate_epsilon = DEFAULT_SPACE_EPSILON |
) | const [pure virtual] |
Returns the anticlockwise outer boundary loop of the surface, together with clockwise loops of any interior boundaries, such that the surface always is 'to the left of' the loops.
degenerate_epsilon | edges whose length is smaller than this value are ignored. |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual DirectionCone Go::ParamSurface::normalCone | ( | ) | const [pure virtual] |
Creates a DirectionCone covering all normals to this surface.
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual DirectionCone Go::ParamSurface::tangentCone | ( | bool | pardir_is_u | ) | const [pure virtual] |
Creates a DirectionCone covering all tangents to this surface along a given parameter direction.
pardir_is_u | if 'true', then the DirectionCone will be defined on basis of the surface's tangents along the first parameter direction. Otherwise the second parameter direction will be used. |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual CompositeBox Go::ParamSurface::compositeBox | ( | ) | const [virtual] |
Creates a composite box enclosing the surface.
The composite box consists of an inner and an edge box. The inner box is supposed to be made from the interior of the surface, while the edge box is made from the boundary curves. The default implementation simply makes both boxes identical to the regular bounding box.
Reimplemented in Go::CompositeSurface, and Go::SplineSurface.
virtual void Go::ParamSurface::point | ( | Point & | pt, | |
double | upar, | |||
double | vpar | |||
) | const [pure virtual] |
Evaluates the surface's position for a given parameter pair.
pt | the result of the evaluation is written here | |
upar | the first parameter | |
vpar | the second parameter |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual void Go::ParamSurface::point | ( | std::vector< Point > & | pts, | |
double | upar, | |||
double | vpar, | |||
int | derivs, | |||
bool | u_from_right = true , |
|||
bool | v_from_right = true , |
|||
double | resolution = 1.0e-12 | |||
) | const [pure virtual] |
Evaluates the surface's position and a certain number of derivatives for a given parameter pair.
pts | the vector containing the evaluated values. Its size must be set by the user prior to calling this function, and should be equal to (derivs+1) * (derivs+2) / 2. Upon completion of the function, its first entry is the surface's position at the given parameter pair. Then, if 'derivs' > 0, the two next entries will be the surface tangents along the first and second parameter direction. The next three entries are the second- and cross derivatives, in the order (du2, dudv, dv2), and similar for even higher derivatives. | |
upar | the first parameter | |
vpar | the second parameter | |
derivs | number of requested derivatives | |
u_from_right | specify whether derivatives along the first parameter are to be calculated from the right ('true', default) or from the left ('false') | |
v_from_right | specify whether derivatives along the second parameter are to be calculated from the right ('true', default) or from the left ('false') | |
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. |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
Point Go::ParamSurface::point | ( | double | upar, | |
double | vpar | |||
) | const |
Evaluate the surface's position at a certain parameter pair.
upar | the first parameter | |
vpar | the second parameter |
std::vector<Point> Go::ParamSurface::point | ( | double | upar, | |
double | vpar, | |||
int | derivs | |||
) | const |
entries will be the surface tangents along the first and second parameter direction.
The next three entries are the second- and cross derivatives, in the order (du2, dudv, dv2), and similar for even higher derivatives. NB: This function is implemented in terms of the ParamSurface'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 void Go::ParamSurface::normal | ( | Point & | n, | |
double | upar, | |||
double | vpar | |||
) | const [pure virtual] |
Evaluates the surface normal for a given parameter pair.
n | the computed normal will be written to this variable | |
upar | the first parameter | |
vpar | the second parameter |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual std::vector<boost::shared_ptr<ParamCurve> > Go::ParamSurface::constParamCurves | ( | double | parameter, | |
bool | pardir_is_u | |||
) | const [pure virtual] |
Get the curve(s) obtained by intersecting the surface with one of its constant parameter curves.
For surfaces without holes, this will be the parameter curve itself; for surfaces with interior holes this may be a collection of several, disjoint curves.
parameter | parameter value for the constant parameter (either u or v) | |
pardir_is_u | specify whether the moving parameter (as opposed to the constant parameter) is the first ('true') or the second ('false') one. |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual std::vector<boost::shared_ptr<ParamSurface> > Go::ParamSurface::subSurfaces | ( | double | from_upar, | |
double | from_vpar, | |||
double | to_upar, | |||
double | to_vpar, | |||
double | fuzzy = DEFAULT_PARAMETER_EPSILON | |||
) | const [pure virtual] |
Get the surface(s) obtained by cropping the parameter domain of this surface between given values for the first and second parameter.
In general, for surfaces with no interior holes, the result will be one surface; however, for surfaces with interior holes, the result might be several disjoint surfaces.
from_upar | lower value for the first parameter in the subdomain | |
from_vpar | lower value for the second parameter in the subdomain | |
to_upar | upper value for the first parameter in the subdomain | |
to_vpar | upper value for the second parameter in the subdomain | |
fuzzy | tolerance used when determining intersection with interior boundaries |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual double Go::ParamSurface::nextSegmentVal | ( | int | dir, | |
double | par, | |||
bool | forward, | |||
double | tol | |||
) | const [pure virtual] |
Determine the parameter value of the start of the 'next segment' from a parameter value, along a given parameter direction.
A 'segment' is here defined as a parameter interval in which there will be no discontinuities in derivatives or other artifacts. For spline objects, a segment will typically be the interval between two consecutive, non-coincident knots.
dir | the parameter direction in which we search for the next segment (0 or 1) | |
par | the parameter value starting from which we search for the start value of the next segment | |
forward | define whether we shall move forward ('true') or backwards when searching along this parameter | |
tol | tolerance used for determining whether the 'par' is already located on the next segment value |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual void Go::ParamSurface::closestPoint | ( | const Point & | pt, | |
double & | clo_u, | |||
double & | clo_v, | |||
Point & | clo_pt, | |||
double & | clo_dist, | |||
double | epsilon, | |||
const RectDomain * | domain_of_interest = NULL , |
|||
double * | seed = 0 | |||
) | const [pure virtual] |
Iterates to the closest point to pt on the surface.
pt | the point to find the closest point to | |
clo_u | u parameter of the closest point | |
clo_v | v parameter of the closest point | |
clo_pt | the geometric position of the closest point | |
clo_dist | the distance between pt and clo_pt | |
epsilon | parameter tolerance (will in any case not be higher than sqrt(machine_precision) x magnitude of solution | |
domain_of_interest | pointer to parameter domain in which to search for closest point. If a NULL pointer is used, the entire surface is searched. | |
seed | pointer to parameter values where iteration starts. |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual void Go::ParamSurface::closestBoundaryPoint | ( | const Point & | pt, | |
double & | clo_u, | |||
double & | clo_v, | |||
Point & | clo_pt, | |||
double & | clo_dist, | |||
double | epsilon, | |||
const RectDomain * | rd = NULL , |
|||
double * | seed = 0 | |||
) | const [pure virtual] |
Iterates to the closest point to pt on the boundary of the surface.
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual void Go::ParamSurface::getBoundaryInfo | ( | Point & | pt1, | |
Point & | pt2, | |||
double | epsilon, | |||
SplineCurve *& | cv, | |||
SplineCurve *& | crosscv, | |||
double | knot_tol = 1e-05 | |||
) | const [pure virtual] |
Get the boundary curve segment between two points on the boundary, as well as the cross-tangent curve.
If the given points are not positioned on the same boundary (within a certain tolerance), no curves will be created.
pt1 | the first point on the boundary, given by the user | |
pt2 | the second point on the boundary, given by the user | |
epsilon | the tolerance used when determining whether the given points are lying on a boundary, and if they do, whether they both lie on the same boundary. | |
cv | upon return, this will point to a newly created curve representing the boundary curve between 'pt1' and 'pt2'. The user assumes ownership of this object and is responsible for its deletion. No curve is created if the given points are not found to lie on the same boundary. | |
crosscv | upon return, this will point to a newly created curve representing the cross-boundary curve between 'pt1' and 'pt2' The user assumes ownership of this object and is responsible for its deletion. The direction is outwards from the surface. No curve is created if the given points are not found to lie on the same boundary. | |
knot_tol | tolerance used when working with the knot-vector, to specify how close a parameter value must be to a knot in order to be considered 'on' the knot. |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual void Go::ParamSurface::reverseParameterDirection | ( | bool | direction_is_u | ) | [pure virtual] |
Reverses the direction of the basis in input direction.
direction_is_u | if 'true', the first parameter direction will be reversed, otherwise, the second parameter direction will be reversed |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.
virtual bool Go::ParamSurface::isDegenerate | ( | bool & | b, | |
bool & | r, | |||
bool & | t, | |||
bool & | l, | |||
double | tolerance | |||
) | const [pure virtual] |
Query whether any of the four boundary curves are degenerate (zero length) within a certain tolerance.
In the below, we refer to 'u' as the first parameter and 'v' as the second.
b | 'true' upon return of function if the boundary (v = v_min) is degenerate | |
r | 'true' upon return of function if the boundary (v = v_max) is degenerate | |
t | 'true' upon return of function if the boundary (u = u_min) is degenerate | |
l | 'true' upon return of function if the boundary (u = u_max) is degenerate | |
tolerance | boundaries are considered degenerate if their length is shorter than this value, given by the user |
Implemented in Go::BoundedSurface, Go::CompositeSurface, and Go::SplineSurface.