#include <CurveLoop.h>
Public Member Functions | |
CurveLoop () | |
Create an empty loop. | |
CurveLoop (const std::vector< boost::shared_ptr< ParamCurve > > &curves, double space_epsilon) | |
Create a loop based on a given set of curves. | |
virtual | ~CurveLoop () |
Virtual destructor allows safe inheritance. | |
void | swap (CurveLoop &other) |
Quick swap of one CurveLoop with another. | |
void | setCurves (const std::vector< boost::shared_ptr< ParamCurve > > &curves) |
Reset the CurveLoop based on a given vector of curves. | |
void | turnOrientation () |
Reverse the direction of all curves and their mutual order. | |
void | setSpaceEpsilon (const double space_epsilon) |
Set the tolerance (used to determine whether the start/end points on curves are coincident) to a given value. | |
double | getSpaceEpsilon () const |
Get the tolerance value (used to determine whether the start/end points on curves are coincident). | |
int | size () const |
Query the number of curves constituting the CurveLoop. | |
std::vector< boost::shared_ptr< ParamCurve > >::const_iterator | begin () const |
Get a const iterator to the first curve in the CurveLoop. | |
std::vector< boost::shared_ptr< ParamCurve > >::const_iterator | end () const |
Get a const iterator to one-past-the-last curve in the CurveLoop. | |
std::vector< boost::shared_ptr< ParamCurve > >::iterator | begin () |
Get a iterator to the first curve in the CurveLoop. | |
std::vector< boost::shared_ptr< ParamCurve > >::iterator | end () |
Get a iterator to one-past-the-last curve in the CurveLoop. | |
boost::shared_ptr< ParamCurve > | operator[] (int index) const |
Get a shared pointer to the i'th curve in the CurveLoop. | |
void | closestPoint (const Point &pt, int &clo_ind, double &clo_par, Point &clo_pt, double &clo_dist) const |
Find the closest point on the curve loop to a point specified by the user. | |
void | closestParPoint (const Point &pt, int &clo_ind, double &clo_par, Point &clo_pt, double &clo_dist) const |
View the loop as a curve in the parameter space and compute the closest point in the loop. |
The start point of curve (i+1) should coincide (within a certain tolerance) with the end point of curve (i), and the end point of the last curve should coincide with the start point of the first curve. CurveLoops are useful in, for example, describing the boundary of a surface.
Definition at line 53 of file CurveLoop.h.
Go::CurveLoop::CurveLoop | ( | const std::vector< boost::shared_ptr< ParamCurve > > & | curves, | |
double | space_epsilon | |||
) |
Create a loop based on a given set of curves.
curves | a vector with shared pointers to the curves defining the CurveLoop. The start point of each curve should match the end point of the previous curve within the given tolerance. The same is the same for the start point on the first curve and the end point on the last curve). Moreover, it is expected that all curves are of the same type, and that they all lie in the same space (ie. have the same dimension). | |
space_epsilon | the given tolerance for defining coincidence between start/end points on curves. |
void Go::CurveLoop::setCurves | ( | const std::vector< boost::shared_ptr< ParamCurve > > & | curves | ) |
Reset the CurveLoop based on a given vector of curves.
(But keep the previously set tolerance value.
curves | a vector with shared pointers to the curves defining the CurveLoop. The start point of each curve should match the end point of the previous curve within the given tolerance. The same is the same for the start point on the first curve and the end point on the last curve). Moreover, it is expected that all curves are of the same type, and that they all lie in the same space (ie. have the same dimension). |
void Go::CurveLoop::setSpaceEpsilon | ( | const double | space_epsilon | ) |
Set the tolerance (used to determine whether the start/end points on curves are coincident) to a given value.
space_epsilon | set the tolerance to this value |
int Go::CurveLoop::size | ( | ) | const [inline] |
Query the number of curves constituting the CurveLoop.
Definition at line 103 of file CurveLoop.h.
std::vector< boost::shared_ptr<ParamCurve> >::const_iterator Go::CurveLoop::begin | ( | ) | const [inline] |
Get a const iterator to the first curve in the CurveLoop.
Definition at line 107 of file CurveLoop.h.
std::vector< boost::shared_ptr<ParamCurve> >::const_iterator Go::CurveLoop::end | ( | ) | const [inline] |
Get a const iterator to one-past-the-last curve in the CurveLoop.
Definition at line 112 of file CurveLoop.h.
std::vector< boost::shared_ptr<ParamCurve> >::iterator Go::CurveLoop::begin | ( | ) | [inline] |
Get a iterator to the first curve in the CurveLoop.
Definition at line 117 of file CurveLoop.h.
std::vector< boost::shared_ptr<ParamCurve> >::iterator Go::CurveLoop::end | ( | ) | [inline] |
Get a iterator to one-past-the-last curve in the CurveLoop.
Definition at line 122 of file CurveLoop.h.
boost::shared_ptr<ParamCurve> Go::CurveLoop::operator[] | ( | int | index | ) | const |
Get a shared pointer to the i'th curve in the CurveLoop.
index | the index of the requested curve |
void Go::CurveLoop::closestPoint | ( | const Point & | pt, | |
int & | clo_ind, | |||
double & | clo_par, | |||
Point & | clo_pt, | |||
double & | clo_dist | |||
) | const |
Find the closest point on the curve loop to a point specified by the user.
pt | The point given by the user. We want to determine the closest point to this on the CurveLoop. | |
clo_ind | Upon return: the index of the curve segment on which the closest point was found. | |
clo_par | Upon return: the parameter of the detected closest point on the curve containing it. | |
clo_pt | Upon return: the geometric position of the detected closest point | |
clo_dist | Upon return: the distance to the detected closest point. |
void Go::CurveLoop::closestParPoint | ( | const Point & | pt, | |
int & | clo_ind, | |||
double & | clo_par, | |||
Point & | clo_pt, | |||
double & | clo_dist | |||
) | const |
View the loop as a curve in the parameter space and compute the closest point in the loop.
This function is only interesting if the curves constituting the CurveLoop are of type "CurveOnSurface". In that case, the curves have a 2D representation in the parametric domain of the surface, as well as a 3D representation in geometric space. This function will search for the closest point in parametric space to a parametric (2D) point specified by the user.
pt | The point given by the user. It should be a 2D point refering to the parametric domain of a surface. We want to determine the closest point to this on the CurveLoop. | |
clo_ind | Upon return: the index of the curve segment on which the closest point was found. | |
clo_par | Upon return: the parameter of the detected closest point on the curve segment containing it (a scalar value) | |
clo_pt | Upon return: the curve segment's closest point represented as a 2D parameter pair in the domain of the underlying surface. | |
clo_dist | Upon return: the distance between the point given by the user and the found closest point, measured in the parametric domain of the underlying surface. |