#include <IntersectionPool.h>
Public Member Functions | ||||
IntersectionPool (boost::shared_ptr< ParamObjectInt > obj1, boost::shared_ptr< ParamObjectInt > obj2, boost::shared_ptr< IntersectionPool > parent=boost::shared_ptr< IntersectionPool >(), int missing_dir=-1, double missing_value=0) | ||||
Constructor. | ||||
virtual | ~IntersectionPool () | |||
Destructor. | ||||
void | addParamPoints (int nmb_int_pts, double *pointpar1, double *pointpar2, boost::shared_ptr< GeoTol > epsge) | |||
Add a number of IntersectionPoint s to the pool by specifying their parameter values. | ||||
template<class ip_iterator> | ||||
void | addCurves (int nmb_int_cvs, ip_iterator *start_iterators, ip_iterator *end_iterators) | |||
Add a number of IntersectionCurves to the pool by specifying iterators to the IntersectionPoint making up the curves. | ||||
template<class ip_iterator> | ||||
void | addCurve (ip_iterator start, ip_iterator end) | |||
Add one IntersectionCurve to the pool, by specifying a range of IntersectionPoints that make up the curve. | ||||
void | getBoundaryIntersections (std::vector< boost::shared_ptr< IntersectionPoint > > &bd_ints) | |||
Get a vector containing shared pointers to all IntersectionPoints in the pool that is located on the boundary of one of the pool's objects. | ||||
void | getSortedIntersections (std::vector< boost::shared_ptr< IntersectionPoint > > &int_pts) | |||
Get a vector containing shared pointers to all the IntersectionPoints in the pool. | ||||
std::vector< double > | getSortedInnerInts (int pardir) | |||
Get a vector containing the parametric values along a specific parameter direction for all the pool's IntersectionPoints that do not lie 'on' or 'close to' the boundary along this parameter. | ||||
void | getSortedBdInts (const Point &vec, std::vector< boost::shared_ptr< IntersectionPoint > > &result, int obj_nmb=-1) | |||
Get a vector containing shared pointers to the pool's IntersectionPoints, sorted along a given spatial or parametrical direction. | ||||
bool | checkSortingDir (Point &vec, int sorting_obj) | |||
Check the consistency between the direction of the intersection curve indicated by vec and the direction computed in the existing intersection points. | ||||
void | getSortedInts (std::vector< boost::shared_ptr< IntersectionPoint > > &result) | |||
void | getAllIntersections (std::vector< boost::shared_ptr< IntersectionPoint > > &result) | |||
void | getBranchPoints (std::vector< boost::shared_ptr< IntersectionPoint > > &pts) | |||
Get a vector containing all those IntersectionPoints in the pool that are branchpoints. | ||||
void | getMidParameter (double *mid) | |||
Compute the middle parameter value of all intersection points of this intersection pool. | ||||
boost::shared_ptr< IntersectionPoint > | addIntersectionPoint (boost::shared_ptr< ParamObjectInt > obj_int1_, boost::shared_ptr< ParamObjectInt > obj_int2_, boost::shared_ptr< GeoTol > epsge, double *par1, double *par2) | |||
Construct a new IntersectionPoint and add it to this pool, as well as the pool's parents (and older ancestors). | ||||
void | includeReducedInts (boost::shared_ptr< IntersectionPool > lower_order_pool) | |||
Include the IntersectionPoints in the lower_order_pool into 'this' pool, generating new representations of the points which includes the missing parameter. | ||||
void | selfIntersectParamReorganise (boost::shared_ptr< IntersectionPool > sub_pool) | |||
Reorganize self-intersection parameters. | ||||
bool | hasPointsInInner (int pardir) | |||
Check if this IntersectionPool contains IntersectionPoints that are not "boundary points" with respect to the parameter pardir. | ||||
bool | hasIntersectionPoints () const | |||
Check if this IntersectionPool contains any IntersectionPoints at all. | ||||
int | numIntersectionPoints () const | |||
Query the number of IntersectionPoints contained in this IntersectionPool. | ||||
int | numSingularIntersectionPoints () | |||
Get the number of IntersectionPoints in this pool who are not classified as ORDINARY_POINTs (see SingularityType for more info), i.e. | ||||
bool | isInDomain (IntersectionPoint *pnt) const | |||
Check if a given IntersectionPoint is in this IntersectionPool. | ||||
bool | closestInDomain (double param[], boost::shared_ptr< IntersectionPoint > &pnt) const | |||
Locate the IntersectionPoint in this IntersectionPool whose parameter values are closest (in the Euclidean norm on the parameter space) to a given set of parameters. | ||||
bool | closestInDomain (const double param[], boost::shared_ptr< IntersectionPoint > &pnt) const | |||
Locate the IntersectionPoint in this IntersectionPool whose parameter values are closest (in the Euclidean norm on the parameter space) to a given set of parameters. | ||||
bool | existIntersectionPoint (int dir, double par) | |||
Checks the existence of any intersection points with the given parameter in the given direction. | ||||
int | inInfluenceArea (int pardir, double par, bool first_outside=true) | |||
Check if a given parameter value in a given parameter direction lies in the influence area of any IntersectionPoints in the pool. | ||||
int | inInfluenceArea (int pardir, double par, std::vector< boost::shared_ptr< IntersectionPoint > > &int_pts, bool first_outside=true) | |||
Check if a given parameter value in a given parameter direction lies in the influence area of any IntersectionPoints in the specified vector. | ||||
void | getIntersectionPoints (std::vector< boost::shared_ptr< IntersectionPoint > > &int_pts) const | |||
Fill the vector given as argument with shared pointers to all the IntersectionPoints in 'this' IntersectionPool. | ||||
void | getIntersectionCurves (std::vector< boost::shared_ptr< IntersectionCurve > > &int_curves) const | |||
Fill the argument vector with shared pointers to all the IntersectionCurves in 'this' IntersectionPool. | ||||
std::vector< boost::shared_ptr< IntersectionPoint > > & | getIntersectionPoints () | |||
Get a reference to the vector containing (shared pointers to) 'this' IntersectionPool's IntersectionPoints. | ||||
const std::vector< boost::shared_ptr< IntersectionPoint > > & | getIntersectionPoints () const | |||
Get a reference to the vector containing (shared pointers to) 'this' IntersectionPools IntersectionPoint s. | ||||
const std::vector< boost::shared_ptr< IntersectionCurve > > & | getIntersectionCurves () const | |||
Get a reference to the vector containing (shared pointers to) 'this' IntersectionPools IntersectionCurves. | ||||
void | getIntersectionPoints (int dir, double par, std::vector< boost::shared_ptr< IntersectionPoint > > &result) const | |||
Fetch the IntersectionPoints with a specified parameter value in a specified direction. | ||||
bool | hasIntersectionPoints (int dir, double par) const | |||
Check if the IntersectionPool contains at least one IntersectionPoint with the specified parameter value in the specified direction. | ||||
bool | checkIntersectionPoints (std::vector< IntPtInfo > &int_pt_info) const | |||
Check if the intersection points are OK. | ||||
bool | checkIntersectionLinks () const | |||
Check if the intersection links are OK. | ||||
void | removeDoublePoints () | |||
Remove double points by merging into one single point. | ||||
void | removeDefectLinks () | |||
Remove defect intersection links. | ||||
void | getResult (std::vector< boost::shared_ptr< IntersectionPoint > > &int_points, std::vector< boost::shared_ptr< IntersectionCurve > > &int_curves) | |||
Get all isolated IntersectionPoints in the pool (those with no neighbours), as well as all IntersectionCurves. | ||||
int | lackingParameter () const | |||
Get the index of the missing parameter (-1 if none missing). | ||||
double | lackingParameterValue () const | |||
Get value of missing parameter (if it exists). | ||||
bool | atSameBoundary (boost::shared_ptr< IntersectionPoint > pt1, boost::shared_ptr< IntersectionPoint > pt2) | |||
Check if two IntersectionPoints lie on the same boundary of the parametric domain of this IntersectionPools objects (obj1_ and obj2_). | ||||
bool | atDifferentBoundary (boost::shared_ptr< IntersectionPoint > pt1, boost::shared_ptr< IntersectionPoint > pt2) | |||
Check if two IntersectionPoints can be found on two different boundaries of the parametric domain of this IntersectionPools objects (obj1_ and obj2_). | ||||
bool | isBoundaryIntersection (boost::shared_ptr< IntersectionPoint > pt1, boost::shared_ptr< IntersectionPoint > pt2) | |||
Check if the two specified IntersectionPoints represent a boundary intersection in this pool. | ||||
bool | isBoundaryPoint (boost::shared_ptr< IntersectionPoint > pt1) | |||
Check if a point lies at a boundary in the current domain(s). | ||||
bool | fetchLoops (std::vector< std::vector< boost::shared_ptr< IntersectionPoint > > > &loop_ints) | |||
Get all the intersection loops contained in this IntersectionPool. | ||||
bool | isPAC (std::vector< boost::shared_ptr< IntersectionPoint > > &int_loop) | |||
Check if a given loop delimits a partial coincidence area (PAC). | ||||
void | setCoincidence (std::vector< boost::shared_ptr< IntersectionPoint > > &int_loop) | |||
Set the specified loop to be a partial coincidence area (PAC). | ||||
bool | isConnectedInside (boost::shared_ptr< IntersectionPoint > pt1, boost::shared_ptr< IntersectionPoint > pt2) | |||
Checks if there is a path of connected IntersectionPoints going between the two IntersectionPoints specified. | ||||
void | makeIntersectionCurves () | |||
Prepare output by making IntersectionCurves. | ||||
void | getOrigPoints (std::vector< boost::shared_ptr< IntersectionPoint > > &int_pts) const | |||
Get the "original" intersection points of this intersection pool. | ||||
void | writeDebug (int singular=0) | |||
Write various debug information. | ||||
void | splitIntersectionLinks (int fixed_dir, double fixed_val) | |||
Among all IntersectionLinks between IntersectionPoints in this pool, split those who cross a specified parameter direction at a specified parameter value. | ||||
int | numParams () const | |||
Get the combined number of parameter directions in the two objects. | ||||
double | startParam (int dir) const | |||
Get the start of the parameter interval for the specified parameter direction. | ||||
double | endParam (int dir) const | |||
Get the end of the parameter interval for the specified parameter direction. | ||||
void | includeCoveredNeighbourPoints () | |||
Check all the neighbours of the IntersectionPoints in this pool, and add those of them that are not already in the pool, but whose parameters are covered by the pool's parameter domain. | ||||
void | insertInInfluenceInterval (boost::shared_ptr< IntersectionPoint > pt_in_pool, double *parvals, int pardir) | |||
Create a new IntersectionPoint and add it to the the IntersectionPool. | ||||
void | synchronizePool () | |||
Synchronize pool with its parent. | ||||
void | cleanUpPool (int first_idx=0, double epsge=1.0e-15) | |||
Remove redundant IntersectionPoints from the pool, starting from the point indexed first_idx and upwards. | ||||
void | removeIntPoint (boost::shared_ptr< IntersectionPoint > int_point) | |||
| ||||
void | removeIntPoint2 (boost::shared_ptr< IntersectionPoint > int_point) | |||
Remove an IntersectionPoint from the pool. | ||||
void | removeIntPoints (double *frompar, double *topar, bool only_inner=false) | |||
Remove all intersection points from the pool whose parameters lie in the box defined by frompar and topar. | ||||
void | intersectAlongCommonBoundary (double frac, std::vector< BoundaryIntersectionData > &isects) | |||
Check if two surfaces intersect along a common boundary (i.e. | ||||
void | removeBoundaryIntersections (bool single_pt=true) | |||
Removes IntersectionLinks positioned along the boundary of both objects, The concerned IntersectionPoints are also removed, except when they also links to points which are NOT on the boundary. | ||||
bool | verifyIntersectionLink (const boost::shared_ptr< IntersectionLink > &link, int recursion_limit=10) const | |||
Verify that the given intersection link is in the pool and represents a connected piece of the intersection curve. | ||||
bool | checkIntersectionChain (IntersectionPoint *pnt, IntersectionPoint *first, IntersectionPoint *prev=0) | |||
Check consistence of chain of intersection links with respect to number of neighbours. | ||||
bool | validate () const | |||
Checks if the pool is "valid", that is, if the intersection points on the present subdivision level exist also on previous levels. | ||||
void | writeIntersectionPoints () const | |||
Writes out a list of the current intersection points in the pool. | ||||
void | writeIntersectionLinks () const | |||
Writes out a list of links beween intersection points in the pool. | ||||
Friends | ||||
class | SfSfIntersector |
Definition at line 60 of file IntersectionPool.h.
Go::IntersectionPool::IntersectionPool | ( | boost::shared_ptr< ParamObjectInt > | obj1, | |
boost::shared_ptr< ParamObjectInt > | obj2, | |||
boost::shared_ptr< IntersectionPool > | parent = boost::shared_ptr< IntersectionPool >() , |
|||
int | missing_dir = -1 , |
|||
double | missing_value = 0 | |||
) |
Constructor.
obj1 | the first object of the (possible) intersection | |
obj2 | the second object of the (possible) intersection | |
parent | pointer to parent pool (null pointer if no parent) | |
missing_dir | index of the missing parameter (negative if no missing parameter) | |
missing_value | value of the missing parameter |
void Go::IntersectionPool::addParamPoints | ( | int | nmb_int_pts, | |
double * | pointpar1, | |||
double * | pointpar2, | |||
boost::shared_ptr< GeoTol > | epsge | |||
) |
Add a number of IntersectionPoint s to the pool by specifying their parameter values.
nmb_int_pts | the number of IntersectionPoint s that shall be added to the pool. | |
pointpar1 | pointer to an array containing the consecutive parameter values in the first object for the IntersectionPoint s to add. | |
pointpar2 | pointer to an array containing the consecutive parameter values in the second object for the IntersectionPoint s to add. | |
epsge | shared pointer to the object specifying the tolerances to use for the added IntersectionPoint s. |
void Go::IntersectionPool::getBoundaryIntersections | ( | std::vector< boost::shared_ptr< IntersectionPoint > > & | bd_ints | ) |
Get a vector containing shared pointers to all IntersectionPoints in the pool that is located on the boundary of one of the pool's objects.
bd_ints | vector of shared pointers to boundary intersection points |
void Go::IntersectionPool::getSortedIntersections | ( | std::vector< boost::shared_ptr< IntersectionPoint > > & | int_pts | ) |
Get a vector containing shared pointers to all the IntersectionPoints in the pool.
The entries in the vector will be sorted according to parameter values.
int_pts | vector containing the pool's IntersectionPoints in a sorted manned. |
std::vector<double> Go::IntersectionPool::getSortedInnerInts | ( | int | pardir | ) |
Get a vector containing the parametric values along a specific parameter direction for all the pool's IntersectionPoints that do not lie 'on' or 'close to' the boundary along this parameter.
The returned values will be sorted according to increasing value.
pardir | the concerned parameter direction |
void Go::IntersectionPool::getSortedBdInts | ( | const Point & | vec, | |
std::vector< boost::shared_ptr< IntersectionPoint > > & | result, | |||
int | obj_nmb = -1 | |||
) |
Get a vector containing shared pointers to the pool's IntersectionPoints, sorted along a given spatial or parametrical direction.
NOTE: The name of this function contains 'Bd' for 'boundary' for historical reasons. In fact, we get all intersections.
vec | the direction along which to sort the IntersectionPoint. If the number of vector elements is 3, it is interpreted as a 'spatial' vector; otherwise it is interpreted as a vector in the combined parametric domain of the two objects. |
result | vector of shared pointers to IntersectionPoints |
bool Go::IntersectionPool::checkSortingDir | ( | Point & | vec, | |
int | sorting_obj | |||
) |
Check the consistency between the direction of the intersection curve indicated by vec and the direction computed in the existing intersection points.
Turn the direction of vec if necessary.
vec | the direction of the intersection curve. This mey be turned if necessary. | |
sorting_obj | the object - 0 or 1 - used for sorting |
'true' | if ???, 'false' if ??? |
void Go::IntersectionPool::getBranchPoints | ( | std::vector< boost::shared_ptr< IntersectionPoint > > & | pts | ) |
Get a vector containing all those IntersectionPoints in the pool that are branchpoints.
pts | vector of shared pointers to IntersectionPointss |
void Go::IntersectionPool::getMidParameter | ( | double * | mid | ) |
Compute the middle parameter value of all intersection points of this intersection pool.
mid | points to an array of doubles where the result will be written. The number of elements in the array is equal to the total number of parameter directions for this pool. |
boost::shared_ptr<IntersectionPoint> Go::IntersectionPool::addIntersectionPoint | ( | boost::shared_ptr< ParamObjectInt > | obj_int1_, | |
boost::shared_ptr< ParamObjectInt > | obj_int2_, | |||
boost::shared_ptr< GeoTol > | epsge, | |||
double * | par1, | |||
double * | par2 | |||
) |
Construct a new IntersectionPoint and add it to this pool, as well as the pool's parents (and older ancestors).
NB: The objects given as input should be equal to - or sub-objects of the objects that are already pointed to by this pool.
obj_int1_ | The first of the intersecting objects of the new IntersectionPoint | |
obj_int2_ | The second of the intersecting objects of the new IntersectionPoint | |
epsge | the tolerances used for the new IntesectionPoint | |
par1 | pointer to the IntersectionPoint's parameters in the first object | |
par2 | pointer to the IntersectionPoint's parameters in the second object |
void Go::IntersectionPool::includeReducedInts | ( | boost::shared_ptr< IntersectionPool > | lower_order_pool | ) |
Include the IntersectionPoints in the lower_order_pool into 'this' pool, generating new representations of the points which includes the missing parameter.
It is assumed that the IntersectionPoints in lower_order_pool have no IntersectionLink with points outside the pool.
lower_order_pool | a pointer to the lower-order pool from which we want to include its IntersectionPoints. |
void Go::IntersectionPool::selfIntersectParamReorganise | ( | boost::shared_ptr< IntersectionPool > | sub_pool | ) |
Reorganize self-intersection parameters.
A 'twin point' is a concept when working with self-intersection objects. It represent an IntersectionPoint that already exist in the parent pool, but whose ordering of parameters had to be switched in order to conform with its objects (which are really two parts of the same, global surface). If a pool contains twin points, we must assure that the curves where these points are included have a consistent ordering of the parameters. This function takes care of making this ordering consistent. Moreover, since the twin points are really just another representation of an already-existing point, they will go out of scope and disappear when the sub-pool in which they lie is destroyed. Therefore, we must make sure that points linked to by the twin points will now be linked to by the original points that the twin-points are representing.
NB: This is a very special function that is only used with the following preconditions:
sub_pool | shared pointer to the sub-pool, as described above. |
bool Go::IntersectionPool::hasPointsInInner | ( | int | pardir | ) |
Check if this IntersectionPool contains IntersectionPoints that are not "boundary points" with respect to the parameter pardir.
pardir | the parameter direction we want to check for |
bool Go::IntersectionPool::hasIntersectionPoints | ( | ) | const [inline] |
Check if this IntersectionPool contains any IntersectionPoints at all.
Definition at line 292 of file IntersectionPool.h.
int Go::IntersectionPool::numIntersectionPoints | ( | ) | const [inline] |
Query the number of IntersectionPoints contained in this IntersectionPool.
Definition at line 298 of file IntersectionPool.h.
int Go::IntersectionPool::numSingularIntersectionPoints | ( | ) |
Get the number of IntersectionPoints in this pool who are not classified as ORDINARY_POINTs (see SingularityType for more info), i.e.
points that lie on non-transversal intersections.
bool Go::IntersectionPool::isInDomain | ( | IntersectionPoint * | pnt | ) | const |
Check if a given IntersectionPoint is in this IntersectionPool.
pnt | pointer to the IntersectionPoint that we want to check. |
bool Go::IntersectionPool::closestInDomain | ( | double | param[], | |
boost::shared_ptr< IntersectionPoint > & | pnt | |||
) | const |
Locate the IntersectionPoint in this IntersectionPool whose parameter values are closest (in the Euclidean norm on the parameter space) to a given set of parameters.
param[] | pointer to an array containing the parameter values that we want to find the closest IntersectionPoint to. |
pnt | upon function return, if a closest IntersectionPoint was found, pnt will be set to that IntersectionPoint. |
bool Go::IntersectionPool::closestInDomain | ( | const double | param[], | |
boost::shared_ptr< IntersectionPoint > & | pnt | |||
) | const |
Locate the IntersectionPoint in this IntersectionPool whose parameter values are closest (in the Euclidean norm on the parameter space) to a given set of parameters.
param[] | pointer to an array containing the parameter values that we want to find the closest IntersectionPoint to. |
pnt | upon function return, if a closest IntersectionPoint was found, pnt will be set to that IntersectionPoint. |
bool Go::IntersectionPool::existIntersectionPoint | ( | int | dir, | |
double | par | |||
) |
Checks the existence of any intersection points with the given parameter in the given direction.
dir | specifies the concerned parameter direction. | |
par | specifies the value of this parameter. |
int Go::IntersectionPool::inInfluenceArea | ( | int | pardir, | |
double | par, | |||
bool | first_outside = true | |||
) |
Check if a given parameter value in a given parameter direction lies in the influence area of any IntersectionPoints in the pool.
pardir | the concerned parameter direction | |
par | the parameter value to check against | |
first_outside | if this is set to 'true' then the outer brackets of the influence intervals will be used (which in practice means that if the function returns 'false', then par is guaranteed to be outside the influence area of all points). If this argument is set to 'false', then the inner brackets of the influence interval will be used (which in practice means that if the function returns 'true', then par is guaranteed to be inside the influence area of at least one point). |
int Go::IntersectionPool::inInfluenceArea | ( | int | pardir, | |
double | par, | |||
std::vector< boost::shared_ptr< IntersectionPoint > > & | int_pts, | |||
bool | first_outside = true | |||
) |
Check if a given parameter value in a given parameter direction lies in the influence area of any IntersectionPoints in the specified vector.
pardir | the concerned parameter direction | |
par | the parameter value to check against | |
int_pts | the vector of IntersectionPoints to check against. | |
first_outside | if this is set to 'true' then the outer brackets of the influence intervals will be used (which in practice means that if the function returns 'false', then par is guaranteed to be outside the influence area of all points). If this argument is set to 'false', then the inner brackets of the influence interval will be used (which in practice means that if the function returns 'true', then par is guaranteed to be inside the influence area of at least one point). |
void Go::IntersectionPool::getIntersectionPoints | ( | int | dir, | |
double | par, | |||
std::vector< boost::shared_ptr< IntersectionPoint > > & | result | |||
) | const |
Fetch the IntersectionPoints with a specified parameter value in a specified direction.
dir | the specified parameter direction | |
par | the specified parameter value |
result | the vector containing those of the pool's IntersectionPoints that (approximately) had the specified parameter value in the specified parameter direction. |
bool Go::IntersectionPool::hasIntersectionPoints | ( | int | dir, | |
double | par | |||
) | const |
Check if the IntersectionPool contains at least one IntersectionPoint with the specified parameter value in the specified direction.
dir | the specified parameter direction | |
par | the specified parameter value |
bool Go::IntersectionPool::checkIntersectionPoints | ( | std::vector< IntPtInfo > & | int_pt_info | ) | const |
Check if the intersection points are OK.
If they are not, give further diagnostics.
int_pt_info | vector with information about the intersection points. This information has the type of struct IntPtInfo, which indicates if the point is ok, the number of neighbours, the singularity type, and the location of the point is the parameter domains of the objects |
bool Go::IntersectionPool::checkIntersectionLinks | ( | ) | const |
Check if the intersection links are OK.
If they are not, give further diagnostics.
void Go::IntersectionPool::removeDoublePoints | ( | ) |
Remove double points by merging into one single point.
Double points are points that are the same within the tolerance. The new points that results from this will inherit all the links from the old points.
void Go::IntersectionPool::removeDefectLinks | ( | ) |
Remove defect intersection links.
Whether or not a link is defect depends on the return value of verifyIntersectionLink().
void Go::IntersectionPool::getResult | ( | std::vector< boost::shared_ptr< IntersectionPoint > > & | int_points, | |
std::vector< boost::shared_ptr< IntersectionCurve > > & | int_curves | |||
) |
Get all isolated IntersectionPoints in the pool (those with no neighbours), as well as all IntersectionCurves.
int_points | upon function return, this vector will contain shared pointers to all the IntersectionPoints in this pool that had no neighbours. | |
int_curves | upon function return, this vector will contain shared pointers to all the IntersectionCurves contained in this pool. |
bool Go::IntersectionPool::atSameBoundary | ( | boost::shared_ptr< IntersectionPoint > | pt1, | |
boost::shared_ptr< IntersectionPoint > | pt2 | |||
) |
Check if two IntersectionPoints lie on the same boundary of the parametric domain of this IntersectionPools objects (obj1_ and obj2_).
pt1 | the first IntersectionPoint | |
pt2 | the second IntersectionPoint |
bool Go::IntersectionPool::atDifferentBoundary | ( | boost::shared_ptr< IntersectionPoint > | pt1, | |
boost::shared_ptr< IntersectionPoint > | pt2 | |||
) |
Check if two IntersectionPoints can be found on two different boundaries of the parametric domain of this IntersectionPools objects (obj1_ and obj2_).
pt1 | the first IntersectionPoint | |
pt2 | the second IntersectionPoint |
bool Go::IntersectionPool::isBoundaryIntersection | ( | boost::shared_ptr< IntersectionPoint > | pt1, | |
boost::shared_ptr< IntersectionPoint > | pt2 | |||
) |
Check if the two specified IntersectionPoints represent a boundary intersection in this pool.
In order to be interpreted as such, they must both lie on the same (parametric) boundary, and be connected with an iso-parametric IntersectionLink
pt1 | the first IntersectionPoint | |
pt2 | the second IntersectionPoint |
bool Go::IntersectionPool::fetchLoops | ( | std::vector< std::vector< boost::shared_ptr< IntersectionPoint > > > & | loop_ints | ) |
Get all the intersection loops contained in this IntersectionPool.
This function assumes that the topologies of the loops in this pool are not too 'warped'. Notably, it might fail if two loops share some edges, since in that case there will be ambiguous choices for what constitutes the loops. (This is a fact from graph theory, and if we want to work around it, we might have to consider additional information of a non-topological nature, like looking at the geometric/parametric position of the points).
loop_ints | upon function return, this vector will contain all the loops that were found in this IntersectionPool (each loop is represented as a vector of IntersectionPoints). |
bool Go::IntersectionPool::isPAC | ( | std::vector< boost::shared_ptr< IntersectionPoint > > & | int_loop | ) |
Check if a given loop delimits a partial coincidence area (PAC).
To determine this the meta-information in the IntersectionLink s is examined.
int_loop | the loop to check |
void Go::IntersectionPool::setCoincidence | ( | std::vector< boost::shared_ptr< IntersectionPoint > > & | int_loop | ) |
Set the specified loop to be a partial coincidence area (PAC).
This is written into the loop's IntersectionLinks as meta-information.
int_loop | the loop in question |
bool Go::IntersectionPool::isConnectedInside | ( | boost::shared_ptr< IntersectionPoint > | pt1, | |
boost::shared_ptr< IntersectionPoint > | pt2 | |||
) |
Checks if there is a path of connected IntersectionPoints going between the two IntersectionPoints specified.
The specified points are assumed to be in this IntersectionPool, and all IntersectionPoints of the path must also be in the pool.
pt1 | the first IntersectionPoint. Must already be in the pool. Otherwise, an error will occur. | |
pt2 | the second IntersectionPoint. Must already be in the pool. Otherwise, an error will occur. |
void Go::IntersectionPool::makeIntersectionCurves | ( | ) |
Prepare output by making IntersectionCurves.
Points that have one or three or more IntersectionLinks are considered endpoints to curves, points with two IntersectionLinks lie in the inner of a curve.
void Go::IntersectionPool::getOrigPoints | ( | std::vector< boost::shared_ptr< IntersectionPoint > > & | int_pts | ) | const |
Get the "original" intersection points of this intersection pool.
If this pool has no parents with the same number of parameters as itself, then return the IntersectionPoints of this pool. Otherwise, return the IntersectionPoints of the parent pool.
int_pts | the returned IntersectionPoints. |
void Go::IntersectionPool::writeDebug | ( | int | singular = 0 |
) |
Write various debug information.
singular | use 1 for singular case, 0 is default |
void Go::IntersectionPool::splitIntersectionLinks | ( | int | fixed_dir, | |
double | fixed_val | |||
) |
Among all IntersectionLinks between IntersectionPoints in this pool, split those who cross a specified parameter direction at a specified parameter value.
Split means to insert a new IntersectionPoint at this place.
fixed_dir | the specified parameter direction | |
fixed_val | the specified parameter value |
int Go::IntersectionPool::numParams | ( | ) | const [inline] |
Get the combined number of parameter directions in the two objects.
Definition at line 644 of file IntersectionPool.h.
double Go::IntersectionPool::startParam | ( | int | dir | ) | const |
Get the start of the parameter interval for the specified parameter direction.
dir | the specified parameter direction |
double Go::IntersectionPool::endParam | ( | int | dir | ) | const |
Get the end of the parameter interval for the specified parameter direction.
dir | the specified parameter direction |
void Go::IntersectionPool::insertInInfluenceInterval | ( | boost::shared_ptr< IntersectionPoint > | pt_in_pool, | |
double * | parvals, | |||
int | pardir | |||
) |
Create a new IntersectionPoint and add it to the the IntersectionPool.
The new IntersectionPoint (A) will lie inside the influence interval of another of the pool's points; the one (B) indicated by pt_in_pool (supposedly in the pool already). The parameter direction in which (A) lies inside the influence interval of (B) is indicated by pardir. The parameter values of the new point is pointed to by parvals (an array which also contains the parameter value in pardir. There will be inserted an IntersectionLink between (A) and (B), which will be isoparametric in the other parameter direction if pardir is on a two-parametric object (surface or function).
pt_in_pool | the IntersectionPoint (supposedly already in the pool) whose influence area the new IntersectionPoint is going to lie. | |
parvals | pointer to an array specifying the parameter values for the new IntersectionPoint to create. | |
pardir | the parameter direction that will be iso-parametric in the newly established IntersectionLink (see above). |
void Go::IntersectionPool::synchronizePool | ( | ) |
Synchronize pool with its parent.
We check that the pool is "valid" by making sure that the intersection points on the current level is also present at previous levels. If there are intersection points that are redundant in this sense, we remove them. This function us useful when several sibling subintersectors are around, and running compute on one of them has removed intersection points that are also present in someof the others.
void Go::IntersectionPool::cleanUpPool | ( | int | first_idx = 0 , |
|
double | epsge = 1.0e-15 | |||
) |
Remove redundant IntersectionPoints from the pool, starting from the point indexed first_idx and upwards.
An IntersectionPoint is considered redundant if:
first_idx | index of the first point |
void Go::IntersectionPool::removeIntPoint | ( | boost::shared_ptr< IntersectionPoint > | int_point | ) |
int_point | the IntersectionPoint to remove from the pool and its ancestors (as long as the ancestors have the same number of parameter directions). |
IntersectionLinks will be broken up and the removed IntersectionPoint's neighbours will be reconnected.
int_point | shared pointer to the IntersectionPoint to remove. |
void Go::IntersectionPool::removeIntPoint2 | ( | boost::shared_ptr< IntersectionPoint > | int_point | ) |
Remove an IntersectionPoint from the pool.
int_point | the IntersectionPoint to remove from the pool and its ancestors (as long as the ancestors have the same number of parameter directions). IntersectionLinks will be broken up. | |
int_point | shared pointer to the IntersectionPoint to remove. |
void Go::IntersectionPool::removeIntPoints | ( | double * | frompar, | |
double * | topar, | |||
bool | only_inner = false | |||
) |
Remove all intersection points from the pool whose parameters lie in the box defined by frompar and topar.
IntersectionLinks will be broken up.
frompar | the array of parameters defining the lower corner of the box in question. | |
topar | the array of parameters defining the upper corner of the box in question. |
void Go::IntersectionPool::intersectAlongCommonBoundary | ( | double | frac, | |
std::vector< BoundaryIntersectionData > & | isects | |||
) |
Check if two surfaces intersect along a common boundary (i.e.
a linked intersection list exist along one boundary in both objects).
Intersections whose parametric extent is smaller than a specified fraction (frac) of the surface's parameter intervals are ignored. The data on the found boundary intersections are returned as entries into a vector of BoundaryIntersectionData.
frac | the fraction of a parameter's total span that must be covered in order to consider this intersection "long enough" to be considered. (A value between 0 and 1, typically small). |
isects | vector with objects containing information on the found boundary intersections. |
bool Go::IntersectionPool::verifyIntersectionLink | ( | const boost::shared_ptr< IntersectionLink > & | link, | |
int | recursion_limit = 10 | |||
) | const |
Verify that the given intersection link is in the pool and represents a connected piece of the intersection curve.
link | shared pointer to the intersection link we wish to verify |
'true' | if the link represents a connected piece of the intersection curve, 'false' otherwise |
bool Go::IntersectionPool::validate | ( | ) | const |
Checks if the pool is "valid", that is, if the intersection points on the present subdivision level exist also on previous levels.
void Go::IntersectionPool::writeIntersectionPoints | ( | ) | const |
Writes out a list of the current intersection points in the pool.
Writes to cout.
void Go::IntersectionPool::writeIntersectionLinks | ( | ) | const |
Writes out a list of links beween intersection points in the pool.
Writes to cout.