mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0032008: Modeling Algorithms - disallow implicit copy of Extrema algorithms
Extrema_GenExtPS now prefers resizing of Array2 tables instead of managing tables by extra handles. Removed unsafe casts to Adaptor3d_SurfacePtr/Adaptor3d_CurvePtr in Extrema classes. Removed unsafe casts to curve adaptors in Extrema_ExtCC, Extrema_ExtCC2d classes. Extrema_GenExtPS, Extrema_GenExtSS, Extrema_ExtCS - copies by value are now disallowed; several unexpected places copying the object have been fixed. IntTools_Context - maps of void* have been replaced by typed maps.
This commit is contained in:
@@ -112,16 +112,56 @@ Extrema_ExtCC::Extrema_ExtCC(const Adaptor3d_Curve& C1,
|
||||
Perform();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Initialize
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Extrema_ExtCC::Initialize (const Adaptor3d_Curve& C1,
|
||||
const Adaptor3d_Curve& C2,
|
||||
const Standard_Real TolC1,
|
||||
const Standard_Real TolC2)
|
||||
{
|
||||
// myECC will be re-initialized by Perform()
|
||||
myDone = Standard_False;
|
||||
SetCurve (1, C1, C1.FirstParameter(), C1.LastParameter());
|
||||
SetCurve (2, C2, C2.FirstParameter(), C2.LastParameter());
|
||||
SetTolerance (1, TolC1);
|
||||
SetTolerance (2, TolC2);
|
||||
mydist11 = mydist12 = mydist21 = mydist22 = RealFirst();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Initialize
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Extrema_ExtCC::Initialize (const Adaptor3d_Curve& C1,
|
||||
const Adaptor3d_Curve& C2,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Real V1,
|
||||
const Standard_Real V2,
|
||||
const Standard_Real TolC1,
|
||||
const Standard_Real TolC2)
|
||||
{
|
||||
// myECC will be re-initialized by Perform()
|
||||
myDone = Standard_False;
|
||||
SetCurve (1, C1, U1, U2);
|
||||
SetCurve (2, C2, V1, V2);
|
||||
SetTolerance (1, TolC1);
|
||||
SetTolerance (2, TolC2);
|
||||
mydist11 = mydist12 = mydist21 = mydist22 = RealFirst();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetCurve
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_ExtCC::SetCurve (const Standard_Integer theRank, const Adaptor3d_Curve& C)
|
||||
{
|
||||
Standard_OutOfRange_Raise_if (theRank < 1 || theRank > 2, "Extrema_ExtCC::SetCurve()")
|
||||
Standard_Integer anInd = theRank - 1;
|
||||
myC[anInd] = (Standard_Address)&C;
|
||||
myC[anInd] = &C;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -171,8 +211,7 @@ void Extrema_ExtCC::SetTolerance (const Standard_Integer theRank, const Standard
|
||||
void Extrema_ExtCC::Perform()
|
||||
{
|
||||
Standard_NullObject_Raise_if (!myC[0] || !myC[1], "Extrema_ExtCC::Perform()")
|
||||
myECC.SetParams(*((Adaptor3d_Curve*)myC[0]),
|
||||
*((Adaptor3d_Curve*)myC[1]), myInf[0], mySup[0], myInf[1], mySup[1]);
|
||||
myECC.SetParams(*myC[0], *myC[1], myInf[0], mySup[0], myInf[1], mySup[1]);
|
||||
myECC.SetTolerance(Min(myTol[0], myTol[1]));
|
||||
myECC.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
myDone = Standard_False;
|
||||
@@ -180,8 +219,8 @@ void Extrema_ExtCC::Perform()
|
||||
mySqDist.Clear();
|
||||
myIsPar = Standard_False;
|
||||
|
||||
GeomAbs_CurveType type1 = (*((Adaptor3d_Curve*)myC[0])).GetType();
|
||||
GeomAbs_CurveType type2 = (*((Adaptor3d_Curve*)myC[1])).GetType();
|
||||
GeomAbs_CurveType type1 = myC[0]->GetType();
|
||||
GeomAbs_CurveType type2 = myC[1]->GetType();
|
||||
Standard_Real U11, U12, U21, U22, Tol = Min(myTol[0], myTol[1]);
|
||||
|
||||
U11 = myInf[0];
|
||||
@@ -189,10 +228,10 @@ void Extrema_ExtCC::Perform()
|
||||
U21 = myInf[1];
|
||||
U22 = mySup[1];
|
||||
|
||||
if (!Precision::IsInfinite(U11)) P1f = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), U11);
|
||||
if (!Precision::IsInfinite(U12)) P1l = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), U12);
|
||||
if (!Precision::IsInfinite(U21)) P2f = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), U21);
|
||||
if (!Precision::IsInfinite(U22)) P2l = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), U22);
|
||||
if (!Precision::IsInfinite(U11)) P1f = Extrema_CurveTool::Value(*myC[0], U11);
|
||||
if (!Precision::IsInfinite(U12)) P1l = Extrema_CurveTool::Value(*myC[0], U12);
|
||||
if (!Precision::IsInfinite(U21)) P2f = Extrema_CurveTool::Value(*myC[1], U21);
|
||||
if (!Precision::IsInfinite(U22)) P2l = Extrema_CurveTool::Value(*myC[1], U22);
|
||||
|
||||
|
||||
if (Precision::IsInfinite(U11) || Precision::IsInfinite(U21)) mydist11 = RealLast();
|
||||
@@ -223,27 +262,27 @@ void Extrema_ExtCC::Perform()
|
||||
}
|
||||
switch (aType2) {
|
||||
case GeomAbs_Line: {
|
||||
Extrema_ExtElC Xtrem((*((Adaptor3d_Curve*)myC[anInd1])).Line(), (*((Adaptor3d_Curve*)myC[anInd2])).Line(), Tol);
|
||||
Extrema_ExtElC Xtrem (myC[anInd1]->Line(), myC[anInd2]->Line(), Tol);
|
||||
PrepareResults(Xtrem, isInverse, U11, U12, U21, U22);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Circle: {
|
||||
Extrema_ExtElC Xtrem((*((Adaptor3d_Curve*)myC[anInd1])).Line(), (*((Adaptor3d_Curve*)myC[anInd2])).Circle(), Tol);
|
||||
Extrema_ExtElC Xtrem (myC[anInd1]->Line(), myC[anInd2]->Circle(), Tol);
|
||||
PrepareResults(Xtrem, isInverse, U11, U12, U21, U22);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Ellipse: {
|
||||
Extrema_ExtElC Xtrem((*((Adaptor3d_Curve*)myC[anInd1])).Line(), (*((Adaptor3d_Curve*)myC[anInd2])).Ellipse());
|
||||
Extrema_ExtElC Xtrem (myC[anInd1]->Line(), myC[anInd2]->Ellipse());
|
||||
PrepareResults(Xtrem, isInverse, U11, U12, U21, U22);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Hyperbola: {
|
||||
Extrema_ExtElC Xtrem((*((Adaptor3d_Curve*)myC[anInd1])).Line(), (*((Adaptor3d_Curve*)myC[anInd2])).Hyperbola());
|
||||
Extrema_ExtElC Xtrem (myC[anInd1]->Line(), myC[anInd2]->Hyperbola());
|
||||
PrepareResults(Xtrem, isInverse, U11, U12, U21, U22);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Parabola: {
|
||||
Extrema_ExtElC Xtrem((*((Adaptor3d_Curve*)myC[anInd1])).Line(), (*((Adaptor3d_Curve*)myC[anInd2])).Parabola());
|
||||
Extrema_ExtElC Xtrem (myC[anInd1]->Line(), myC[anInd2]->Parabola());
|
||||
PrepareResults(Xtrem, isInverse, U11, U12, U21, U22);
|
||||
break;
|
||||
}
|
||||
@@ -252,7 +291,7 @@ void Extrema_ExtCC::Perform()
|
||||
} else if (type1 == GeomAbs_Circle && type2 == GeomAbs_Circle) {
|
||||
//analytical case - two circles
|
||||
Standard_Boolean bIsDone;
|
||||
Extrema_ExtElC CCXtrem ((*((Adaptor3d_Curve*)myC[0])).Circle(), (*((Adaptor3d_Curve*)myC[1])).Circle());
|
||||
Extrema_ExtElC CCXtrem (myC[0]->Circle(), myC[1]->Circle());
|
||||
bIsDone = CCXtrem.IsDone();
|
||||
if(bIsDone) {
|
||||
PrepareResults(CCXtrem, Standard_False, U11, U12, U21, U22);
|
||||
@@ -375,9 +414,8 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
if (!myIsPar)
|
||||
return;
|
||||
|
||||
const GeomAbs_CurveType aType1 = Extrema_CurveTool::GetType(*((Adaptor3d_Curve*) myC[0]));
|
||||
const GeomAbs_CurveType aType2 = Extrema_CurveTool::GetType(*((Adaptor3d_Curve*) myC[1]));
|
||||
|
||||
const GeomAbs_CurveType aType1 = Extrema_CurveTool::GetType (*myC[0]);
|
||||
const GeomAbs_CurveType aType2 = Extrema_CurveTool::GetType (*myC[1]);
|
||||
if (((aType1 != GeomAbs_Line) && (aType1 != GeomAbs_Circle)) ||
|
||||
((aType2 != GeomAbs_Line) && (aType2 != GeomAbs_Circle)))
|
||||
{
|
||||
@@ -394,11 +432,10 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
//The projection of the circle's location to the trimmed line must exist.
|
||||
const Standard_Boolean isReversed = (aType1 != GeomAbs_Circle);
|
||||
const gp_Pnt aPonC = !isReversed ?
|
||||
Extrema_CurveTool::Value(*((Adaptor3d_Curve*) myC[0]), theUt11) :
|
||||
Extrema_CurveTool::Value(*((Adaptor3d_Curve*) myC[1]), theUt21);
|
||||
Extrema_CurveTool::Value (*myC[0], theUt11) :
|
||||
Extrema_CurveTool::Value (*myC[1], theUt21);
|
||||
|
||||
const gp_Lin aL = !isReversed ? ((Adaptor3d_Curve*) myC[1])->Line() :
|
||||
((Adaptor3d_Curve*) myC[0])->Line();
|
||||
const gp_Lin aL = myC[!isReversed ? 1 : 0]->Line();
|
||||
const Extrema_ExtPElC ExtPLin(aPonC, aL, Precision::Confusion(),
|
||||
!isReversed ? theUt21 : theUt11,
|
||||
!isReversed ? theUt22 : theUt12);
|
||||
@@ -438,8 +475,8 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
|
||||
myIsPar = Standard_False;
|
||||
|
||||
const gp_Lin aLin1 = ((Adaptor3d_Curve*) myC[0])->Line();
|
||||
const gp_Lin aLin2 = ((Adaptor3d_Curve*) myC[1])->Line();
|
||||
const gp_Lin aLin1 = myC[0]->Line();
|
||||
const gp_Lin aLin2 = myC[1]->Line();
|
||||
const Standard_Boolean isOpposite(aLin1.Direction().Dot(aLin2.Direction()) < 0.0);
|
||||
|
||||
Bnd_Range aRange2(theUt21, theUt22);
|
||||
@@ -516,12 +553,12 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
// the range [V1-PI, V2-PI]. All ranges must be adjusted to correspond
|
||||
// periodic range before checking of intersection.
|
||||
|
||||
const gp_Circ aWorkCirc = ((Adaptor3d_Curve*) myC[1])->Circle();
|
||||
const gp_Circ aWorkCirc = myC[1]->Circle();
|
||||
const Standard_Real aPeriod = M_PI + M_PI;
|
||||
gp_Vec aVTg1;
|
||||
gp_Pnt aP11;
|
||||
const gp_Pnt aP12 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*) myC[0]), theUt12);
|
||||
Extrema_CurveTool::D1(*((Adaptor3d_Curve*) myC[0]), theUt11, aP11, aVTg1);
|
||||
const gp_Pnt aP12 = Extrema_CurveTool::Value (*myC[0], theUt12);
|
||||
Extrema_CurveTool::D1 (*myC[0], theUt11, aP11, aVTg1);
|
||||
|
||||
const Bnd_Range aRange(theUt21, theUt22);
|
||||
Bnd_Range aProjRng1;
|
||||
@@ -531,7 +568,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
|
||||
Standard_Real aPar1 = ElCLib::InPeriod(ElCLib::Parameter(aWorkCirc, aP11),
|
||||
theUt21, theUt21 + aPeriod);
|
||||
const gp_Vec aVTg2 = Extrema_CurveTool::DN(*((Adaptor3d_Curve*) myC[1]), aPar1, 1);
|
||||
const gp_Vec aVTg2 = Extrema_CurveTool::DN (*myC[1], aPar1, 1);
|
||||
|
||||
// Check if circles have same/opposite directions
|
||||
const Standard_Boolean isOpposite(aVTg1.Dot(aVTg2) < 0.0);
|
||||
@@ -593,7 +630,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
aRng.GetIntermediatePoint(0.5, aPar);
|
||||
const gp_Pnt aPCirc2 = ElCLib::Value(aPar, aWorkCirc);
|
||||
Extrema_ExtPElC ExtPCir(aPCirc2,
|
||||
Extrema_CurveTool::Circle(*((Adaptor3d_Curve*) myC[0])),
|
||||
Extrema_CurveTool::Circle (*myC[0]),
|
||||
Precision::Confusion(), theUt11, theUt12);
|
||||
|
||||
Standard_Real aMinSqD = ExtPCir.SquareDistance(1);
|
||||
@@ -645,7 +682,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
const Extrema_POnCurv aP2(aPar, aPCirc2);
|
||||
|
||||
Extrema_ExtPElC ExtPCir(aPCirc2,
|
||||
Extrema_CurveTool::Circle(*((Adaptor3d_Curve*) myC[0])),
|
||||
Extrema_CurveTool::Circle (*myC[0]),
|
||||
Precision::Confusion(), theUt11, theUt12);
|
||||
|
||||
Standard_Boolean isFound = !myIsPar;
|
||||
@@ -723,11 +760,13 @@ void Extrema_ExtCC::PrepareResults(const Extrema_ExtElC& AlgExt,
|
||||
U = P2.Parameter();
|
||||
}
|
||||
|
||||
if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[0]))) {
|
||||
U = ElCLib::InPeriod(U, Ut11, Ut11+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[0])));
|
||||
if (Extrema_CurveTool::IsPeriodic (*myC[0]))
|
||||
{
|
||||
U = ElCLib::InPeriod(U, Ut11, Ut11+Extrema_CurveTool::Period (*myC[0]));
|
||||
}
|
||||
if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[1]))) {
|
||||
U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[1])));
|
||||
if (Extrema_CurveTool::IsPeriodic (*myC[1]))
|
||||
{
|
||||
U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Extrema_CurveTool::Period (*myC[1]));
|
||||
}
|
||||
|
||||
if ((U >= Ut11 - RealEpsilon()) &&
|
||||
@@ -790,13 +829,13 @@ void Extrema_ExtCC::PrepareResults(const Extrema_ECC& AlgExt,
|
||||
U2 = P2.Parameter();
|
||||
|
||||
// Check points to be into param space.
|
||||
if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*) myC[0])))
|
||||
if (Extrema_CurveTool::IsPeriodic (*myC[0]))
|
||||
{
|
||||
U = ElCLib::InPeriod(U, Ut11, Ut11 + Extrema_CurveTool::Period(*((Adaptor3d_Curve*) myC[0])));
|
||||
U = ElCLib::InPeriod(U, Ut11, Ut11 + Extrema_CurveTool::Period (*myC[0]));
|
||||
}
|
||||
if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*) myC[1])))
|
||||
if (Extrema_CurveTool::IsPeriodic (*myC[1]))
|
||||
{
|
||||
U2 = ElCLib::InPeriod(U2, Ut21, Ut21 + Extrema_CurveTool::Period(*((Adaptor3d_Curve*) myC[1])));
|
||||
U2 = ElCLib::InPeriod(U2, Ut21, Ut21 + Extrema_CurveTool::Period (*myC[1]));
|
||||
}
|
||||
|
||||
if ((U >= Ut11 - RealEpsilon()) &&
|
||||
|
@@ -53,6 +53,22 @@ public:
|
||||
|
||||
//! It calculates all the distances.
|
||||
Standard_EXPORT Extrema_ExtCC(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2, const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2, const Standard_Real TolC1 = 1.0e-10, const Standard_Real TolC2 = 1.0e-10);
|
||||
|
||||
//! Initializes but does not perform algorithm.
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C1,
|
||||
const Adaptor3d_Curve& C2,
|
||||
const Standard_Real TolC1 = 1.0e-10,
|
||||
const Standard_Real TolC2 = 1.0e-10);
|
||||
|
||||
//! Initializes but does not perform algorithm.
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C1,
|
||||
const Adaptor3d_Curve& C2,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Real V1,
|
||||
const Standard_Real V2,
|
||||
const Standard_Real TolC1 = 1.0e-10,
|
||||
const Standard_Real TolC2 = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void SetCurve (const Standard_Integer theRank, const Adaptor3d_Curve& C);
|
||||
|
||||
@@ -126,6 +142,11 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
// disallow copies
|
||||
Extrema_ExtCC (Extrema_ExtCC& );
|
||||
Extrema_ExtCC& operator= (Extrema_ExtCC& );
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean myIsFindSingleSolution; // Default value is false.
|
||||
Extrema_ECC myECC;
|
||||
@@ -133,7 +154,7 @@ private:
|
||||
Standard_Boolean myIsPar;
|
||||
Extrema_SequenceOfPOnCurv mypoints;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
Standard_Address myC[2];
|
||||
const Adaptor3d_Curve* myC[2];
|
||||
Standard_Real myInf[2];
|
||||
Standard_Real mySup[2];
|
||||
Standard_Real myTol[2];
|
||||
@@ -146,13 +167,6 @@ private:
|
||||
Standard_Real mydist21;
|
||||
Standard_Real mydist22;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtCC_HeaderFile
|
||||
|
@@ -87,7 +87,7 @@ void Extrema_ExtCC2d::Initialize(const Adaptor2d_Curve2d& C2,
|
||||
const Standard_Real TolC1,
|
||||
const Standard_Real TolC2)
|
||||
{
|
||||
myC = (Standard_Address)&C2;
|
||||
myC = &C2;
|
||||
myv1 = V1;
|
||||
myv2 = V2;
|
||||
mytolc1 = TolC1;
|
||||
@@ -102,7 +102,7 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1,
|
||||
{
|
||||
mypoints.Clear();
|
||||
mySqDist.Clear();
|
||||
GeomAbs_CurveType type1 = Extrema_Curve2dTool::GetType(C1), type2 = Extrema_Curve2dTool::GetType(*((Adaptor2d_Curve2d*)myC));
|
||||
GeomAbs_CurveType type1 = Extrema_Curve2dTool::GetType(C1), type2 = Extrema_Curve2dTool::GetType (*myC);
|
||||
Standard_Real U11, U12, U21, U22, Tol = Min(mytolc1, mytolc2);
|
||||
// Extrema_POnCurv2d P1, P2;
|
||||
mynbext = 0;
|
||||
@@ -115,8 +115,8 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1,
|
||||
U22 = myv2;
|
||||
P1f = Extrema_Curve2dTool::Value(C1, U11);
|
||||
P1l = Extrema_Curve2dTool::Value(C1, U12);
|
||||
P2f = Extrema_Curve2dTool::Value(*((Adaptor2d_Curve2d*)myC), U21);
|
||||
P2l = Extrema_Curve2dTool::Value(*((Adaptor2d_Curve2d*)myC), U22);
|
||||
P2f = Extrema_Curve2dTool::Value(*myC, U21);
|
||||
P2l = Extrema_Curve2dTool::Value(*myC, U22);
|
||||
|
||||
|
||||
switch(type1) {
|
||||
@@ -128,36 +128,36 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1,
|
||||
switch(type2) {
|
||||
case GeomAbs_Line: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Circle(C1), Tol);
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*myC), Extrema_Curve2dTool::Circle(C1), Tol);
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Circle: {
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Circle(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Circle(*myC));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Ellipse: {
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Ellipse(*myC));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI );
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola: {
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Parabola(*myC));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Hyperbola: {
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Hyperbola(*myC));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0. );
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC);
|
||||
Results(aParamSolver, U11, U12, U21, U22, 2*M_PI,Period2);
|
||||
}
|
||||
break;
|
||||
@@ -173,46 +173,46 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1,
|
||||
switch(type2) {
|
||||
case GeomAbs_Line: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Ellipse(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*myC), Extrema_Curve2dTool::Ellipse(C1));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Circle: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Ellipse(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*myC), Extrema_Curve2dTool::Ellipse(C1));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Ellipse:
|
||||
{
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Results(aParamSolver, U11, U12, U21, U22,2*M_PI, 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola: {
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), Extrema_Curve2dTool::Parabola(*myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Results(aParamSolver, U11, U12, U21, U22, 2*M_PI, 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Hyperbola: {
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), Extrema_Curve2dTool::Hyperbola(*myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Results(aParamSolver, U11, U12, U21, U22, 2*M_PI, 0.);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC);
|
||||
Results(aParamSolver, U11, U12, U21, U22, 2*M_PI,Period2);
|
||||
}
|
||||
break;
|
||||
@@ -228,28 +228,28 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1,
|
||||
switch(type2) {
|
||||
case GeomAbs_Line: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Parabola(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*myC), Extrema_Curve2dTool::Parabola(C1));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Circle: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Parabola(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*myC), Extrema_Curve2dTool::Parabola(C1));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Ellipse: {
|
||||
//inverse = Standard_True;
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Parabola(C1));
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(*myC), Extrema_Curve2dTool::Parabola(C1));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Results(aParamSolver, U11, U12, U21, U22, 0., 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola: {
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Parabola(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Parabola(C1), Extrema_Curve2dTool::Parabola(*myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Results(aParamSolver, U11, U12, U21, U22, 0., 0.);
|
||||
@@ -257,19 +257,19 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1,
|
||||
break;
|
||||
case GeomAbs_Hyperbola: {
|
||||
//inverse = Standard_True;
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Parabola(C1));
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(*myC), Extrema_Curve2dTool::Parabola(C1));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Results(aParamSolver, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC);
|
||||
Results(aParamSolver, U11, U12, U21, U22, 0., Period2);
|
||||
}
|
||||
break;
|
||||
@@ -285,47 +285,47 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1,
|
||||
switch(type2) {
|
||||
case GeomAbs_Line: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Hyperbola(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*myC), Extrema_Curve2dTool::Hyperbola(C1));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Circle: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Hyperbola(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*myC), Extrema_Curve2dTool::Hyperbola(C1));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Ellipse: {
|
||||
//inverse = Standard_True;
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Hyperbola(C1));
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(*myC), Extrema_Curve2dTool::Hyperbola(C1));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Results(aParamSolver, U11, U12, U21, U22, 0., 2*M_PI );
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola: {
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(C1), Extrema_Curve2dTool::Parabola(*myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Results(aParamSolver, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Hyperbola: {
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(C1), Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(C1), Extrema_Curve2dTool::Hyperbola(*myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Results(aParamSolver, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC);
|
||||
Results(aParamSolver, U11, U12, U21, U22, 0., Period2);
|
||||
}
|
||||
break;
|
||||
@@ -340,36 +340,36 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1,
|
||||
|
||||
switch(type2) {
|
||||
case GeomAbs_Line: {
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Line(*((Adaptor2d_Curve2d*)myC)), Tol);
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Line(*myC), Tol);
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Circle: {
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Circle(*((Adaptor2d_Curve2d*)myC)), Tol);
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Circle(*myC), Tol);
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Ellipse: {
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Ellipse(*myC));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola: {
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Parabola(*myC));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Hyperbola: {
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Hyperbola(*myC));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC);
|
||||
Results(aParamSolver, U11, U12, U21, U22, 0., Period2);
|
||||
}
|
||||
break;
|
||||
@@ -381,13 +381,13 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1,
|
||||
// La premiere courbe est une BezierCurve ou une BSplineCurve:
|
||||
//
|
||||
default: {
|
||||
Extrema_ECC2d aParamSolver(C1, *((Adaptor2d_Curve2d*)myC));
|
||||
Extrema_ECC2d aParamSolver(C1, *myC);
|
||||
aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag());
|
||||
aParamSolver.Perform();
|
||||
Standard_Real Period1 = 0.;
|
||||
if (Extrema_Curve2dTool::IsPeriodic(C1)) Period1 = Extrema_Curve2dTool::Period(C1);
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC);
|
||||
Results(aParamSolver, U11, U12, U21, U22, Period1, Period2);
|
||||
}
|
||||
break;
|
||||
|
@@ -107,7 +107,7 @@ private:
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
Standard_Integer mynbext;
|
||||
Standard_Boolean inverse;
|
||||
Standard_Address myC;
|
||||
const Adaptor2d_Curve2d* myC;
|
||||
Standard_Real myv1;
|
||||
Standard_Real myv2;
|
||||
Standard_Real mytolc1;
|
||||
|
@@ -63,9 +63,7 @@ Extrema_ExtCS::Extrema_ExtCS(const Adaptor3d_Curve& C,
|
||||
const Standard_Real TolS)
|
||||
|
||||
{
|
||||
Initialize(S, S.FirstUParameter(), S.LastUParameter(),
|
||||
S.FirstVParameter(), S.LastVParameter(),
|
||||
TolC, TolS);
|
||||
Initialize (S, TolC, TolS);
|
||||
Perform(C, C.FirstParameter(), C.LastParameter());
|
||||
}
|
||||
|
||||
@@ -85,6 +83,12 @@ Extrema_ExtCS::Extrema_ExtCS(const Adaptor3d_Curve& C,
|
||||
Perform(C, UCinf, UCsup);
|
||||
}
|
||||
|
||||
void Extrema_ExtCS::Initialize (const Adaptor3d_Surface& S, const Standard_Real TolC, const Standard_Real TolS)
|
||||
{
|
||||
Initialize (S, S.FirstUParameter(), S.LastUParameter(),
|
||||
S.FirstVParameter(), S.LastVParameter(),
|
||||
TolC, TolS);
|
||||
}
|
||||
|
||||
void Extrema_ExtCS::Initialize(const Adaptor3d_Surface& S,
|
||||
const Standard_Real Uinf,
|
||||
@@ -94,7 +98,7 @@ void Extrema_ExtCS::Initialize(const Adaptor3d_Surface& S,
|
||||
const Standard_Real TolC,
|
||||
const Standard_Real TolS)
|
||||
{
|
||||
myS = (Adaptor3d_SurfacePtr)&S;
|
||||
myS = &S;
|
||||
myIsPar = Standard_False;
|
||||
myuinf = Uinf;
|
||||
myusup = Usup;
|
||||
|
@@ -21,18 +21,12 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Extrema_ExtElCS.hxx>
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
|
||||
class Adaptor3d_Curve;
|
||||
class Adaptor3d_Surface;
|
||||
class Extrema_POnCurv;
|
||||
@@ -59,7 +53,10 @@ public:
|
||||
//! UCinf and UCmax are the start and end parameters
|
||||
//! of the curve.
|
||||
Standard_EXPORT Extrema_ExtCS(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Real UCinf, const Standard_Real UCsup, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolC, const Standard_Real TolS);
|
||||
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Real TolC, const Standard_Real TolS);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolC, const Standard_Real TolS);
|
||||
|
||||
@@ -83,24 +80,19 @@ public:
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnSurf& P2) const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean AddSolution (const Adaptor3d_Curve& Curve, const Standard_Real T, const Standard_Real U, const Standard_Real V, const gp_Pnt& PointOnCurve, const gp_Pnt& PointOnSurf, const Standard_Real SquareDist);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean AddSolution (const Adaptor3d_Curve& Curve, const Standard_Real T, const Standard_Real U, const Standard_Real V, const gp_Pnt& PointOnCurve, const gp_Pnt& PointOnSurf, const Standard_Real SquareDist);
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
// disallow copies
|
||||
Extrema_ExtCS (Extrema_ExtCS& );
|
||||
Extrema_ExtCS& operator= (Extrema_ExtCS& );
|
||||
|
||||
private:
|
||||
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
const Adaptor3d_Surface* myS;
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myIsPar;
|
||||
Extrema_ExtElCS myExtElCS;
|
||||
@@ -117,13 +109,6 @@ private:
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
GeomAbs_SurfaceType myStype;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtCS_HeaderFile
|
||||
|
@@ -187,7 +187,7 @@ static Standard_Boolean IsOriginalPnt (const gp_Pnt& P,
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Boolean IsExtremum (const Standard_Real U, const Standard_Real V,
|
||||
const gp_Pnt& P, const Adaptor3d_SurfacePtr& S,
|
||||
const gp_Pnt& P, const Adaptor3d_Surface* S,
|
||||
gp_Pnt& E, Standard_Real& Dist2,
|
||||
const Standard_Boolean IsVSup,
|
||||
const Standard_Boolean IsMin)
|
||||
|
@@ -230,7 +230,7 @@ void Extrema_ExtPS::Initialize (const Adaptor3d_Surface& theS,
|
||||
const Standard_Real theTolU,
|
||||
const Standard_Real theTolV)
|
||||
{
|
||||
myS = (Adaptor3d_SurfacePtr)&theS;
|
||||
myS = &theS;
|
||||
myuinf = theUinf;
|
||||
myusup = theUsup;
|
||||
myvinf = theVinf;
|
||||
|
@@ -21,8 +21,6 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Extrema_ExtPElS.hxx>
|
||||
#include <Extrema_GenExtPS.hxx>
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
@@ -110,24 +108,13 @@ public:
|
||||
|
||||
Standard_EXPORT void SetAlgo (const Extrema_ExtAlgo A);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
|
||||
Standard_EXPORT void TreatSolution (const Extrema_POnSurf& PS, const Standard_Real Val);
|
||||
|
||||
private:
|
||||
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
const Adaptor3d_Surface* myS;
|
||||
Standard_Boolean myDone;
|
||||
Extrema_ExtPElS myExtPElS;
|
||||
Extrema_GenExtPS myExtPS;
|
||||
@@ -151,13 +138,6 @@ private:
|
||||
Handle(Extrema_ExtPExtS) myExtPExtS;
|
||||
Handle(Extrema_ExtPRevS) myExtPRevS;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtPS_HeaderFile
|
||||
|
@@ -88,7 +88,7 @@ void Extrema_ExtSS::Initialize(const Adaptor3d_Surface& S2,
|
||||
const Standard_Real Vsup2,
|
||||
const Standard_Real TolS2)
|
||||
{
|
||||
myS2 = (Adaptor3d_SurfacePtr)&S2;
|
||||
myS2 = &S2;
|
||||
myIsPar = Standard_False;
|
||||
myuinf2 = Uinf2;
|
||||
myusup2 = Usup2;
|
||||
|
@@ -21,8 +21,6 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Extrema_ExtElSS.hxx>
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
@@ -77,22 +75,9 @@ public:
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnSurf& P1, Extrema_POnSurf& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
|
||||
|
||||
Adaptor3d_SurfacePtr myS2;
|
||||
const Adaptor3d_Surface* myS2;
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myIsPar;
|
||||
Extrema_ExtElSS myExtElSS;
|
||||
@@ -111,13 +96,6 @@ private:
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
GeomAbs_SurfaceType myStype;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtSS_HeaderFile
|
||||
|
@@ -80,8 +80,8 @@ les algorithmes math_FunctionRoot et math_FunctionRoots.
|
||||
void Extrema_FuncExtCS::Initialize(const Adaptor3d_Curve& C,
|
||||
const Adaptor3d_Surface& S)
|
||||
{
|
||||
myC = (Adaptor3d_CurvePtr)&C;
|
||||
myS = (Adaptor3d_SurfacePtr)&S;
|
||||
myC = &C;
|
||||
myS = &S;
|
||||
myCinit = Standard_True;
|
||||
mySinit = Standard_True;
|
||||
myPoint1.Clear();
|
||||
@@ -267,24 +267,3 @@ const Extrema_POnSurf& Extrema_FuncExtCS::PointOnSurface(const Standard_Integer
|
||||
if (!myCinit || !mySinit) throw Standard_TypeMismatch();
|
||||
return myPoint2.Value(N);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Bidon1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfacePtr Extrema_FuncExtCS::Bidon1() const
|
||||
{
|
||||
return (Adaptor3d_SurfacePtr)0L;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Bidon2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_CurvePtr Extrema_FuncExtCS::Bidon2() const
|
||||
{
|
||||
return (Adaptor3d_CurvePtr)0L;
|
||||
}
|
||||
|
||||
|
@@ -21,8 +21,6 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_CurvePtr.hxx>
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
@@ -84,25 +82,10 @@ public:
|
||||
//! Return the Nth extremum on S.
|
||||
Standard_EXPORT const Extrema_POnSurf& PointOnSurface (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon1() const;
|
||||
|
||||
Standard_EXPORT Adaptor3d_CurvePtr Bidon2() const;
|
||||
|
||||
|
||||
Adaptor3d_CurvePtr myC;
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
const Adaptor3d_Curve* myC;
|
||||
const Adaptor3d_Surface* myS;
|
||||
gp_Pnt myP1;
|
||||
gp_Pnt myP2;
|
||||
Standard_Real myt;
|
||||
@@ -114,13 +97,6 @@ private:
|
||||
Standard_Boolean myCinit;
|
||||
Standard_Boolean mySinit;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_FuncExtCS_HeaderFile
|
||||
|
@@ -79,8 +79,8 @@ Extrema_FuncExtSS::Extrema_FuncExtSS (const Adaptor3d_Surface& S1,
|
||||
myU2(0.0),
|
||||
myV2(0.0)
|
||||
{
|
||||
myS1 = (Adaptor3d_SurfacePtr)&S1;
|
||||
myS2 = (Adaptor3d_SurfacePtr)&S2;
|
||||
myS1 = &S1;
|
||||
myS2 = &S2;
|
||||
myS1init = Standard_True;
|
||||
myS2init = Standard_True;
|
||||
}
|
||||
@@ -93,8 +93,8 @@ Extrema_FuncExtSS::Extrema_FuncExtSS (const Adaptor3d_Surface& S1,
|
||||
void Extrema_FuncExtSS::Initialize(const Adaptor3d_Surface& S1,
|
||||
const Adaptor3d_Surface& S2)
|
||||
{
|
||||
myS1 = (Adaptor3d_SurfacePtr)&S1;
|
||||
myS2 = (Adaptor3d_SurfacePtr)&S2;
|
||||
myS1 = &S1;
|
||||
myS2 = &S2;
|
||||
myS1init = Standard_True;
|
||||
myS2init = Standard_True;
|
||||
myPoint1.Clear();
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
@@ -80,23 +79,10 @@ public:
|
||||
//! Renvoie le Nieme extremum sur S2.
|
||||
Standard_EXPORT const Extrema_POnSurf& PointOnS2 (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
|
||||
|
||||
Adaptor3d_SurfacePtr myS1;
|
||||
Adaptor3d_SurfacePtr myS2;
|
||||
const Adaptor3d_Surface* myS1;
|
||||
const Adaptor3d_Surface* myS2;
|
||||
gp_Pnt myP1;
|
||||
gp_Pnt myP2;
|
||||
Standard_Real myU1;
|
||||
@@ -109,13 +95,6 @@ private:
|
||||
Standard_Boolean myS1init;
|
||||
Standard_Boolean myS2init;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_FuncExtSS_HeaderFile
|
||||
|
@@ -41,7 +41,7 @@ Extrema_FuncPSNorm::Extrema_FuncPSNorm (const gp_Pnt& P,
|
||||
myV(0.0)
|
||||
{
|
||||
myP = P;
|
||||
myS = (Adaptor3d_SurfacePtr)&S;
|
||||
myS = &S;
|
||||
myPinit = Standard_True;
|
||||
mySinit = Standard_True;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ Extrema_FuncPSNorm::Extrema_FuncPSNorm (const gp_Pnt& P,
|
||||
//=============================================================================
|
||||
void Extrema_FuncPSNorm::Initialize(const Adaptor3d_Surface& S)
|
||||
{
|
||||
myS = (Adaptor3d_SurfacePtr)&S;
|
||||
myS = &S;
|
||||
mySinit = Standard_True;
|
||||
myPoint.Clear();
|
||||
mySqDist.Clear();
|
||||
|
@@ -21,16 +21,13 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <math_FunctionSetWithDerivatives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class gp_Pnt;
|
||||
|
||||
class Adaptor3d_Surface;
|
||||
class math_Matrix;
|
||||
class Extrema_POnSurf;
|
||||
@@ -102,7 +99,7 @@ public:
|
||||
private:
|
||||
|
||||
gp_Pnt myP;
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
const Adaptor3d_Surface* myS;
|
||||
Standard_Real myU;
|
||||
Standard_Real myV;
|
||||
gp_Pnt myPs;
|
||||
|
@@ -191,7 +191,7 @@ void Extrema_GenExtCS::Initialize (const Adaptor3d_Surface& S,
|
||||
const Standard_Real Vsup,
|
||||
const Standard_Real Tol2)
|
||||
{
|
||||
myS = (Adaptor3d_SurfacePtr)&S;
|
||||
myS = &S;
|
||||
myusample = NbU;
|
||||
myvsample = NbV;
|
||||
myumin = Umin;
|
||||
@@ -791,22 +791,3 @@ const Extrema_POnSurf& Extrema_GenExtCS::PointOnSurface(const Standard_Integer N
|
||||
|
||||
return myF.PointOnSurface(N);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BidonSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Adaptor3d_SurfacePtr Extrema_GenExtCS::BidonSurface() const
|
||||
{
|
||||
return (Adaptor3d_SurfacePtr)0L;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BidonCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Adaptor3d_CurvePtr Extrema_GenExtCS::BidonCurve() const
|
||||
{
|
||||
return (Adaptor3d_CurvePtr)0L;
|
||||
}
|
||||
|
||||
|
@@ -17,21 +17,9 @@
|
||||
#ifndef _Extrema_GenExtCS_HeaderFile
|
||||
#define _Extrema_GenExtCS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_FuncExtCS.hxx>
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <TColgp_HArray2OfPnt.hxx>
|
||||
#include <Adaptor3d_CurvePtr.hxx>
|
||||
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor3d_Curve;
|
||||
class Adaptor3d_Surface;
|
||||
class Extrema_POnCurv;
|
||||
@@ -97,22 +85,8 @@ public:
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& PointOnSurface (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_CurvePtr BidonCurve() const;
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr BidonSurface() const;
|
||||
|
||||
Standard_EXPORT void GlobMinGenCS(const Adaptor3d_Curve& theC,
|
||||
const Standard_Integer theNbParticles,
|
||||
const math_Vector& theTUVinf,
|
||||
@@ -131,6 +105,13 @@ private:
|
||||
const math_Vector& theTUVsup,
|
||||
math_Vector& theTUV);
|
||||
|
||||
private:
|
||||
|
||||
// disallow copies
|
||||
Extrema_GenExtCS (const Extrema_GenExtCS& );
|
||||
Extrema_GenExtCS& operator= (const Extrema_GenExtCS& );
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Real mytmin;
|
||||
@@ -145,16 +126,9 @@ private:
|
||||
Standard_Real mytol1;
|
||||
Standard_Real mytol2;
|
||||
Extrema_FuncExtCS myF;
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
const Adaptor3d_Surface* myS;
|
||||
Handle(TColgp_HArray2OfPnt) mySurfPnts;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_GenExtCS_HeaderFile
|
||||
|
@@ -295,7 +295,7 @@ void Extrema_GenExtPS::Initialize(const Adaptor3d_Surface& S,
|
||||
const Standard_Real TolU,
|
||||
const Standard_Real TolV)
|
||||
{
|
||||
myS = (Adaptor3d_SurfacePtr)&S;
|
||||
myS = &S;
|
||||
myusample = NbU;
|
||||
myvsample = NbV;
|
||||
mytolu = TolU;
|
||||
@@ -550,8 +550,7 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint)
|
||||
}
|
||||
|
||||
//If flag was changed and extrema not reinitialized Extrema would fail
|
||||
myPoints = new Extrema_HArray2OfPOnSurfParams
|
||||
(0, myusample + 1, 0, myvsample + 1);
|
||||
myPoints.Resize (0, myusample + 1, 0, myvsample + 1, false);
|
||||
// Calculation of distances
|
||||
|
||||
for ( NoU = 1 ; NoU <= myusample; NoU++ ) {
|
||||
@@ -562,28 +561,24 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint)
|
||||
|
||||
aParam.SetElementType(Extrema_Node);
|
||||
aParam.SetIndices(NoU, NoV);
|
||||
myPoints->SetValue(NoU, NoV, aParam);
|
||||
myPoints.SetValue(NoU, NoV, aParam);
|
||||
}
|
||||
}
|
||||
|
||||
myFacePntParams =
|
||||
new Extrema_HArray2OfPOnSurfParams(0, myusample, 0, myvsample);
|
||||
|
||||
myUEdgePntParams =
|
||||
new Extrema_HArray2OfPOnSurfParams(1, myusample - 1, 1, myvsample);
|
||||
myVEdgePntParams =
|
||||
new Extrema_HArray2OfPOnSurfParams(1, myusample, 1, myvsample - 1);
|
||||
myFacePntParams .Resize (0, myusample, 0, myvsample, false);
|
||||
myUEdgePntParams.Resize (1, myusample - 1, 1, myvsample, false);
|
||||
myVEdgePntParams.Resize (1, myusample, 1, myvsample - 1, false);
|
||||
|
||||
// Fill boundary with negative square distance.
|
||||
// It is used for computation of Maximum.
|
||||
for (NoV = 0; NoV <= myvsample + 1; NoV++) {
|
||||
myPoints->ChangeValue(0, NoV).SetSqrDistance(-1.);
|
||||
myPoints->ChangeValue(myusample + 1, NoV).SetSqrDistance(-1.);
|
||||
myPoints.ChangeValue(0, NoV).SetSqrDistance(-1.);
|
||||
myPoints.ChangeValue(myusample + 1, NoV).SetSqrDistance(-1.);
|
||||
}
|
||||
|
||||
for (NoU = 1; NoU <= myusample; NoU++) {
|
||||
myPoints->ChangeValue(NoU, 0).SetSqrDistance(-1.);
|
||||
myPoints->ChangeValue(NoU, myvsample + 1).SetSqrDistance(-1.);
|
||||
myPoints.ChangeValue(NoU, 0).SetSqrDistance(-1.);
|
||||
myPoints.ChangeValue(NoU, myvsample + 1).SetSqrDistance(-1.);
|
||||
}
|
||||
|
||||
myInit = Standard_True;
|
||||
@@ -593,7 +588,7 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint)
|
||||
// Step 1. Compute distances to nodes.
|
||||
for ( NoU = 1 ; NoU <= myusample; NoU++ ) {
|
||||
for ( NoV = 1 ; NoV <= myvsample; NoV++) {
|
||||
Extrema_POnSurfParams &aParam = myPoints->ChangeValue(NoU, NoV);
|
||||
Extrema_POnSurfParams &aParam = myPoints.ChangeValue(NoU, NoV);
|
||||
|
||||
aParam.SetSqrDistance(thePoint.SquareDistance(aParam.Value()));
|
||||
}
|
||||
@@ -613,24 +608,24 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint)
|
||||
{
|
||||
for ( NoV = 1 ; NoV <= myvsample; NoV++)
|
||||
{
|
||||
const Extrema_POnSurfParams &aParam0 = myPoints->Value(NoU, NoV);
|
||||
const Extrema_POnSurfParams &aParam0 = myPoints.Value(NoU, NoV);
|
||||
|
||||
if (NoU < myusample)
|
||||
{
|
||||
// Compute parameters to UEdge.
|
||||
const Extrema_POnSurfParams &aParam1 = myPoints->Value(NoU + 1, NoV);
|
||||
const Extrema_POnSurfParams &aParam1 = myPoints.Value(NoU + 1, NoV);
|
||||
const Extrema_POnSurfParams &anEdgeParam = ComputeEdgeParameters(Standard_True, aParam0, aParam1, thePoint, aDiffTol);
|
||||
|
||||
myUEdgePntParams->SetValue(NoU, NoV, anEdgeParam);
|
||||
myUEdgePntParams.SetValue(NoU, NoV, anEdgeParam);
|
||||
}
|
||||
|
||||
if (NoV < myvsample)
|
||||
{
|
||||
// Compute parameters to VEdge.
|
||||
const Extrema_POnSurfParams &aParam1 = myPoints->Value(NoU, NoV + 1);
|
||||
const Extrema_POnSurfParams &aParam1 = myPoints.Value(NoU, NoV + 1);
|
||||
const Extrema_POnSurfParams &anEdgeParam = ComputeEdgeParameters(Standard_False, aParam0, aParam1, thePoint, aDiffTol);
|
||||
|
||||
myVEdgePntParams->SetValue(NoU, NoV, anEdgeParam);
|
||||
myVEdgePntParams.SetValue(NoU, NoV, anEdgeParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -646,10 +641,10 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint)
|
||||
|
||||
for ( NoU = 1 ; NoU < myusample; NoU++ ) {
|
||||
for ( NoV = 1 ; NoV < myvsample; NoV++) {
|
||||
const Extrema_POnSurfParams &aUE0 = myUEdgePntParams->Value(NoU, NoV);
|
||||
const Extrema_POnSurfParams &aUE1 = myUEdgePntParams->Value(NoU, NoV+1);
|
||||
const Extrema_POnSurfParams &aVE0 = myVEdgePntParams->Value(NoU, NoV);
|
||||
const Extrema_POnSurfParams &aVE1 = myVEdgePntParams->Value(NoU+1, NoV);
|
||||
const Extrema_POnSurfParams &aUE0 = myUEdgePntParams.Value(NoU, NoV);
|
||||
const Extrema_POnSurfParams &aUE1 = myUEdgePntParams.Value(NoU, NoV+1);
|
||||
const Extrema_POnSurfParams &aVE0 = myVEdgePntParams.Value(NoU, NoV);
|
||||
const Extrema_POnSurfParams &aVE1 = myVEdgePntParams.Value(NoU+1, NoV);
|
||||
|
||||
aSqrDist01 = aUE0.Value().SquareDistance(aUE1.Value());
|
||||
aDiffDist = Abs(aUE0.GetSqrDistance() - aUE1.GetSqrDistance());
|
||||
@@ -677,7 +672,7 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint)
|
||||
const Extrema_POnSurfParams &aEMin =
|
||||
aUEMin.GetSqrDistance() < aVEMin.GetSqrDistance() ? aUEMin : aVEMin;
|
||||
|
||||
myFacePntParams->SetValue(NoU, NoV, aEMin);
|
||||
myFacePntParams.SetValue(NoU, NoV, aEMin);
|
||||
} else {
|
||||
// Find closest point inside the face.
|
||||
Standard_Real aU[2];
|
||||
@@ -699,20 +694,20 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint)
|
||||
aParam.SetElementType(Extrema_Face);
|
||||
aParam.SetSqrDistance(thePoint.SquareDistance(aParam.Value()));
|
||||
aParam.SetIndices(NoU, NoV);
|
||||
myFacePntParams->SetValue(NoU, NoV, aParam);
|
||||
myFacePntParams.SetValue(NoU, NoV, aParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fill boundary with RealLast square distance.
|
||||
for (NoV = 0; NoV <= myvsample; NoV++) {
|
||||
myFacePntParams->ChangeValue(0, NoV).SetSqrDistance(RealLast());
|
||||
myFacePntParams->ChangeValue(myusample, NoV).SetSqrDistance(RealLast());
|
||||
myFacePntParams.ChangeValue(0, NoV).SetSqrDistance(RealLast());
|
||||
myFacePntParams.ChangeValue(myusample, NoV).SetSqrDistance(RealLast());
|
||||
}
|
||||
|
||||
for (NoU = 1; NoU < myusample; NoU++) {
|
||||
myFacePntParams->ChangeValue(NoU, 0).SetSqrDistance(RealLast());
|
||||
myFacePntParams->ChangeValue(NoU, myvsample).SetSqrDistance(RealLast());
|
||||
myFacePntParams.ChangeValue(NoU, 0).SetSqrDistance(RealLast());
|
||||
myFacePntParams.ChangeValue(NoU, myvsample).SetSqrDistance(RealLast());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -831,7 +826,7 @@ void Extrema_GenExtPS::Perform(const gp_Pnt& P)
|
||||
for (NoU = 1; NoU < myusample; NoU++) {
|
||||
for (NoV = 1; NoV < myvsample; NoV++) {
|
||||
const Extrema_POnSurfParams &aParam =
|
||||
myFacePntParams->Value(NoU, NoV);
|
||||
myFacePntParams.Value(NoU, NoV);
|
||||
|
||||
isMin = Standard_False;
|
||||
anElemType = aParam.GetElementType();
|
||||
@@ -857,7 +852,7 @@ void Extrema_GenExtPS::Perform(const gp_Pnt& P)
|
||||
(anElemType == Extrema_Node && (iU == 1 || iU == myusample))) {
|
||||
// Check the down face.
|
||||
const Extrema_POnSurfParams &aDownParam =
|
||||
myFacePntParams->Value(NoU, NoV - 1);
|
||||
myFacePntParams.Value(NoU, NoV - 1);
|
||||
|
||||
if (aDownParam.GetElementType() == anElemType) {
|
||||
aDownParam.GetIndices(iU2, iV2);
|
||||
@@ -867,7 +862,7 @@ void Extrema_GenExtPS::Perform(const gp_Pnt& P)
|
||||
(anElemType == Extrema_Node && (iV == 1 || iV == myvsample))) {
|
||||
// Check the right face.
|
||||
const Extrema_POnSurfParams &aRightParam =
|
||||
myFacePntParams->Value(NoU - 1, NoV);
|
||||
myFacePntParams.Value(NoU - 1, NoV);
|
||||
|
||||
if (aRightParam.GetElementType() == anElemType) {
|
||||
aRightParam.GetIndices(iU2, iV2);
|
||||
@@ -879,9 +874,9 @@ void Extrema_GenExtPS::Perform(const gp_Pnt& P)
|
||||
isMin = Standard_True;
|
||||
|
||||
const Extrema_POnSurfParams *anOtherParam[3] =
|
||||
{ &myFacePntParams->Value(NoU, NoV - 1), // Down
|
||||
&myFacePntParams->Value(NoU - 1, NoV - 1), // Lower-left
|
||||
&myFacePntParams->Value(NoU - 1, NoV) }; // Left
|
||||
{ &myFacePntParams.Value(NoU, NoV - 1), // Down
|
||||
&myFacePntParams.Value(NoU - 1, NoV - 1), // Lower-left
|
||||
&myFacePntParams.Value(NoU - 1, NoV) }; // Left
|
||||
|
||||
for (i = 0; i < 3 && isMin; i++) {
|
||||
if (anOtherParam[i]->GetElementType() == Extrema_Node) {
|
||||
@@ -910,15 +905,15 @@ void Extrema_GenExtPS::Perform(const gp_Pnt& P)
|
||||
{
|
||||
for (NoV = 1; NoV <= myvsample; NoV++)
|
||||
{
|
||||
const Extrema_POnSurfParams &aParamMain = myPoints->Value(NoU, NoV);
|
||||
const Extrema_POnSurfParams &aParam1 = myPoints->Value(NoU - 1, NoV - 1);
|
||||
const Extrema_POnSurfParams &aParam2 = myPoints->Value(NoU - 1, NoV);
|
||||
const Extrema_POnSurfParams &aParam3 = myPoints->Value(NoU - 1, NoV + 1);
|
||||
const Extrema_POnSurfParams &aParam4 = myPoints->Value(NoU, NoV - 1);
|
||||
const Extrema_POnSurfParams &aParam5 = myPoints->Value(NoU, NoV + 1);
|
||||
const Extrema_POnSurfParams &aParam6 = myPoints->Value(NoU + 1, NoV - 1);
|
||||
const Extrema_POnSurfParams &aParam7 = myPoints->Value(NoU + 1, NoV);
|
||||
const Extrema_POnSurfParams &aParam8 = myPoints->Value(NoU + 1, NoV + 1);
|
||||
const Extrema_POnSurfParams &aParamMain = myPoints.Value(NoU, NoV);
|
||||
const Extrema_POnSurfParams &aParam1 = myPoints.Value(NoU - 1, NoV - 1);
|
||||
const Extrema_POnSurfParams &aParam2 = myPoints.Value(NoU - 1, NoV);
|
||||
const Extrema_POnSurfParams &aParam3 = myPoints.Value(NoU - 1, NoV + 1);
|
||||
const Extrema_POnSurfParams &aParam4 = myPoints.Value(NoU, NoV - 1);
|
||||
const Extrema_POnSurfParams &aParam5 = myPoints.Value(NoU, NoV + 1);
|
||||
const Extrema_POnSurfParams &aParam6 = myPoints.Value(NoU + 1, NoV - 1);
|
||||
const Extrema_POnSurfParams &aParam7 = myPoints.Value(NoU + 1, NoV);
|
||||
const Extrema_POnSurfParams &aParam8 = myPoints.Value(NoU + 1, NoV + 1);
|
||||
|
||||
Dist = aParamMain.GetSqrDistance();
|
||||
|
||||
@@ -932,7 +927,7 @@ void Extrema_GenExtPS::Perform(const gp_Pnt& P)
|
||||
(aParam8.GetSqrDistance() <= Dist))
|
||||
{
|
||||
// Find maximum.
|
||||
FindSolution(P, myPoints->Value(NoU, NoV));
|
||||
FindSolution(P, myPoints.Value(NoU, NoV));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -17,30 +17,16 @@
|
||||
#ifndef _Extrema_GenExtPS_HeaderFile
|
||||
#define _Extrema_GenExtPS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_HArray2OfPOnSurfParams.hxx>
|
||||
#include <Extrema_HUBTreeOfSphere.hxx>
|
||||
#include <Bnd_HArray1OfSphere.hxx>
|
||||
#include <Extrema_Array2OfPOnSurfParams.hxx>
|
||||
#include <Extrema_POnSurfParams.hxx>
|
||||
#include <Extrema_HUBTreeOfSphere.hxx>
|
||||
#include <Extrema_FuncPSNorm.hxx>
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <Extrema_ExtFlag.hxx>
|
||||
#include <Extrema_ExtAlgo.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <Extrema_POnSurfParams.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class gp_Pnt;
|
||||
class Adaptor3d_Surface;
|
||||
class Extrema_POnSurf;
|
||||
class Extrema_POnSurfParams;
|
||||
|
||||
class Adaptor3d_Surface;
|
||||
|
||||
//! It calculates all the extremum distances
|
||||
//! between a point and a surface.
|
||||
@@ -51,7 +37,6 @@ public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_GenExtPS();
|
||||
|
||||
//! It calculates all the distances.
|
||||
@@ -107,19 +92,7 @@ public:
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
|
||||
Standard_EXPORT void BuildTree();
|
||||
|
||||
@@ -134,6 +107,13 @@ private:
|
||||
//! Compute new edge parameters.
|
||||
Standard_EXPORT const Extrema_POnSurfParams& ComputeEdgeParameters (const Standard_Boolean IsUEdge, const Extrema_POnSurfParams& theParam0, const Extrema_POnSurfParams& theParam1, const gp_Pnt& thePoints, const Standard_Real theDiffTol);
|
||||
|
||||
private:
|
||||
|
||||
// disallow copies
|
||||
Extrema_GenExtPS (const Extrema_GenExtPS& );
|
||||
Extrema_GenExtPS& operator= (const Extrema_GenExtPS& );
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myInit;
|
||||
@@ -145,27 +125,21 @@ private:
|
||||
Standard_Integer myvsample;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolv;
|
||||
Handle(Extrema_HArray2OfPOnSurfParams) myPoints;
|
||||
|
||||
Extrema_Array2OfPOnSurfParams myPoints;
|
||||
Extrema_HUBTreeOfSphere mySphereUBTree;
|
||||
Handle(Bnd_HArray1OfSphere) mySphereArray;
|
||||
Extrema_FuncPSNorm myF;
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
const Adaptor3d_Surface* myS;
|
||||
Extrema_ExtFlag myFlag;
|
||||
Extrema_ExtAlgo myAlgo;
|
||||
Handle(TColStd_HArray1OfReal) myUParams;
|
||||
Handle(TColStd_HArray1OfReal) myVParams;
|
||||
Handle(Extrema_HArray2OfPOnSurfParams) myFacePntParams;
|
||||
Handle(Extrema_HArray2OfPOnSurfParams) myUEdgePntParams;
|
||||
Handle(Extrema_HArray2OfPOnSurfParams) myVEdgePntParams;
|
||||
Extrema_Array2OfPOnSurfParams myFacePntParams;
|
||||
Extrema_Array2OfPOnSurfParams myUEdgePntParams;
|
||||
Extrema_Array2OfPOnSurfParams myVEdgePntParams;
|
||||
Extrema_POnSurfParams myGridParam;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_GenExtPS_HeaderFile
|
||||
|
@@ -190,7 +190,7 @@ void Extrema_GenExtSS::Initialize(const Adaptor3d_Surface& S2,
|
||||
const Standard_Real V2sup,
|
||||
const Standard_Real Tol2)
|
||||
{
|
||||
myS2 = (Adaptor3d_SurfacePtr)&S2;
|
||||
myS2 = &S2;
|
||||
mypoints1 = new TColgp_HArray2OfPnt(0,NbU+1,0,NbV+1);
|
||||
mypoints2 = new TColgp_HArray2OfPnt(0,NbU+1,0,NbV+1);
|
||||
myusample = NbU;
|
||||
@@ -464,14 +464,3 @@ const Extrema_POnSurf& Extrema_GenExtSS::PointOnS2(const Standard_Integer N) con
|
||||
|
||||
return myF.PointOnS2(N);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Bidon
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfacePtr Extrema_GenExtSS::Bidon() const
|
||||
{
|
||||
return (Adaptor3d_SurfacePtr)0L;
|
||||
}
|
||||
|
||||
|
@@ -21,19 +21,12 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColgp_HArray2OfPnt.hxx>
|
||||
#include <Extrema_FuncExtSS.hxx>
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
|
||||
class Adaptor3d_Surface;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
//! It calculates all the extremum distances
|
||||
//! between two surfaces.
|
||||
//! These distances can be minimum or maximum.
|
||||
@@ -93,20 +86,13 @@ public:
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& PointOnS2 (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
// disallow copies
|
||||
Extrema_GenExtSS (const Extrema_GenExtSS& );
|
||||
Extrema_GenExtSS& operator= (const Extrema_GenExtSS& );
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myInit;
|
||||
@@ -125,15 +111,8 @@ private:
|
||||
Standard_Real mytol1;
|
||||
Standard_Real mytol2;
|
||||
Extrema_FuncExtSS myF;
|
||||
Adaptor3d_SurfacePtr myS2;
|
||||
|
||||
const Adaptor3d_Surface* myS2;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_GenExtSS_HeaderFile
|
||||
|
@@ -1,27 +0,0 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef Extrema_HArray2OfPOnSurfParams_HeaderFile
|
||||
#define Extrema_HArray2OfPOnSurfParams_HeaderFile
|
||||
|
||||
#include <Extrema_POnSurfParams.hxx>
|
||||
#include <Extrema_Array2OfPOnSurfParams.hxx>
|
||||
#include <NCollection_DefineHArray2.hxx>
|
||||
|
||||
DEFINE_HARRAY2(Extrema_HArray2OfPOnSurfParams, Extrema_Array2OfPOnSurfParams)
|
||||
|
||||
|
||||
#endif
|
@@ -110,7 +110,6 @@ Extrema_HArray1OfPOnSurf.hxx
|
||||
Extrema_HArray2OfPOnCurv.hxx
|
||||
Extrema_HArray2OfPOnCurv2d.hxx
|
||||
Extrema_HArray2OfPOnSurf.hxx
|
||||
Extrema_HArray2OfPOnSurfParams.hxx
|
||||
Extrema_HUBTreeOfSphere.hxx
|
||||
Extrema_LocateExtCC.cxx
|
||||
Extrema_LocateExtCC.hxx
|
||||
|
Reference in New Issue
Block a user