mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024761: Convertation of the generic classes to the non-generic. Part 5
1) Generic class "GccEnt_QualifiedCurv" from "GccEnt" package converted to the non-generic class and moved to the "Geom2dGcc" package. Name of this class was changed to "Geom2dGcc_QCurve". 2) Generic classes "HatchGen_ElementGen", "HatchGen_ElementsGen", "HatchGen_HatchingGen" and "HatchGen_Hatcher" from "HatchGen" package converted to the non-generic classes and moved to the "Geom2dHatch" package. Names of this classes were changed to "Geom2dHatch_Element", "Geom2dHatch_Elements", "Geom2dHatch_Hatching" and "Geom2dHatch_Hatcher". Also all instantiations of the "internal" classes of this classes were moved to the "Geom2dHatch.cdl". 3) Generic classes "Extrema_GExtCC", "Extrema_GExtCC2d", "Extrema_GLocateExtCC" and "Extrema_GLocateExtCC2d" from "Extrema" package converted to the non-generic classes. Names of this classes were changed to "Extrema_ExtCC", "Extrema_ExtCC2d", "Extrema_LocateExtCC" and "Extrema_LocateExtCC2d". Also all instantiations of the "internal" classes of this classes were moved to the "Extrema.cdl".
This commit is contained in:
@@ -125,11 +125,96 @@ is
|
||||
|
||||
-- Curve-Curve:
|
||||
-- 3d:
|
||||
generic class GExtCC, CCache, ECC;
|
||||
generic class GLocateExtCC, LCCache, ELCC, LocECC;
|
||||
class ExtCC;
|
||||
|
||||
class CCache instantiates CurveCache from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
Pnt from gp,
|
||||
HArray1OfPnt from TColgp);
|
||||
|
||||
class ECC instantiates GenExtCC from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
CCache from Extrema,
|
||||
HArray1OfPnt from TColgp,
|
||||
POnCurv from Extrema,
|
||||
Pnt from gp,
|
||||
Vec from gp);
|
||||
|
||||
class LocateExtCC;
|
||||
|
||||
class LCCache instantiates CurveCache from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
Pnt from gp,
|
||||
HArray1OfPnt from TColgp);
|
||||
|
||||
class ELCC instantiates GenExtCC from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
LCCache from Extrema,
|
||||
HArray1OfPnt from TColgp,
|
||||
POnCurv from Extrema,
|
||||
Pnt from gp,
|
||||
Vec from gp);
|
||||
|
||||
class LocECC instantiates GenLocateExtCC from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
POnCurv from Extrema,
|
||||
Pnt from gp,
|
||||
Vec from gp);
|
||||
|
||||
-- 2d:
|
||||
generic class GExtCC2d, CCache2d, ECC2d;
|
||||
generic class GLocateExtCC2d, LCCache2d, ELCC2d, LocECC2d;
|
||||
class ExtCC2d;
|
||||
|
||||
class CCache2d instantiates CurveCache from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Pnt2d from gp,
|
||||
HArray1OfPnt2d from TColgp);
|
||||
|
||||
class ECC2d instantiates GenExtCC from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
CCache2d from Extrema,
|
||||
HArray1OfPnt2d from TColgp,
|
||||
POnCurv2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Vec2d from gp);
|
||||
|
||||
class LocateExtCC2d;
|
||||
|
||||
class LCCache2d instantiates CurveCache from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Pnt2d from gp,
|
||||
HArray1OfPnt2d from TColgp);
|
||||
|
||||
class ELCC2d instantiates GenExtCC from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
LCCache2d from Extrema,
|
||||
HArray1OfPnt2d from TColgp,
|
||||
POnCurv2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Vec2d from gp);
|
||||
|
||||
class LocECC2d instantiates GenLocateExtCC from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
POnCurv2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Vec2d from gp);
|
||||
|
||||
-- Curve-Surface:
|
||||
class ExtCS;
|
||||
@@ -226,20 +311,6 @@ is
|
||||
Vec from gp,
|
||||
POnCurv from Extrema,
|
||||
SequenceOfPOnCurv from Extrema);
|
||||
|
||||
|
||||
class ExtCC instantiates GExtCC from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
Curve from Adaptor3d,
|
||||
CurveTool from Extrema);
|
||||
|
||||
class LocateExtCC instantiates GLocateExtCC from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
Curve from Adaptor3d,
|
||||
CurveTool from Extrema);
|
||||
|
||||
|
||||
--- 2d instantiations:
|
||||
class ExtPC2d instantiates GExtPC from Extrema
|
||||
@@ -260,21 +331,6 @@ is
|
||||
Vec2d from gp,
|
||||
POnCurv2d from Extrema,
|
||||
SequenceOfPOnCurv2d from Extrema);
|
||||
|
||||
|
||||
class ExtCC2d instantiates GExtCC2d from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema);
|
||||
|
||||
class LocateExtCC2d instantiates GLocateExtCC2d from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema);
|
||||
|
||||
|
||||
|
||||
|
||||
end Extrema;
|
||||
|
@@ -14,13 +14,10 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class GExtCC from Extrema (Curve1 as any;
|
||||
Tool1 as any;
|
||||
Curve2 as any;
|
||||
Tool2 as any)
|
||||
class ExtCC from Extrema
|
||||
|
||||
---Purpose: It calculates all the distance between two curves.
|
||||
-- These distances can be maximum or minimum.
|
||||
---Purpose: It calculates all the distance between two curves.
|
||||
-- These distances can be maximum or minimum.
|
||||
|
||||
uses POnCurv from Extrema,
|
||||
SequenceOfPOnCurv from Extrema,
|
||||
@@ -28,52 +25,42 @@ uses POnCurv from Extrema,
|
||||
Pnt from gp,
|
||||
HArray1OfPnt from TColgp,
|
||||
SequenceOfReal from TColStd,
|
||||
ListOfTransient from TColStd
|
||||
ListOfTransient from TColStd,
|
||||
Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
ECC from Extrema
|
||||
|
||||
|
||||
raises InfiniteSolutions from StdFail,
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
class CCache instantiates CurveCache from Extrema (Curve1, Pnt from gp, HArray1OfPnt from TColgp);
|
||||
|
||||
class ECC instantiates GenExtCC from Extrema
|
||||
(Curve1,
|
||||
Tool1,
|
||||
Curve2,
|
||||
Tool2,
|
||||
CCache,
|
||||
HArray1OfPnt from TColgp,
|
||||
POnCurv,
|
||||
Pnt,
|
||||
Vec);
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create (TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC;
|
||||
Create (TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns ExtCC;
|
||||
|
||||
|
||||
Create (C1: Curve1; C2: Curve2;
|
||||
TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC;
|
||||
Create (C1: Curve from Adaptor3d; C2: Curve from Adaptor3d;
|
||||
TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns ExtCC;
|
||||
---Purpose: It calculates all the distances.
|
||||
|
||||
|
||||
Create (C1: Curve1;
|
||||
C2: Curve2;
|
||||
Create (C1: Curve from Adaptor3d;
|
||||
C2: Curve from Adaptor3d;
|
||||
U1: Real from Standard;
|
||||
U2: Real from Standard;
|
||||
V1: Real from Standard;
|
||||
V2: Real from Standard;
|
||||
TolC1: Real = 1.0e-10;
|
||||
TolC2: Real = 1.0e-10) returns GExtCC;
|
||||
TolC2: Real = 1.0e-10) returns ExtCC;
|
||||
---Purpose: It calculates all the distances.
|
||||
|
||||
|
||||
SetCurve (me: in out; theRank: Integer; C: Curve1);
|
||||
SetCurve (me: in out; theRank: Integer; C: Curve from Adaptor3d);
|
||||
---Purpose:
|
||||
|
||||
SetCurve (me: in out; theRank: Integer; C: Curve1; Uinf, Usup: Real);
|
||||
SetCurve (me: in out; theRank: Integer; C: Curve from Adaptor3d; Uinf, Usup: Real);
|
||||
---Purpose:
|
||||
|
||||
SetRange (me: in out; theRank: Integer; Uinf, Usup: Real);
|
||||
@@ -140,7 +127,7 @@ is
|
||||
|
||||
is static protected;
|
||||
|
||||
Results(me: in out;AlgExt: ECC;
|
||||
Results(me: in out;AlgExt: ECC from Extrema;
|
||||
Ut11, Ut12, Ut21, Ut22: Real)
|
||||
|
||||
is static protected;
|
||||
@@ -172,4 +159,4 @@ fields
|
||||
|
||||
|
||||
|
||||
end GExtCC;
|
||||
end ExtCC;
|
@@ -19,7 +19,7 @@
|
||||
// tri des solutions pour eviter de rendre plusieurs
|
||||
// fois la meme solution
|
||||
|
||||
#include Extrema_ECC_hxx
|
||||
#include <Extrema_ExtCC.ixx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Extrema_ExtElC.hxx>
|
||||
@@ -43,12 +43,16 @@
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Extrema_CCache.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Extrema_GExtCC
|
||||
//function : Extrema_ExtCC
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Extrema_GExtCC::Extrema_GExtCC (const Standard_Real TolC1,
|
||||
Extrema_ExtCC::Extrema_ExtCC (const Standard_Real TolC1,
|
||||
const Standard_Real TolC2) :
|
||||
myDone (Standard_False)
|
||||
{
|
||||
@@ -57,12 +61,12 @@ Extrema_GExtCC::Extrema_GExtCC (const Standard_Real TolC1,
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Extrema_GExtCC
|
||||
//function : Extrema_ExtCC
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Extrema_GExtCC::Extrema_GExtCC(const Curve1& C1,
|
||||
const Curve2& C2,
|
||||
Extrema_ExtCC::Extrema_ExtCC(const Adaptor3d_Curve& C1,
|
||||
const Adaptor3d_Curve& C2,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Real V1,
|
||||
@@ -80,12 +84,12 @@ Extrema_GExtCC::Extrema_GExtCC(const Curve1& C1,
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Extrema_GExtCC
|
||||
//function : Extrema_ExtCC
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Extrema_GExtCC::Extrema_GExtCC(const Curve1& C1,
|
||||
const Curve2& C2,
|
||||
Extrema_ExtCC::Extrema_ExtCC(const Adaptor3d_Curve& C1,
|
||||
const Adaptor3d_Curve& C2,
|
||||
const Standard_Real TolC1,
|
||||
const Standard_Real TolC2) :
|
||||
myDone (Standard_False)
|
||||
@@ -102,9 +106,9 @@ Extrema_GExtCC::Extrema_GExtCC(const Curve1& C1,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_GExtCC::SetCurve (const Standard_Integer theRank, const Curve1& C)
|
||||
void Extrema_ExtCC::SetCurve (const Standard_Integer theRank, const Adaptor3d_Curve& C)
|
||||
{
|
||||
Standard_OutOfRange_Raise_if (theRank < 1 || theRank > 2, "Extrema_GExtCC::SetCurve()")
|
||||
Standard_OutOfRange_Raise_if (theRank < 1 || theRank > 2, "Extrema_ExtCC::SetCurve()")
|
||||
Standard_Integer anInd = theRank - 1;
|
||||
myC[anInd] = (Standard_Address)&C;
|
||||
|
||||
@@ -117,7 +121,7 @@ void Extrema_GExtCC::SetCurve (const Standard_Integer theRank, const Curve1& C)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_GExtCC::SetCurve (const Standard_Integer theRank, const Curve1& C,
|
||||
void Extrema_ExtCC::SetCurve (const Standard_Integer theRank, const Adaptor3d_Curve& C,
|
||||
const Standard_Real Uinf, const Standard_Real Usup)
|
||||
{
|
||||
SetCurve (theRank, C);
|
||||
@@ -129,10 +133,10 @@ void Extrema_GExtCC::SetCurve (const Standard_Integer theRank, const Curve1& C,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_GExtCC::SetRange (const Standard_Integer theRank,
|
||||
void Extrema_ExtCC::SetRange (const Standard_Integer theRank,
|
||||
const Standard_Real Uinf, const Standard_Real Usup)
|
||||
{
|
||||
Standard_OutOfRange_Raise_if (theRank < 1 || theRank > 2, "Extrema_GExtCC::SetRange()")
|
||||
Standard_OutOfRange_Raise_if (theRank < 1 || theRank > 2, "Extrema_ExtCC::SetRange()")
|
||||
Standard_Integer anInd = theRank - 1;
|
||||
myInf[anInd] = Uinf;
|
||||
mySup[anInd] = Usup;
|
||||
@@ -143,9 +147,9 @@ void Extrema_GExtCC::SetRange (const Standard_Integer theRank,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_GExtCC::SetTolerance (const Standard_Integer theRank, const Standard_Real theTol)
|
||||
void Extrema_ExtCC::SetTolerance (const Standard_Integer theRank, const Standard_Real theTol)
|
||||
{
|
||||
Standard_OutOfRange_Raise_if (theRank < 1 || theRank > 2, "Extrema_GExtCC::SetTolerance()")
|
||||
Standard_OutOfRange_Raise_if (theRank < 1 || theRank > 2, "Extrema_ExtCC::SetTolerance()")
|
||||
Standard_Integer anInd = theRank - 1;
|
||||
myTol[anInd] = theTol;
|
||||
}
|
||||
@@ -156,16 +160,16 @@ void Extrema_GExtCC::SetTolerance (const Standard_Integer theRank, const Standar
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_GExtCC::Perform()
|
||||
void Extrema_ExtCC::Perform()
|
||||
{
|
||||
Standard_NullObject_Raise_if (!myC[0] || !myC[1], "Extrema_GExtCC::Perform()")
|
||||
Standard_NullObject_Raise_if (!myC[0] || !myC[1], "Extrema_ExtCC::Perform()")
|
||||
myDone = Standard_False;
|
||||
mypoints.Clear();
|
||||
mySqDist.Clear();
|
||||
myIsPar = Standard_False;
|
||||
|
||||
GeomAbs_CurveType type1 = (*((Curve1*)myC[0])).GetType();
|
||||
GeomAbs_CurveType type2 = (*((Curve2*)myC[1])).GetType();
|
||||
GeomAbs_CurveType type1 = (*((Adaptor3d_Curve*)myC[0])).GetType();
|
||||
GeomAbs_CurveType type2 = (*((Adaptor3d_Curve*)myC[1])).GetType();
|
||||
Standard_Real U11, U12, U21, U22, Tol = Min(myTol[0], myTol[1]);
|
||||
mynbext = 0;
|
||||
inverse = Standard_False;
|
||||
@@ -175,10 +179,10 @@ void Extrema_GExtCC::Perform()
|
||||
U21 = myInf[1];
|
||||
U22 = mySup[1];
|
||||
|
||||
if (!Precision::IsInfinite(U11)) P1f = Tool1::Value(*((Curve1*)myC[0]), U11);
|
||||
if (!Precision::IsInfinite(U12)) P1l = Tool1::Value(*((Curve1*)myC[0]), U12);
|
||||
if (!Precision::IsInfinite(U21)) P2f = Tool2::Value(*((Curve2*)myC[1]), U21);
|
||||
if (!Precision::IsInfinite(U22)) P2l = Tool2::Value(*((Curve2*)myC[1]), U22);
|
||||
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) || Precision::IsInfinite(U21)) mydist11 = RealLast();
|
||||
@@ -210,27 +214,27 @@ void Extrema_GExtCC::Perform()
|
||||
}
|
||||
switch (aType2) {
|
||||
case GeomAbs_Line: {
|
||||
Extrema_ExtElC Xtrem((*((Curve1*)myC[anInd1])).Line(), (*((Curve1*)myC[anInd2])).Line(), Tol);
|
||||
Extrema_ExtElC Xtrem((*((Adaptor3d_Curve*)myC[anInd1])).Line(), (*((Adaptor3d_Curve*)myC[anInd2])).Line(), Tol);
|
||||
Results(Xtrem, U11, U12, U21, U22);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Circle: {
|
||||
Extrema_ExtElC Xtrem((*((Curve1*)myC[anInd1])).Line(), (*((Curve1*)myC[anInd2])).Circle(), Tol);
|
||||
Extrema_ExtElC Xtrem((*((Adaptor3d_Curve*)myC[anInd1])).Line(), (*((Adaptor3d_Curve*)myC[anInd2])).Circle(), Tol);
|
||||
Results(Xtrem, U11, U12, U21, U22);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Ellipse: {
|
||||
Extrema_ExtElC Xtrem((*((Curve1*)myC[anInd1])).Line(), (*((Curve1*)myC[anInd2])).Ellipse());
|
||||
Extrema_ExtElC Xtrem((*((Adaptor3d_Curve*)myC[anInd1])).Line(), (*((Adaptor3d_Curve*)myC[anInd2])).Ellipse());
|
||||
Results(Xtrem, U11, U12, U21, U22);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Hyperbola: {
|
||||
Extrema_ExtElC Xtrem((*((Curve1*)myC[anInd1])).Line(), (*((Curve1*)myC[anInd2])).Hyperbola());
|
||||
Extrema_ExtElC Xtrem((*((Adaptor3d_Curve*)myC[anInd1])).Line(), (*((Adaptor3d_Curve*)myC[anInd2])).Hyperbola());
|
||||
Results(Xtrem, U11, U12, U21, U22);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Parabola: {
|
||||
Extrema_ExtElC Xtrem((*((Curve1*)myC[anInd1])).Line(), (*((Curve1*)myC[anInd2])).Parabola());
|
||||
Extrema_ExtElC Xtrem((*((Adaptor3d_Curve*)myC[anInd1])).Line(), (*((Adaptor3d_Curve*)myC[anInd2])).Parabola());
|
||||
Results(Xtrem, U11, U12, U21, U22);
|
||||
break;
|
||||
}
|
||||
@@ -239,7 +243,7 @@ void Extrema_GExtCC::Perform()
|
||||
} else if (type1 == GeomAbs_Circle && type2 == GeomAbs_Circle) {
|
||||
//analytical case - two circles
|
||||
Standard_Boolean bIsDone;
|
||||
Extrema_ExtElC CCXtrem ((*((Curve1*)myC[0])).Circle(), (*((Curve2*)myC[1])).Circle());
|
||||
Extrema_ExtElC CCXtrem ((*((Adaptor3d_Curve*)myC[0])).Circle(), (*((Adaptor3d_Curve*)myC[1])).Circle());
|
||||
bIsDone = CCXtrem.IsDone();
|
||||
if(bIsDone) {
|
||||
Results(CCXtrem, U11, U12, U21, U22);
|
||||
@@ -251,9 +255,9 @@ void Extrema_GExtCC::Perform()
|
||||
TColStd_ListOfTransient& aCacheList = myCacheLists[i];
|
||||
if (aCacheList.IsEmpty()) {
|
||||
//no caches, build them
|
||||
Curve1& aC = *(Curve1*)myC[i];
|
||||
Adaptor3d_Curve& aC = *(Adaptor3d_Curve*)myC[i];
|
||||
//single interval from myInf[i] to mySup[i]
|
||||
Handle(Extrema_CCache) aCache = new Extrema_CCache (aC, myInf[i], mySup[i], aNbS, Standard_True);
|
||||
Handle(Extrema_CCache) aCache = new Extrema_CCache(aC, myInf[i], mySup[i], aNbS, Standard_True);
|
||||
aCacheList.Append (aCache);
|
||||
}
|
||||
}
|
||||
@@ -277,7 +281,7 @@ void Extrema_GExtCC::Perform()
|
||||
TColStd_ListOfTransient& aCacheList = myCacheLists[i];
|
||||
if (aCacheList.IsEmpty()) {
|
||||
//no caches, build them
|
||||
Curve1& aC = *(Curve1*)myC[i];
|
||||
Adaptor3d_Curve& aC = *(Adaptor3d_Curve*)myC[i];
|
||||
|
||||
Standard_Real du1 = 0., t = 0.;
|
||||
gp_Pnt P1, P2;
|
||||
@@ -292,8 +296,8 @@ void Extrema_GExtCC::Perform()
|
||||
KnotSampling[i] = Standard_True;
|
||||
|
||||
aNbS[i] = aC.NbPoles() * 2;
|
||||
rf = (Tool1::BSpline(*((Curve1*)myC[i])))->FirstParameter();
|
||||
rl = (Tool1::BSpline(*((Curve1*)myC[i])))->LastParameter();
|
||||
rf = (Extrema_CurveTool::BSpline(*((Adaptor3d_Curve*)myC[i])))->FirstParameter();
|
||||
rl = (Extrema_CurveTool::BSpline(*((Adaptor3d_Curve*)myC[i])))->LastParameter();
|
||||
aNbS[i] = (Standard_Integer) ( aNbS[i] * ((mySup[i] - myInf[i]) / (rl - rf)) + 1 );
|
||||
case GeomAbs_OtherCurve:
|
||||
case GeomAbs_Line:
|
||||
@@ -302,9 +306,9 @@ void Extrema_GExtCC::Perform()
|
||||
aNbS[i] = Max(aNbS[i] / aNbInter[i], 3);
|
||||
LL[i] = 0.;
|
||||
du1 = (mySup[i] - myInf[i]) / ((aNbS[i]-1)*aNbInter[i]);
|
||||
P1 = Tool1::Value(*((Curve1*)myC[i]), myInf[i]);
|
||||
P1 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[i]), myInf[i]);
|
||||
for(t = myInf[i] + du1; t <= mySup[i]; t += du1) {
|
||||
P2 = Tool1::Value(*((Curve1*)myC[i]), t);
|
||||
P2 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[i]), t);
|
||||
LL[i] += P1.Distance(P2);
|
||||
P1 = P2;
|
||||
}
|
||||
@@ -343,7 +347,7 @@ void Extrema_GExtCC::Perform()
|
||||
TColStd_ListOfTransient& aCacheList = myCacheLists[i];
|
||||
if (aCacheList.IsEmpty()) {
|
||||
//no caches, build them
|
||||
Curve1& aC = *(Curve1*)myC[i];
|
||||
Adaptor3d_Curve& aC = *(Adaptor3d_Curve*)myC[i];
|
||||
|
||||
if (aC.GetType() >= GeomAbs_BSplineCurve)
|
||||
{
|
||||
@@ -369,7 +373,7 @@ void Extrema_GExtCC::Perform()
|
||||
while (NextKnot != anArr(k+1));
|
||||
|
||||
Handle(Extrema_CCache) aCache =
|
||||
new Extrema_CCache (aC, anArr(k), anArr(k+1),
|
||||
new Extrema_CCache(aC, anArr(k), anArr(k+1),
|
||||
IntervalsCN, start_j, j, Coeff[i]);
|
||||
aCacheList.Append (aCache);
|
||||
|
||||
@@ -380,7 +384,7 @@ void Extrema_GExtCC::Perform()
|
||||
{
|
||||
for (Standard_Integer k = 1; k <= aNbInter[i]; k++) {
|
||||
Handle(Extrema_CCache) aCache =
|
||||
new Extrema_CCache (aC, anArr(k), anArr(k+1), aNbS[i], Standard_True);
|
||||
new Extrema_CCache(aC, anArr(k), anArr(k+1), aNbS[i], Standard_True);
|
||||
aCacheList.Append (aCache);
|
||||
}
|
||||
}
|
||||
@@ -417,7 +421,7 @@ void Extrema_GExtCC::Perform()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Extrema_GExtCC::IsDone() const
|
||||
Standard_Boolean Extrema_ExtCC::IsDone() const
|
||||
{
|
||||
return myDone;
|
||||
}
|
||||
@@ -427,7 +431,7 @@ Standard_Boolean Extrema_GExtCC::IsDone() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Extrema_GExtCC::IsParallel() const
|
||||
Standard_Boolean Extrema_ExtCC::IsParallel() const
|
||||
{
|
||||
return myIsPar;
|
||||
}
|
||||
@@ -438,7 +442,7 @@ Standard_Boolean Extrema_GExtCC::IsParallel() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Extrema_GExtCC::SquareDistance(const Standard_Integer N) const
|
||||
Standard_Real Extrema_ExtCC::SquareDistance(const Standard_Integer N) const
|
||||
{
|
||||
if(!myDone) StdFail_NotDone::Raise();
|
||||
if ((N <= 0) || (N > mynbext)) Standard_OutOfRange::Raise();
|
||||
@@ -451,7 +455,7 @@ Standard_Real Extrema_GExtCC::SquareDistance(const Standard_Integer N) const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Extrema_GExtCC::NbExt() const
|
||||
Standard_Integer Extrema_ExtCC::NbExt() const
|
||||
{
|
||||
if(!myDone) StdFail_NotDone::Raise();
|
||||
return mynbext;
|
||||
@@ -463,7 +467,7 @@ Standard_Integer Extrema_GExtCC::NbExt() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_GExtCC::Points(const Standard_Integer N,
|
||||
void Extrema_ExtCC::Points(const Standard_Integer N,
|
||||
Extrema_POnCurv& P1,
|
||||
Extrema_POnCurv& P2) const
|
||||
{
|
||||
@@ -480,7 +484,7 @@ void Extrema_GExtCC::Points(const Standard_Integer N,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_GExtCC::TrimmedSquareDistances(Standard_Real& dist11,
|
||||
void Extrema_ExtCC::TrimmedSquareDistances(Standard_Real& dist11,
|
||||
Standard_Real& dist12,
|
||||
Standard_Real& dist21,
|
||||
Standard_Real& dist22,
|
||||
@@ -506,7 +510,7 @@ void Extrema_GExtCC::TrimmedSquareDistances(Standard_Real& dist11,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
void Extrema_ExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
const Standard_Real Ut11,
|
||||
const Standard_Real Ut12,
|
||||
const Standard_Real Ut21,
|
||||
@@ -520,17 +524,17 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
if (myDone) {
|
||||
myIsPar = AlgExt.IsParallel();
|
||||
if (myIsPar) {
|
||||
GeomAbs_CurveType type = Tool1::GetType(*((Curve1*)myC[0]));
|
||||
GeomAbs_CurveType type2 = Tool2::GetType(*((Curve2*)myC[1]));
|
||||
GeomAbs_CurveType type = Extrema_CurveTool::GetType(*((Adaptor3d_Curve*)myC[0]));
|
||||
GeomAbs_CurveType type2 = Extrema_CurveTool::GetType(*((Adaptor3d_Curve*)myC[1]));
|
||||
// Parallel case is only for line-line, circle-circle and circle-line!!!
|
||||
// But really for trimmed curves extremas can not exist!
|
||||
Extrema_POnCurv dummypoint(0., gp_Pnt(0.,0.,0.));
|
||||
if(type != type2) {
|
||||
mySqDist.Append(AlgExt.SquareDistance(1));
|
||||
if(type == GeomAbs_Circle) {
|
||||
gp_Pnt PonC1 = Tool1::Value(*((Curve1*)myC[0]), Ut11);
|
||||
gp_Pnt PonC1 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), Ut11);
|
||||
P1.SetValues(Ut11, PonC1);
|
||||
Extrema_ExtPElC ExtPLin(PonC1, Tool2::Line(*((Curve2*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
Extrema_ExtPElC ExtPLin(PonC1, Extrema_CurveTool::Line(*((Adaptor3d_Curve*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
if(ExtPLin.IsDone()) {
|
||||
mynbext = 1;
|
||||
P2 = ExtPLin.Point(1);
|
||||
@@ -545,9 +549,9 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
}
|
||||
}
|
||||
else {
|
||||
gp_Pnt PonC2 = Tool2::Value(*((Curve2*)myC[1]), Ut21);
|
||||
gp_Pnt PonC2 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), Ut21);
|
||||
P2.SetValues(Ut21, PonC2);
|
||||
Extrema_ExtPElC ExtPLin(PonC2, Tool1::Line(*((Curve1*)myC[0])), Precision::Confusion(), Ut11, Ut12);
|
||||
Extrema_ExtPElC ExtPLin(PonC2, Extrema_CurveTool::Line(*((Adaptor3d_Curve*)myC[0])), Precision::Confusion(), Ut11, Ut12);
|
||||
if(ExtPLin.IsDone()) {
|
||||
mynbext = 1;
|
||||
P1 = ExtPLin.Point(1);
|
||||
@@ -573,9 +577,9 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
if(infinite) {
|
||||
mynbext = 1;
|
||||
mySqDist.Append(AlgExt.SquareDistance(1));
|
||||
gp_Pnt PonC1 = Tool1::Value(*((Curve1*)myC[0]), 0.);
|
||||
gp_Pnt PonC1 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), 0.);
|
||||
P1.SetValues(0., PonC1);
|
||||
Extrema_ExtPElC ExtPLin(PonC1, Tool2::Line(*((Curve2*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
Extrema_ExtPElC ExtPLin(PonC1, Extrema_CurveTool::Line(*((Adaptor3d_Curve*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
if(ExtPLin.IsDone()) {
|
||||
P2 = ExtPLin.Point(1);
|
||||
mypoints.Append(P1);
|
||||
@@ -590,8 +594,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
else {
|
||||
Standard_Boolean finish = Standard_False;
|
||||
if(!Precision::IsInfinite(Ut11)) {
|
||||
gp_Pnt PonC1 = Tool1::Value(*((Curve1*)myC[0]), Ut11);
|
||||
Extrema_ExtPElC ExtPLin(PonC1, Tool2::Line(*((Curve2*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
gp_Pnt PonC1 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), Ut11);
|
||||
Extrema_ExtPElC ExtPLin(PonC1, Extrema_CurveTool::Line(*((Adaptor3d_Curve*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
if(ExtPLin.IsDone() && ExtPLin.NbExt() > 0) {
|
||||
mynbext = 1;
|
||||
mySqDist.Append(AlgExt.SquareDistance(1));
|
||||
@@ -604,8 +608,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
}
|
||||
if(!finish) {
|
||||
if(!Precision::IsInfinite(Ut12)) {
|
||||
gp_Pnt PonC1 = Tool1::Value(*((Curve1*)myC[0]), Ut12);
|
||||
Extrema_ExtPElC ExtPLin(PonC1, Tool2::Line(*((Curve2*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
gp_Pnt PonC1 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), Ut12);
|
||||
Extrema_ExtPElC ExtPLin(PonC1, Extrema_CurveTool::Line(*((Adaptor3d_Curve*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
if(ExtPLin.IsDone() && ExtPLin.NbExt() > 0) {
|
||||
mynbext = 1;
|
||||
mySqDist.Append(AlgExt.SquareDistance(1));
|
||||
@@ -619,8 +623,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
}
|
||||
if(!finish) {
|
||||
if(!Precision::IsInfinite(Ut21)) {
|
||||
gp_Pnt PonC2 = Tool2::Value(*((Curve2*)myC[1]), Ut21);
|
||||
Extrema_ExtPElC ExtPLin(PonC2, Tool1::Line(*((Curve1*)myC[0])), Precision::Confusion(), Ut11, Ut12);
|
||||
gp_Pnt PonC2 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), Ut21);
|
||||
Extrema_ExtPElC ExtPLin(PonC2, Extrema_CurveTool::Line(*((Adaptor3d_Curve*)myC[0])), Precision::Confusion(), Ut11, Ut12);
|
||||
if(ExtPLin.IsDone() && ExtPLin.NbExt() > 0) {
|
||||
mynbext = 1;
|
||||
mySqDist.Append(AlgExt.SquareDistance(1));
|
||||
@@ -634,8 +638,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
}
|
||||
if(!finish) {
|
||||
if(!Precision::IsInfinite(Ut22)) {
|
||||
gp_Pnt PonC2 = Tool2::Value(*((Curve2*)myC[1]), Ut22);
|
||||
Extrema_ExtPElC ExtPLin(PonC2, Tool1::Line(*((Curve1*)myC[0])), Precision::Confusion(), Ut11, Ut12);
|
||||
gp_Pnt PonC2 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), Ut22);
|
||||
Extrema_ExtPElC ExtPLin(PonC2, Extrema_CurveTool::Line(*((Adaptor3d_Curve*)myC[0])), Precision::Confusion(), Ut11, Ut12);
|
||||
if(ExtPLin.IsDone() && ExtPLin.NbExt() > 0) {
|
||||
mynbext = 1;
|
||||
mySqDist.Append(AlgExt.SquareDistance(1));
|
||||
@@ -659,9 +663,9 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
}
|
||||
else {
|
||||
Standard_Boolean finish = Standard_False;
|
||||
gp_Pnt PonC1 = Tool1::Value(*((Curve1*)myC[0]), Ut11);
|
||||
gp_Pnt PonC1 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), Ut11);
|
||||
P1.SetValues(Ut11, PonC1);
|
||||
Extrema_ExtPElC ExtPCir(PonC1, Tool2::Circle(*((Curve2*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
Extrema_ExtPElC ExtPCir(PonC1, Extrema_CurveTool::Circle(*((Adaptor3d_Curve*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) {
|
||||
for(i = 1; i <= ExtPCir.NbExt(); i++) {
|
||||
mynbext++;
|
||||
@@ -673,8 +677,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
if(mynbext == 2) finish = Standard_True;
|
||||
}
|
||||
if(!finish) {
|
||||
PonC1 = Tool1::Value(*((Curve1*)myC[0]), Ut12);
|
||||
ExtPCir.Perform(PonC1, Tool2::Circle(*((Curve2*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
PonC1 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), Ut12);
|
||||
ExtPCir.Perform(PonC1, Extrema_CurveTool::Circle(*((Adaptor3d_Curve*)myC[1])), Precision::Confusion(), Ut21, Ut22);
|
||||
P1.SetValues(Ut12, PonC1);
|
||||
if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) {
|
||||
if(mynbext == 0) {
|
||||
@@ -703,8 +707,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
}
|
||||
}
|
||||
if(!finish) {
|
||||
gp_Pnt PonC2 = Tool2::Value(*((Curve2*)myC[1]), Ut21);
|
||||
ExtPCir.Perform(PonC2, Tool1::Circle(*((Curve1*)myC[0])), Precision::Confusion(), Ut11, Ut12);
|
||||
gp_Pnt PonC2 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), Ut21);
|
||||
ExtPCir.Perform(PonC2, Extrema_CurveTool::Circle(*((Adaptor3d_Curve*)myC[0])), Precision::Confusion(), Ut11, Ut12);
|
||||
P2.SetValues(Ut21, PonC2);
|
||||
if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) {
|
||||
if(mynbext == 0) {
|
||||
@@ -733,8 +737,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
}
|
||||
}
|
||||
if(!finish) {
|
||||
gp_Pnt PonC2 = Tool2::Value(*((Curve2*)myC[1]), Ut22);
|
||||
ExtPCir.Perform(PonC2, Tool1::Circle(*((Curve1*)myC[0])), Precision::Confusion(), Ut11, Ut12);
|
||||
gp_Pnt PonC2 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), Ut22);
|
||||
ExtPCir.Perform(PonC2, Extrema_CurveTool::Circle(*((Adaptor3d_Curve*)myC[0])), Precision::Confusion(), Ut11, Ut12);
|
||||
P2.SetValues(Ut22, PonC2);
|
||||
if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) {
|
||||
if(mynbext == 0) {
|
||||
@@ -787,11 +791,11 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
U = P2.Parameter();
|
||||
}
|
||||
|
||||
if (Tool1::IsPeriodic(*((Curve1*)myC[0]))) {
|
||||
U = ElCLib::InPeriod(U, Ut11, Ut11+Tool1::Period(*((Curve1*)myC[0])));
|
||||
if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[0]))) {
|
||||
U = ElCLib::InPeriod(U, Ut11, Ut11+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[0])));
|
||||
}
|
||||
if (Tool2::IsPeriodic(*((Curve2*)myC[1]))) {
|
||||
U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Tool2::Period(*((Curve2*)myC[1])));
|
||||
if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[1]))) {
|
||||
U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[1])));
|
||||
}
|
||||
|
||||
if ((U >= Ut11 - RealEpsilon()) &&
|
||||
@@ -826,7 +830,7 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_GExtCC::Results(const Extrema_ECC& AlgExt,
|
||||
void Extrema_ExtCC::Results(const Extrema_ECC& AlgExt,
|
||||
const Standard_Real Ut11,
|
||||
const Standard_Real Ut12,
|
||||
const Standard_Real Ut21,
|
||||
@@ -856,11 +860,11 @@ void Extrema_GExtCC::Results(const Extrema_ECC& AlgExt,
|
||||
if (IsExtrema)
|
||||
{
|
||||
// Verification de la validite des parametres
|
||||
if (Tool1::IsPeriodic(*((Curve1*)myC[0]))) {
|
||||
U = ElCLib::InPeriod(U, Ut11, Ut11+Tool1::Period(*((Curve1*)myC[0])));
|
||||
if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[0]))) {
|
||||
U = ElCLib::InPeriod(U, Ut11, Ut11+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[0])));
|
||||
}
|
||||
if (Tool2::IsPeriodic(*((Curve2*)myC[1]))) {
|
||||
U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Tool2::Period(*((Curve2*)myC[1])));
|
||||
if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[1]))) {
|
||||
U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[1])));
|
||||
}
|
||||
|
||||
if ((U >= Ut11 - RealEpsilon()) &&
|
@@ -14,61 +14,49 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class GExtCC2d from Extrema (Curve1 as any;
|
||||
Tool1 as any;
|
||||
Curve2 as any;
|
||||
Tool2 as any)
|
||||
class ExtCC2d from Extrema
|
||||
|
||||
---Purpose: It calculates all the distance between two curves.
|
||||
-- These distances can be maximum or minimum.
|
||||
---Purpose: It calculates all the distance between two curves.
|
||||
-- These distances can be maximum or minimum.
|
||||
|
||||
uses POnCurv2d from Extrema,
|
||||
SequenceOfPOnCurv2d from Extrema,
|
||||
ExtElC2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
HArray1OfPnt2d from TColgp,
|
||||
SequenceOfReal from TColStd
|
||||
SequenceOfReal from TColStd,
|
||||
Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
CCache2d from Extrema,
|
||||
ECC2d from Extrema
|
||||
|
||||
|
||||
raises InfiniteSolutions from StdFail,
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
class CCache2d instantiates CurveCache from Extrema (Curve1, Pnt2d from gp, HArray1OfPnt2d from TColgp);
|
||||
|
||||
class ECC2d instantiates GenExtCC from Extrema
|
||||
(Curve1,
|
||||
Tool1,
|
||||
Curve2,
|
||||
Tool2,
|
||||
CCache2d,
|
||||
HArray1OfPnt2d from TColgp,
|
||||
POnCurv2d,
|
||||
Pnt2d,
|
||||
Vec2d);
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns GExtCC2d;
|
||||
Create returns ExtCC2d;
|
||||
|
||||
|
||||
Create (C1: Curve1; C2: Curve2;
|
||||
TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC2d;
|
||||
Create (C1: Curve2d from Adaptor2d; C2: Curve2d from Adaptor2d;
|
||||
TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns ExtCC2d;
|
||||
---Purpose: It calculates all the distances.
|
||||
|
||||
|
||||
Create (C1: Curve1;
|
||||
C2: Curve2;
|
||||
Create (C1: Curve2d from Adaptor2d;
|
||||
C2: Curve2d from Adaptor2d;
|
||||
U1: Real from Standard;
|
||||
U2: Real from Standard;
|
||||
V1: Real from Standard;
|
||||
V2: Real from Standard;
|
||||
TolC1: Real = 1.0e-10;
|
||||
TolC2: Real = 1.0e-10) returns GExtCC2d;
|
||||
TolC2: Real = 1.0e-10) returns ExtCC2d;
|
||||
---Purpose: It calculates all the distances.
|
||||
|
||||
|
||||
Initialize(me: in out; C2: Curve2;
|
||||
Initialize(me: in out; C2: Curve2d from Adaptor2d;
|
||||
V1, V2: Real from Standard;
|
||||
TolC1: Real = 1.0e-10;
|
||||
TolC2: Real = 1.0e-10)
|
||||
@@ -76,7 +64,7 @@ is
|
||||
is static;
|
||||
|
||||
|
||||
Perform(me: in out; C1: Curve1;
|
||||
Perform(me: in out; C1: Curve2d from Adaptor2d;
|
||||
U1, U2: Real from Standard)
|
||||
is static;
|
||||
|
||||
@@ -139,7 +127,7 @@ is
|
||||
is static protected;
|
||||
|
||||
-- modified by NIZHNY-EAP Thu Jan 27 16:53:25 2000 ___BEGIN___
|
||||
Results(me: in out;AlgExt: ECC2d; C : Curve1;
|
||||
Results(me: in out;AlgExt: ECC2d from Extrema; C : Curve2d from Adaptor2d;
|
||||
-- modified by NIZHNY-EAP Thu Jan 27 16:53:26 2000 ___END___
|
||||
Ut11, Ut12, Ut21, Ut22: Real;
|
||||
Period1 : Real from Standard = 0.0;
|
||||
@@ -171,4 +159,4 @@ fields
|
||||
|
||||
|
||||
|
||||
end GExtCC2d;
|
||||
end ExtCC2d;
|
@@ -14,7 +14,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include Extrema_ECC2d_hxx
|
||||
#include <Extrema_ExtCC2d.ixx>
|
||||
|
||||
#include <Extrema_ExtElC2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Extrema_ExtElC.hxx>
|
||||
@@ -33,6 +34,9 @@
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsParallelDot
|
||||
@@ -48,20 +52,20 @@ static Standard_Boolean IsParallelDot( gp_Vec2d theV1,
|
||||
theV1.Magnitude()*theV2.Magnitude()*cos(AngTol);
|
||||
}
|
||||
|
||||
Extrema_GExtCC2d::Extrema_GExtCC2d() {}
|
||||
Extrema_ExtCC2d::Extrema_ExtCC2d() {}
|
||||
|
||||
|
||||
Extrema_GExtCC2d::Extrema_GExtCC2d(const Curve1& C1,
|
||||
const Curve2& C2,
|
||||
Extrema_ExtCC2d::Extrema_ExtCC2d(const Adaptor2d_Curve2d& C1,
|
||||
const Adaptor2d_Curve2d& C2,
|
||||
const Standard_Real TolC1,
|
||||
const Standard_Real TolC2)
|
||||
{
|
||||
Initialize(C2, Tool2::FirstParameter(C2), Tool2::LastParameter(C2), TolC1, TolC2);
|
||||
Perform(C1, Tool1::FirstParameter(C1), Tool1::LastParameter(C1));
|
||||
Initialize(C2, Extrema_Curve2dTool::FirstParameter(C2), Extrema_Curve2dTool::LastParameter(C2), TolC1, TolC2);
|
||||
Perform(C1, Extrema_Curve2dTool::FirstParameter(C1), Extrema_Curve2dTool::LastParameter(C1));
|
||||
}
|
||||
|
||||
Extrema_GExtCC2d::Extrema_GExtCC2d(const Curve1& C1,
|
||||
const Curve2& C2,
|
||||
Extrema_ExtCC2d::Extrema_ExtCC2d(const Adaptor2d_Curve2d& C1,
|
||||
const Adaptor2d_Curve2d& C2,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Real V1,
|
||||
@@ -75,7 +79,7 @@ Extrema_GExtCC2d::Extrema_GExtCC2d(const Curve1& C1,
|
||||
|
||||
|
||||
|
||||
void Extrema_GExtCC2d::Initialize(const Curve2& C2,
|
||||
void Extrema_ExtCC2d::Initialize(const Adaptor2d_Curve2d& C2,
|
||||
const Standard_Real V1,
|
||||
const Standard_Real V2,
|
||||
const Standard_Real TolC1,
|
||||
@@ -90,14 +94,14 @@ void Extrema_GExtCC2d::Initialize(const Curve2& C2,
|
||||
|
||||
|
||||
|
||||
void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2)
|
||||
{
|
||||
mypoints.Clear();
|
||||
mySqDist.Clear();
|
||||
Standard_Integer NbU = 32, NbV = 32;
|
||||
GeomAbs_CurveType type1 = Tool1::GetType(C1), type2 = Tool2::GetType(*((Curve2*)myC));
|
||||
GeomAbs_CurveType type1 = Extrema_Curve2dTool::GetType(C1), type2 = Extrema_Curve2dTool::GetType(*((Adaptor2d_Curve2d*)myC));
|
||||
Standard_Real U11, U12, U21, U22, Tol = Min(mytolc1, mytolc2);
|
||||
// Extrema_POnCurv2d P1, P2;
|
||||
mynbext = 0;
|
||||
@@ -108,10 +112,10 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
U12 = U2;
|
||||
U21 = myv1;
|
||||
U22 = myv2;
|
||||
P1f = Tool1::Value(C1, U11);
|
||||
P1l = Tool1::Value(C1, U12);
|
||||
P2f = Tool2::Value(*((Curve2*)myC), U21);
|
||||
P2l = Tool2::Value(*((Curve2*)myC), U22);
|
||||
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);
|
||||
|
||||
|
||||
switch(type1) {
|
||||
@@ -122,38 +126,38 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
|
||||
switch(type2) {
|
||||
case GeomAbs_Circle: {
|
||||
Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Circle(*((Curve2*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Circle(*((Adaptor2d_Curve2d*)myC)));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Ellipse: {
|
||||
Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Ellipse(*((Curve2*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI );
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola: {
|
||||
Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Parabola(*((Curve2*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Hyperbola: {
|
||||
Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Hyperbola(*((Curve2*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0. );
|
||||
}
|
||||
break;
|
||||
case GeomAbs_BezierCurve:
|
||||
case GeomAbs_OtherCurve:
|
||||
case GeomAbs_BSplineCurve: {
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Tool2::IsPeriodic(*((Curve2*)myC))) Period2 = Tool2::Period(*((Curve2*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI,Period2);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Line: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Tool2::Line(*((Curve2*)myC)), Tool1::Circle(C1), Tol);
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Circle(C1), Tol);
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
|
||||
}
|
||||
break;
|
||||
@@ -169,27 +173,27 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
switch(type2) {
|
||||
case GeomAbs_Circle: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Tool2::Circle(*((Curve2*)myC)), Tool1::Ellipse(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Ellipse(C1));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Ellipse: {
|
||||
//Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Ellipse(*((Curve2*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Results(Xtrem, C1, U11, U12, U21, U22,2*M_PI, 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola: {
|
||||
//Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Parabola(*((Curve2*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI, 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Hyperbola: {
|
||||
//Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Hyperbola(*((Curve2*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI, 0.);
|
||||
}
|
||||
@@ -197,16 +201,16 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
case GeomAbs_BezierCurve:
|
||||
case GeomAbs_OtherCurve:
|
||||
case GeomAbs_BSplineCurve: {
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Tool2::IsPeriodic(*((Curve2*)myC))) Period2 = Tool2::Period(*((Curve2*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI,Period2);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Line: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Tool2::Line(*((Curve2*)myC)), Tool1::Ellipse(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Ellipse(C1));
|
||||
Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
|
||||
}
|
||||
break;
|
||||
@@ -222,29 +226,29 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
switch(type2) {
|
||||
case GeomAbs_Circle: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Tool2::Circle(*((Curve2*)myC)), Tool1::Parabola(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*((Adaptor2d_Curve2d*)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(Tool2::Ellipse(*((Curve2*)myC)), Tool1::Parabola(C1));
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Parabola(C1));
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola: {
|
||||
//Extrema_ExtElC2d Xtrem(Tool1::Parabola(C1), Tool2::Parabola(*((Curve2*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Parabola(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Hyperbola: {
|
||||
//inverse = Standard_True;
|
||||
//Extrema_ExtElC2d Xtrem(Tool2::Hyperbola(*((Curve2*)myC)), Tool1::Parabola(C1));
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Parabola(C1));
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
@@ -252,16 +256,16 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
case GeomAbs_BezierCurve:
|
||||
case GeomAbs_OtherCurve:
|
||||
case GeomAbs_BSplineCurve: {
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Tool2::IsPeriodic(*((Curve2*)myC))) Period2 = Tool2::Period(*((Curve2*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 0., Period2);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Line: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Tool2::Line(*((Curve2*)myC)), Tool1::Parabola(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Parabola(C1));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
@@ -277,28 +281,28 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
switch(type2) {
|
||||
case GeomAbs_Circle: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Tool2::Circle(*((Curve2*)myC)), Tool1::Hyperbola(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*((Adaptor2d_Curve2d*)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(Tool2::Ellipse(*((Curve2*)myC)), Tool1::Hyperbola(C1));
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Hyperbola(C1));
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*M_PI );
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola: {
|
||||
//Extrema_ExtElC2d Xtrem(Tool1::Hyperbola(C1), Tool2::Parabola(*((Curve2*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Hyperbola: {
|
||||
//Extrema_ExtElC2d Xtrem(Tool1::Hyperbola(C1), Tool2::Hyperbola(*((Curve2*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
//Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(C1), Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
@@ -306,16 +310,16 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
case GeomAbs_OtherCurve:
|
||||
case GeomAbs_BezierCurve:
|
||||
case GeomAbs_BSplineCurve: {
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC)
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC)
|
||||
, NbU, NbV, mytolc1, mytolc2);
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Tool2::IsPeriodic(*((Curve2*)myC))) Period2 = Tool2::Period(*((Curve2*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 0., Period2);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Line: {
|
||||
inverse = Standard_True;
|
||||
Extrema_ExtElC2d Xtrem(Tool2::Line(*((Curve2*)myC)), Tool1::Hyperbola(C1));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Hyperbola(C1));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
@@ -329,12 +333,12 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
case GeomAbs_BezierCurve:
|
||||
case GeomAbs_OtherCurve:
|
||||
case GeomAbs_BSplineCurve: {
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Standard_Real Period1 = 0.;
|
||||
if (Tool1::IsPeriodic(C1)) Period1 = Tool1::Period(C1);
|
||||
if (Extrema_Curve2dTool::IsPeriodic(C1)) Period1 = Extrema_Curve2dTool::Period(C1);
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Tool2::IsPeriodic(*((Curve2*)myC))) Period2 = Tool2::Period(*((Curve2*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, Period1, Period2);
|
||||
}
|
||||
break;
|
||||
@@ -346,37 +350,37 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
|
||||
switch(type2) {
|
||||
case GeomAbs_Circle: {
|
||||
Extrema_ExtElC2d Xtrem(Tool1::Line(C1), Tool2::Circle(*((Curve2*)myC)), Tol);
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Circle(*((Adaptor2d_Curve2d*)myC)), Tol);
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Ellipse: {
|
||||
Extrema_ExtElC2d Xtrem(Tool1::Line(C1), Tool2::Ellipse(*((Curve2*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Parabola: {
|
||||
Extrema_ExtElC2d Xtrem(Tool1::Line(C1), Tool2::Parabola(*((Curve2*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Hyperbola: {
|
||||
Extrema_ExtElC2d Xtrem(Tool1::Line(C1), Tool2::Hyperbola(*((Curve2*)myC)));
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)));
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_BezierCurve:
|
||||
case GeomAbs_OtherCurve:
|
||||
case GeomAbs_BSplineCurve: {
|
||||
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
|
||||
Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
|
||||
NbU, NbV, mytolc1, mytolc2);
|
||||
Standard_Real Period2 = 0.;
|
||||
if (Tool2::IsPeriodic(*((Curve2*)myC))) Period2 = Tool2::Period(*((Curve2*)myC));
|
||||
if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC));
|
||||
Results(Xtrem, C1, U11, U12, U21, U22, 0., Period2);
|
||||
}
|
||||
break;
|
||||
case GeomAbs_Line: {
|
||||
Extrema_ExtElC2d Xtrem(Tool1::Line(C1), Tool2::Line(*((Curve2*)myC)), Tol);
|
||||
Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Line(*((Adaptor2d_Curve2d*)myC)), Tol);
|
||||
Results(Xtrem, U11, U12, U21, U22, 0., 0.);
|
||||
}
|
||||
break;
|
||||
@@ -389,13 +393,13 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean Extrema_GExtCC2d::IsDone() const
|
||||
Standard_Boolean Extrema_ExtCC2d::IsDone() const
|
||||
{
|
||||
return myDone;
|
||||
}
|
||||
|
||||
|
||||
Standard_Real Extrema_GExtCC2d::SquareDistance(const Standard_Integer N) const
|
||||
Standard_Real Extrema_ExtCC2d::SquareDistance(const Standard_Integer N) const
|
||||
{
|
||||
if(!myDone) StdFail_NotDone::Raise();
|
||||
if ((N <= 0) || (N > mynbext)) Standard_OutOfRange::Raise();
|
||||
@@ -403,14 +407,14 @@ Standard_Real Extrema_GExtCC2d::SquareDistance(const Standard_Integer N) const
|
||||
}
|
||||
|
||||
|
||||
Standard_Integer Extrema_GExtCC2d::NbExt() const
|
||||
Standard_Integer Extrema_ExtCC2d::NbExt() const
|
||||
{
|
||||
if(!myDone) StdFail_NotDone::Raise();
|
||||
return mynbext;
|
||||
}
|
||||
|
||||
|
||||
void Extrema_GExtCC2d::Points(const Standard_Integer N,
|
||||
void Extrema_ExtCC2d::Points(const Standard_Integer N,
|
||||
Extrema_POnCurv2d& P1,
|
||||
Extrema_POnCurv2d& P2) const
|
||||
{
|
||||
@@ -422,7 +426,7 @@ void Extrema_GExtCC2d::Points(const Standard_Integer N,
|
||||
|
||||
|
||||
|
||||
void Extrema_GExtCC2d::TrimmedSquareDistances(Standard_Real& dist11,
|
||||
void Extrema_ExtCC2d::TrimmedSquareDistances(Standard_Real& dist11,
|
||||
Standard_Real& dist12,
|
||||
Standard_Real& dist21,
|
||||
Standard_Real& dist22,
|
||||
@@ -443,7 +447,7 @@ void Extrema_GExtCC2d::TrimmedSquareDistances(Standard_Real& dist11,
|
||||
|
||||
|
||||
|
||||
void Extrema_GExtCC2d::Results(const Extrema_ExtElC2d& AlgExt,
|
||||
void Extrema_ExtCC2d::Results(const Extrema_ExtElC2d& AlgExt,
|
||||
const Standard_Real Ut11,
|
||||
const Standard_Real Ut12,
|
||||
const Standard_Real Ut21,
|
||||
@@ -506,9 +510,9 @@ void Extrema_GExtCC2d::Results(const Extrema_ExtElC2d& AlgExt,
|
||||
}
|
||||
|
||||
|
||||
void Extrema_GExtCC2d::Results(const Extrema_ECC2d& AlgExt,
|
||||
void Extrema_ExtCC2d::Results(const Extrema_ECC2d& AlgExt,
|
||||
// modified by NIZHNY-EAP Wed Feb 23 14:51:24 2000 ___BEGIN___
|
||||
const Curve1& C1,
|
||||
const Adaptor2d_Curve2d& C1,
|
||||
// modified by NIZHNY-EAP Wed Feb 23 14:51:26 2000 ___END___
|
||||
const Standard_Real Ut11,
|
||||
const Standard_Real Ut12,
|
||||
@@ -541,8 +545,8 @@ void Extrema_GExtCC2d::Results(const Extrema_ECC2d& AlgExt,
|
||||
// to be sure that it's a real extrema
|
||||
gp_Pnt2d p;
|
||||
gp_Vec2d v1, v2;
|
||||
Tool1::D1(C1,U,p, v1);
|
||||
Tool2::D1(*((Curve2*)myC),U2,p, v2);
|
||||
Extrema_Curve2dTool::D1(C1,U,p, v1);
|
||||
Extrema_Curve2dTool::D1(*((Adaptor2d_Curve2d*)myC),U2,p, v2);
|
||||
if (IsParallelDot(v1, v2, Precision::Angular()))
|
||||
{
|
||||
mynbext++;
|
||||
@@ -566,7 +570,7 @@ void Extrema_GExtCC2d::Results(const Extrema_ECC2d& AlgExt,
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean Extrema_GExtCC2d::IsParallel() const
|
||||
Standard_Boolean Extrema_ExtCC2d::IsParallel() const
|
||||
{
|
||||
if (!myDone) StdFail_NotDone::Raise();
|
||||
return myIsPar;
|
@@ -14,50 +14,24 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class GLocateExtCC from Extrema (Curve1 as any;
|
||||
Tool1 as any;
|
||||
Curve2 as any;
|
||||
Tool2 as any)
|
||||
|
||||
---Purpose: It calculates the distance between two curves with
|
||||
-- a close point; these distances can be maximum or
|
||||
-- minimum.
|
||||
class LocateExtCC from Extrema
|
||||
|
||||
uses POnCurv from Extrema,
|
||||
Pnt from gp,
|
||||
HArray1OfPnt from TColgp
|
||||
---Purpose: It calculates the distance between two curves with
|
||||
-- a close point; these distances can be maximum or
|
||||
-- minimum.
|
||||
|
||||
uses POnCurv from Extrema,
|
||||
Pnt from gp,
|
||||
HArray1OfPnt from TColgp,
|
||||
Curve from Adaptor3d,
|
||||
CurveTool from Extrema
|
||||
|
||||
raises DomainError from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
class LCCache instantiates CurveCache from Extrema (Curve1, Pnt from gp, HArray1OfPnt from TColgp);
|
||||
|
||||
class ELCC instantiates GenExtCC from Extrema
|
||||
(Curve1,
|
||||
Tool1,
|
||||
Curve2,
|
||||
Tool2,
|
||||
LCCache,
|
||||
HArray1OfPnt from TColgp,
|
||||
POnCurv,
|
||||
Pnt,
|
||||
Vec);
|
||||
|
||||
|
||||
class LocECC instantiates GenLocateExtCC from Extrema
|
||||
(Curve1,
|
||||
Tool1,
|
||||
Curve2,
|
||||
Tool2,
|
||||
POnCurv,
|
||||
Pnt,
|
||||
Vec);
|
||||
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
Create (C1: Curve1; C2: Curve2; U0,V0: Real)
|
||||
returns GLocateExtCC
|
||||
Create (C1: Curve from Adaptor3d; C2: Curve from Adaptor3d; U0,V0: Real)
|
||||
returns LocateExtCC
|
||||
---Purpose: Calculates the distance with a close point. The
|
||||
-- close point is defined by a parameter value on each
|
||||
-- curve.
|
||||
@@ -91,4 +65,4 @@ fields
|
||||
myPoint1: POnCurv;
|
||||
myPoint2: POnCurv;
|
||||
|
||||
end GLocateExtCC;
|
||||
end LocateExtCC;
|
@@ -14,16 +14,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include Extrema_ELCC_hxx
|
||||
#include Extrema_LocECC_hxx
|
||||
#include <Extrema_LocateExtCC.ixx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
Extrema_GLocateExtCC::Extrema_GLocateExtCC (const Curve1& C1,
|
||||
const Curve2& C2,
|
||||
const Standard_Real U0,
|
||||
const Standard_Real V0)
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_LocECC.hxx>
|
||||
|
||||
Extrema_LocateExtCC::Extrema_LocateExtCC (const Adaptor3d_Curve& C1,
|
||||
const Adaptor3d_Curve& C2,
|
||||
const Standard_Real U0,
|
||||
const Standard_Real V0)
|
||||
{
|
||||
Standard_Real TolU = C1.Resolution(Precision::Confusion());
|
||||
Standard_Real TolV = C2.Resolution(Precision::Confusion());
|
||||
@@ -31,9 +34,8 @@ Extrema_GLocateExtCC::Extrema_GLocateExtCC (const Curve1& C1,
|
||||
|
||||
// Non implemente pour l instant: l appel a Extrema_ELCC.
|
||||
|
||||
|
||||
Extrema_LocECC Xtrem(C1, C2,
|
||||
U0, V0, TolU, TolV);
|
||||
U0, V0, TolU, TolV);
|
||||
// Exploitation
|
||||
|
||||
myDone = Xtrem.IsDone();
|
||||
@@ -43,27 +45,20 @@ Extrema_GLocateExtCC::Extrema_GLocateExtCC (const Curve1& C1,
|
||||
myPoint1 = P1;
|
||||
myPoint2 = P2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Standard_Boolean Extrema_GLocateExtCC::IsDone () const {
|
||||
Standard_Boolean Extrema_LocateExtCC::IsDone () const {
|
||||
|
||||
return myDone;
|
||||
}
|
||||
|
||||
|
||||
Standard_Real Extrema_GLocateExtCC::SquareDistance() const {
|
||||
Standard_Real Extrema_LocateExtCC::SquareDistance() const {
|
||||
|
||||
if (!myDone) { StdFail_NotDone::Raise(); }
|
||||
return mySqDist;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Extrema_GLocateExtCC::Point (Extrema_POnCurv& P1, Extrema_POnCurv& P2) const {
|
||||
void Extrema_LocateExtCC::Point (Extrema_POnCurv& P1, Extrema_POnCurv& P2) const {
|
||||
|
||||
if (!myDone) { StdFail_NotDone::Raise(); }
|
||||
P1 = myPoint1;
|
@@ -14,51 +14,26 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class GLocateExtCC2d from Extrema (Curve1 as any;
|
||||
Tool1 as any;
|
||||
Curve2 as any;
|
||||
Tool2 as any)
|
||||
|
||||
---Purpose: It calculates the distance between two curves with
|
||||
-- a close point; these distances can be maximum or
|
||||
-- minimum.
|
||||
class LocateExtCC2d from Extrema
|
||||
|
||||
uses POnCurv2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Vec2d from gp,
|
||||
HArray1OfPnt2d from TColgp
|
||||
---Purpose: It calculates the distance between two curves with
|
||||
-- a close point; these distances can be maximum or
|
||||
-- minimum.
|
||||
|
||||
uses POnCurv2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Vec2d from gp,
|
||||
HArray1OfPnt2d from TColgp,
|
||||
Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
LCCache2d from Extrema
|
||||
|
||||
raises DomainError from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
class LCCache2d instantiates CurveCache from Extrema (Curve1, Pnt2d from gp, HArray1OfPnt2d from TColgp);
|
||||
|
||||
class ELCC2d instantiates GenExtCC from Extrema
|
||||
(Curve1,
|
||||
Tool1,
|
||||
Curve2,
|
||||
Tool2,
|
||||
LCCache2d,
|
||||
HArray1OfPnt2d from TColgp,
|
||||
POnCurv2d,
|
||||
Pnt2d,
|
||||
Vec2d);
|
||||
|
||||
|
||||
class LocECC2d instantiates GenLocateExtCC from Extrema
|
||||
(Curve1,
|
||||
Tool1,
|
||||
Curve2,
|
||||
Tool2,
|
||||
POnCurv2d,
|
||||
Pnt2d,
|
||||
Vec2d);
|
||||
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
Create (C1: Curve1; C2: Curve2; U0,V0: Real)
|
||||
returns GLocateExtCC2d
|
||||
Create (C1: Curve2d from Adaptor2d; C2: Curve2d from Adaptor2d; U0,V0: Real)
|
||||
returns LocateExtCC2d
|
||||
---Purpose: Calculates the distance with a close point. The
|
||||
-- close point is defined by a parameter value on each
|
||||
-- curve.
|
||||
@@ -92,4 +67,4 @@ fields
|
||||
myPoint1: POnCurv2d;
|
||||
myPoint2: POnCurv2d;
|
||||
|
||||
end GLocateExtCC2d;
|
||||
end LocateExtCC2d;
|
@@ -14,26 +14,30 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include Extrema_ELCC2d_hxx
|
||||
#include Extrema_LocECC2d_hxx
|
||||
#include <Extrema_LocateExtCC2d.hxx>
|
||||
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
#include <Extrema_LocECC2d.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Extrema_GLocateExtCC2d
|
||||
//function : Extrema_LocateExtCC2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Extrema_GLocateExtCC2d::Extrema_GLocateExtCC2d (const Curve1& C1,
|
||||
const Curve2& C2,
|
||||
const Standard_Real U0,
|
||||
const Standard_Real V0)
|
||||
Extrema_LocateExtCC2d::Extrema_LocateExtCC2d (const Adaptor2d_Curve2d& C1,
|
||||
const Adaptor2d_Curve2d& C2,
|
||||
const Standard_Real U0,
|
||||
const Standard_Real V0)
|
||||
{
|
||||
Standard_Real TolU = Tool1::Resolution(C1, Precision::Confusion());
|
||||
Standard_Real TolV = Tool2::Resolution(C2, Precision::Confusion());
|
||||
Standard_Real TolU = Extrema_Curve2dTool::Resolution(C1, Precision::Confusion());
|
||||
Standard_Real TolV = Extrema_Curve2dTool::Resolution(C2, Precision::Confusion());
|
||||
Extrema_POnCurv2d P1, P2;
|
||||
|
||||
// Non implemente pour l instant: l appel a Geom2dExtrema_ExtCC.
|
||||
@@ -60,7 +64,7 @@ Extrema_GLocateExtCC2d::Extrema_GLocateExtCC2d (const Curve1& C1,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Extrema_GLocateExtCC2d::IsDone () const {
|
||||
Standard_Boolean Extrema_LocateExtCC2d::IsDone () const {
|
||||
|
||||
return myDone;
|
||||
}
|
||||
@@ -71,7 +75,7 @@ Standard_Boolean Extrema_GLocateExtCC2d::IsDone () const {
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Extrema_GLocateExtCC2d::SquareDistance() const {
|
||||
Standard_Real Extrema_LocateExtCC2d::SquareDistance() const {
|
||||
|
||||
if (!myDone) { StdFail_NotDone::Raise(); }
|
||||
return mySqDist;
|
||||
@@ -84,8 +88,8 @@ Standard_Real Extrema_GLocateExtCC2d::SquareDistance() const {
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Extrema_GLocateExtCC2d::Point (Extrema_POnCurv2d& P1,
|
||||
Extrema_POnCurv2d& P2) const
|
||||
void Extrema_LocateExtCC2d::Point (Extrema_POnCurv2d& P1,
|
||||
Extrema_POnCurv2d& P2) const
|
||||
{
|
||||
if (!myDone) { StdFail_NotDone::Raise(); }
|
||||
P1 = myPoint1;
|
Reference in New Issue
Block a user