mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0029712: Extrema algorithm raises exception
1. Extrema algorithm calls Curve-surface intersector. This intersector returns flag about infinite solution (in spite of extrema's returning not-parallel status correctly - axes of considered cylinder and circle are not parallel). In this case, attempt of obtaining number of intersection points leads to exception. So, the fix adds check of infinite solution after the intersection algorithm. 2. The methods IsDone(), IsParallel(), NbExt(), SquareDistance() and Points() (of Extrema_* classes) have been corrected to make them consistent to the documentation. 3. Revision of some Extrema_* classes has been made in order to avoid places with uninitialized variables. 4. Currently Extrema does not store any points in case when the arguments are parallel. It stores the distance only. 5. Some cases on Extrema-algo have been moved from "fclasses"-group to "modalg"-group.
This commit is contained in:
@@ -96,13 +96,35 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
//! Prepares the extrema result(s) for analytical cases (line, circle, ellipsis etc.)
|
||||
Standard_EXPORT void PrepareResults (const Extrema_ExtElC& AlgExt,
|
||||
const Standard_Boolean theIsInverse,
|
||||
const Standard_Real Ut11,
|
||||
const Standard_Real Ut12,
|
||||
const Standard_Real Ut21,
|
||||
const Standard_Real Ut22);
|
||||
|
||||
Standard_EXPORT void Results (const Extrema_ExtElC& AlgExt, const Standard_Real Ut11, const Standard_Real Ut12, const Standard_Real Ut21, const Standard_Real Ut22);
|
||||
|
||||
Standard_EXPORT void Results (const Extrema_ECC& AlgExt, const Standard_Real Ut11, const Standard_Real Ut12, const Standard_Real Ut21, const Standard_Real Ut22);
|
||||
|
||||
//! Prepares the extrema result(s) for general cases (e.g. with B-spline curves).
|
||||
Standard_EXPORT void PrepareResults (const Extrema_ECC& AlgExt,
|
||||
const Standard_Real Ut11,
|
||||
const Standard_Real Ut12,
|
||||
const Standard_Real Ut21,
|
||||
const Standard_Real Ut22);
|
||||
|
||||
//! Prepares the extrema result(s) in case when the given curves are parallel.
|
||||
Standard_EXPORT void PrepareParallelResult(const Standard_Real theUt11,
|
||||
const Standard_Real theUt12,
|
||||
const Standard_Real theUt21,
|
||||
const Standard_Real theUt22,
|
||||
const Standard_Real theSqDist);
|
||||
|
||||
// Clears all found extremas.
|
||||
// This method does not change any flags (e.g. Done or IsParallel)
|
||||
void ClearSolutions()
|
||||
{
|
||||
mySqDist.Clear();
|
||||
mypoints.Clear();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -113,8 +135,6 @@ private:
|
||||
Standard_Boolean myIsPar;
|
||||
Extrema_SequenceOfPOnCurv mypoints;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
Standard_Integer mynbext;
|
||||
Standard_Boolean inverse;
|
||||
Standard_Address myC[2];
|
||||
Standard_Real myInf[2];
|
||||
Standard_Real mySup[2];
|
||||
|
Reference in New Issue
Block a user