#include <BoundedSurface.h>
Inheritance diagram for Go::BoundedSurface:
Public Member Functions | |
BoundedSurface () | |
Create an empty BoundedSurface that can be assigned or read() into. | |
BoundedSurface (shared_ptr< ParamSurface > surf, vector< shared_ptr< CurveOnSurface > > loop, double space_epsilon) | |
Create a BoundedSurface by specifying the underlying surface and a loop of curves that specifies the trimming of the surface. | |
BoundedSurface (shared_ptr< ParamSurface > surf, vector< vector< shared_ptr< CurveOnSurface > > > loops, double space_epsilon) | |
Create a BoundedSurface by specifying the underlying surface and a number of loops of curves that specify the trimming of the surface. | |
virtual | ~BoundedSurface () |
Virtual destructor ensures safe inheritance. | |
virtual void | read (std::istream &is) |
read this BoundedSurface from a stream | |
virtual void | write (std::ostream &os) const |
write this BoundedSurface to a stream | |
virtual BoundingBox | boundingBox () const |
Return the object's bounding box. | |
virtual int | dimension () const |
Return the dimension of the space in which the object lies (usually 2 or 3). | |
virtual ClassType | instanceType () const |
Return the class type identifier of type BoundedSurface. | |
virtual BoundedSurface * | clone () const |
clone this BoundedSurface and return a pointer to the clone | |
virtual DirectionCone | normalCone () const |
Creates a DirectionCone covering all normals to this surface. | |
virtual DirectionCone | tangentCone (bool pardir_is_u) const |
Creates a DirectionCone covering all tangents to this surface along a given parameter direction. | |
virtual const CurveBoundedDomain & | parameterDomain () const |
Return the parameter domain of the surface. | |
virtual RectDomain | containingDomain () const |
Get a rectangular parameter domain that is guaranteed to contain the surface's parameterDomain(). | |
virtual CurveLoop | outerBoundaryLoop (double degenerate_epsilon=DEFAULT_SPACE_EPSILON) const |
Returns the anticlockwise, outer boundary loop of the surface. | |
virtual std::vector< CurveLoop > | allBoundaryLoops (double degenerate_epsilon=DEFAULT_SPACE_EPSILON) const |
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. | |
std::vector< CurveLoop > | absolutelyAllBoundaryLoops () const |
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 void | point (Point &pt, double upar, double vpar) const |
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 |
Evaluates the surface's position and a certain number of derivatives for a given parameter pair. | |
virtual void | point (std::vector< Point > &pts, double upar, double vpar, int derivs) const |
Evaluates the surface's position and a certain number of derivatives for a given parameter pair. | |
virtual void | normal (Point &n, double upar, double vpar) const |
Evaluates the surface normal for a given parameter pair. | |
virtual std::vector< boost::shared_ptr< ParamCurve > > | constParamCurves (double parameter, bool pardir_is_u) const |
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 |
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 |
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 |
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 *domain_of_interest=NULL, double *seed=0) const |
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 |
Get the boundary curve segment between two points on the boundary, as well as the cross-tangent curve. | |
void | getBoundaryInfo (Point &pt1, Point &pt2, vector< shared_ptr< CurveOnSurface > > &bd_cvs) const |
Get the boundary curve segment between two points on the same boundary loop. | |
virtual void | turnOrientation () |
Turns the direction of the normal of the surface. | |
virtual void | reverseParameterDirection (bool direction_is_u) |
Reverses the direction of the basis in input direction. | |
void | makeBoundaryCurvesG1 (double kink) |
This function processes all the curves that participate in defining the surface's (trimmed) boundary. | |
virtual void | swapParameterDirection () |
Swaps the two parameter directions. | |
void | setParameterDomain (double u1, double u2, double v1, double v2) |
Change the parameter domain of the underlying surface, and modify the boundary loops with respect to this change. | |
void | splitSingleLoops () |
Split all boundary loops defined by only curve into three parts. | |
shared_ptr< ParamSurface > | underlyingSurface () |
Get a pointer to the underlying surface. | |
shared_ptr< const ParamSurface > | underlyingSurface () const |
Get a pointer to the underlying surface. | |
int | numberOfLoops () |
Get the number of boundary loops that describe the trimmed surface. | |
shared_ptr< CurveLoop > | loop (int idx) |
Get a shared pointer to a specific boundary loop. | |
SplineCurve * | constParamCurve (double parameter, bool direction_is_u) const |
Get the space-curve resulting from fixing one of the surface's parameters and moving the other along its allowed range (inside the trimmed domain). | |
virtual bool | isDegenerate (bool &b, bool &r, bool &t, bool &l, double tolerance) const |
Query whether any of the four boundaries of the underlying surface are degenerate (zero length) within a certain tolerance. | |
Static Public Member Functions | |
static ClassType | classType () |
Return the class type identifier of type BoundedSurface. |
Definition at line 50 of file BoundedSurface.h.
Go::BoundedSurface::BoundedSurface | ( | shared_ptr< ParamSurface > | surf, | |
vector< shared_ptr< CurveOnSurface > > | loop, | |||
double | space_epsilon | |||
) |
Create a BoundedSurface by specifying the underlying surface and a loop of curves that specifies the trimming of the surface.
surf | the created BoundedSurface will represent a trimmed version of this surface | |
loop | a vector of CurveOnSurface s that together describe the boundary that defines the trimming of the surface. The curves in this vector should all lie on the surface in question, and when placed head-to-tail they should form a closed loop with counterclockwise orientation. | |
space_epsilon | geometrical tolerance used when treating the loops. |
Go::BoundedSurface::BoundedSurface | ( | shared_ptr< ParamSurface > | surf, | |
vector< vector< shared_ptr< CurveOnSurface > > > | loops, | |||
double | space_epsilon | |||
) |
Create a BoundedSurface by specifying the underlying surface and a number of loops of curves that specify the trimming of the surface.
surf | the created BoundedSurface will represent a trimmed version of this surface | |
loops | each entry in 'loop is a vector of CurveOnSurface s that describe a closed loop forming a part of the trimmed surface's boundary. (Since the surface may have internal holes, more than one loop might be required to describe its boundary). The curve loops should all lie on the surface in question. The first entry in this vector describes the outermost boundary, which should be oriented counterclockwise. The other entries represent holes, and should be oriented clockwise. | |
space_epsilon | geometrical tolerance used when treating the loops. |
virtual DirectionCone Go::BoundedSurface::normalCone | ( | ) | const [virtual] |
Creates a DirectionCone covering all normals to this surface.
Implements Go::ParamSurface.
virtual DirectionCone Go::BoundedSurface::tangentCone | ( | bool | pardir_is_u | ) | const [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. |
Implements Go::ParamSurface.
virtual const CurveBoundedDomain& Go::BoundedSurface::parameterDomain | ( | ) | const [virtual] |
Return the parameter domain of the surface.
This may be a simple rectangular domain (RectDomain) or any other subclass of Domain (such as CurveBoundedDomain, found in the sisl_dependent
module).
Implements Go::ParamSurface.
virtual RectDomain Go::BoundedSurface::containingDomain | ( | ) | const [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.
Implements Go::ParamSurface.
virtual CurveLoop Go::BoundedSurface::outerBoundaryLoop | ( | double | degenerate_epsilon = DEFAULT_SPACE_EPSILON |
) | const [virtual] |
Returns the anticlockwise, outer boundary loop of the surface.
degenerate_epsilon | edges whose length is smaller than this value are ignored. |
Implements Go::ParamSurface.
virtual std::vector<CurveLoop> Go::BoundedSurface::allBoundaryLoops | ( | double | degenerate_epsilon = DEFAULT_SPACE_EPSILON |
) | const [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. |
Implements Go::ParamSurface.
std::vector<CurveLoop> Go::BoundedSurface::absolutelyAllBoundaryLoops | ( | ) | const |
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.
This function works like allBoundaryLoops(), except that it includes degenerate edges.
virtual void Go::BoundedSurface::point | ( | Point & | pt, | |
double | upar, | |||
double | vpar | |||
) | const [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 |
Implements Go::ParamSurface.
virtual void Go::BoundedSurface::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 [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. |
Implements Go::ParamSurface.
virtual void Go::BoundedSurface::point | ( | std::vector< Point > & | pts, | |
double | upar, | |||
double | vpar, | |||
int | derivs | |||
) | const [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 |
virtual void Go::BoundedSurface::normal | ( | Point & | n, | |
double | upar, | |||
double | vpar | |||
) | const [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 |
Implements Go::ParamSurface.
virtual std::vector<boost::shared_ptr<ParamCurve> > Go::BoundedSurface::constParamCurves | ( | double | parameter, | |
bool | pardir_is_u | |||
) | const [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. |
Implements Go::ParamSurface.
virtual std::vector<boost::shared_ptr<ParamSurface> > Go::BoundedSurface::subSurfaces | ( | double | from_upar, | |
double | from_vpar, | |||
double | to_upar, | |||
double | to_vpar, | |||
double | fuzzy = DEFAULT_PARAMETER_EPSILON | |||
) | const [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 |
Implements Go::ParamSurface.
virtual double Go::BoundedSurface::nextSegmentVal | ( | int | dir, | |
double | par, | |||
bool | forward, | |||
double | tol | |||
) | const [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 |
Implements Go::ParamSurface.
virtual void Go::BoundedSurface::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 [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. |
Implements Go::ParamSurface.
virtual void Go::BoundedSurface::closestBoundaryPoint | ( | 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 [virtual] |
Iterates to the closest point to pt on the boundary of the surface.
Implements Go::ParamSurface.
virtual void Go::BoundedSurface::getBoundaryInfo | ( | Point & | pt1, | |
Point & | pt2, | |||
double | epsilon, | |||
SplineCurve *& | cv, | |||
SplineCurve *& | crosscv, | |||
double | knot_tol = 1e-05 | |||
) | const [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. NB: This function has not yet been implemented!
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. |
Implements Go::ParamSurface.
void Go::BoundedSurface::getBoundaryInfo | ( | Point & | pt1, | |
Point & | pt2, | |||
vector< shared_ptr< CurveOnSurface > > & | bd_cvs | |||
) | const |
Get the boundary curve segment between two points on the same boundary loop.
If the given points are not positioned on the same boundary loop (within a certain tolerance), no curves will be retuned.
pt1 | the first point on the boundary, given by the user | |
pt2 | the second point on the boundary, given by the user |
bd_cvs | upon return, this will contain shared pointers to curves that, taken consecutively, describe the requested boundary segment in its entirety. |
virtual void Go::BoundedSurface::reverseParameterDirection | ( | bool | direction_is_u | ) | [virtual] |
Reverses the direction of the basis in input direction.
NB: This function has not yet been implemented!
direction_is_u | if 'true', the first parameter direction will be reversed, otherwise, the second parameter direction will be reversed |
Implements Go::ParamSurface.
void Go::BoundedSurface::makeBoundaryCurvesG1 | ( | double | kink | ) |
This function processes all the curves that participate in defining the surface's (trimmed) boundary.
Those curves that are not G1 within a certain tolerance are split into severalcurves, so that all G1-discontinuities will end up between consecutive curve segments.
kink | the tolerance to use for checking G1 continuity |
void Go::BoundedSurface::setParameterDomain | ( | double | u1, | |
double | u2, | |||
double | v1, | |||
double | v2 | |||
) |
Change the parameter domain of the underlying surface, and modify the boundary loops with respect to this change.
u1 | new start value of first parameter | |
u2 | new end value of first parameter | |
v1 | new start value of second parameter | |
v2 | new end value of second parameter |
void Go::BoundedSurface::splitSingleLoops | ( | ) |
Split all boundary loops defined by only curve into three parts.
(This somewhat exotic member function is included due to its handiness with the GoTools topology analysator).
shared_ptr<ParamSurface> Go::BoundedSurface::underlyingSurface | ( | ) | [inline] |
Get a pointer to the underlying surface.
Definition at line 406 of file BoundedSurface.h.
shared_ptr<const ParamSurface> Go::BoundedSurface::underlyingSurface | ( | ) | const [inline] |
Get a pointer to the underlying surface.
Definition at line 411 of file BoundedSurface.h.
SplineCurve* Go::BoundedSurface::constParamCurve | ( | double | parameter, | |
bool | direction_is_u | |||
) | const |
Get the space-curve resulting from fixing one of the surface's parameters and moving the other along its allowed range (inside the trimmed domain).
If this results in several disjoint curves, an exception is thrown.
parameter | the parameter value of the fixed parameter | |
direction_is_u | if 'true' then the "free" parameter will be the first one, and the second parameter will be fixed. If 'false', it is the other way around. |
virtual bool Go::BoundedSurface::isDegenerate | ( | bool & | b, | |
bool & | r, | |||
bool & | t, | |||
bool & | l, | |||
double | tolerance | |||
) | const [virtual] |
Query whether any of the four boundaries of the underlying surface 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 |
Implements Go::ParamSurface.