diff --git a/src/Extrema/Extrema.cdl b/src/Extrema/Extrema.cdl index 52c270a469..16cc793a40 100644 --- a/src/Extrema/Extrema.cdl +++ b/src/Extrema/Extrema.cdl @@ -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; diff --git a/src/Extrema/Extrema_GExtCC.cdl b/src/Extrema/Extrema_ExtCC.cdl similarity index 79% rename from src/Extrema/Extrema_GExtCC.cdl rename to src/Extrema/Extrema_ExtCC.cdl index 462ac4bbb6..889e62d9aa 100644 --- a/src/Extrema/Extrema_GExtCC.cdl +++ b/src/Extrema/Extrema_ExtCC.cdl @@ -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; diff --git a/src/Extrema/Extrema_GExtCC.gxx b/src/Extrema/Extrema_ExtCC.cxx similarity index 77% rename from src/Extrema/Extrema_GExtCC.gxx rename to src/Extrema/Extrema_ExtCC.cxx index 6c71c6649f..cf0cae0d37 100644 --- a/src/Extrema/Extrema_GExtCC.gxx +++ b/src/Extrema/Extrema_ExtCC.cxx @@ -19,7 +19,7 @@ // tri des solutions pour eviter de rendre plusieurs // fois la meme solution -#include Extrema_ECC_hxx +#include #include #include @@ -43,12 +43,16 @@ #include #include +#include +#include +#include + //======================================================================= -//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()) && diff --git a/src/Extrema/Extrema_GExtCC2d.cdl b/src/Extrema/Extrema_ExtCC2d.cdl similarity index 79% rename from src/Extrema/Extrema_GExtCC2d.cdl rename to src/Extrema/Extrema_ExtCC2d.cdl index f949093bff..f3ffa2e7d4 100644 --- a/src/Extrema/Extrema_GExtCC2d.cdl +++ b/src/Extrema/Extrema_ExtCC2d.cdl @@ -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; diff --git a/src/Extrema/Extrema_GExtCC2d.gxx b/src/Extrema/Extrema_ExtCC2d.cxx similarity index 66% rename from src/Extrema/Extrema_GExtCC2d.gxx rename to src/Extrema/Extrema_ExtCC2d.cxx index 2078a19c11..c754578a2e 100644 --- a/src/Extrema/Extrema_GExtCC2d.gxx +++ b/src/Extrema/Extrema_ExtCC2d.cxx @@ -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 + #include #include #include @@ -33,6 +34,9 @@ #include #include +#include +#include + //======================================================================= //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; diff --git a/src/Extrema/Extrema_GLocateExtCC.cdl b/src/Extrema/Extrema_LocateExtCC.cdl similarity index 65% rename from src/Extrema/Extrema_GLocateExtCC.cdl rename to src/Extrema/Extrema_LocateExtCC.cdl index 6ced85ff00..9efaa25d68 100644 --- a/src/Extrema/Extrema_GLocateExtCC.cdl +++ b/src/Extrema/Extrema_LocateExtCC.cdl @@ -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; diff --git a/src/Extrema/Extrema_GLocateExtCC.gxx b/src/Extrema/Extrema_LocateExtCC.cxx similarity index 70% rename from src/Extrema/Extrema_GLocateExtCC.gxx rename to src/Extrema/Extrema_LocateExtCC.cxx index 8dd9fa3585..b43a3be0c2 100644 --- a/src/Extrema/Extrema_GLocateExtCC.gxx +++ b/src/Extrema/Extrema_LocateExtCC.cxx @@ -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 + #include #include #include -Extrema_GLocateExtCC::Extrema_GLocateExtCC (const Curve1& C1, - const Curve2& C2, - const Standard_Real U0, - const Standard_Real V0) +#include +#include + +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; diff --git a/src/Extrema/Extrema_GLocateExtCC2d.cdl b/src/Extrema/Extrema_LocateExtCC2d.cdl similarity index 63% rename from src/Extrema/Extrema_GLocateExtCC2d.cdl rename to src/Extrema/Extrema_LocateExtCC2d.cdl index 00f5531b42..2a4dbd4c6d 100644 --- a/src/Extrema/Extrema_GLocateExtCC2d.cdl +++ b/src/Extrema/Extrema_LocateExtCC2d.cdl @@ -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; diff --git a/src/Extrema/Extrema_GLocateExtCC2d.gxx b/src/Extrema/Extrema_LocateExtCC2d.cxx similarity index 70% rename from src/Extrema/Extrema_GLocateExtCC2d.gxx rename to src/Extrema/Extrema_LocateExtCC2d.cxx index 4598ecd342..ac6ec81917 100644 --- a/src/Extrema/Extrema_GLocateExtCC2d.gxx +++ b/src/Extrema/Extrema_LocateExtCC2d.cxx @@ -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 + #include #include #include #include +#include +#include +#include + //======================================================================= -//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; diff --git a/src/GccEnt/GccEnt.cdl b/src/GccEnt/GccEnt.cdl index 83a1d0947c..edf7ad718a 100644 --- a/src/GccEnt/GccEnt.cdl +++ b/src/GccEnt/GccEnt.cdl @@ -52,8 +52,6 @@ is class QualifiedCirc; - generic class QualifiedCurv; - enumeration Position is unqualified, enclosing, enclosed, outside, noqualifier; ---Purpose: diff --git a/src/Geom2dGcc/Geom2dGcc.cdl b/src/Geom2dGcc/Geom2dGcc.cdl index 6011cf1eea..be1eb831ec 100644 --- a/src/Geom2dGcc/Geom2dGcc.cdl +++ b/src/Geom2dGcc/Geom2dGcc.cdl @@ -67,68 +67,67 @@ class Lin2d2Tan; class Lin2dTanObl; -class MyQCurve instantiates QualifiedCurv from GccEnt - (Curve from Geom2dAdaptor); +class QCurve; class MyCurveTool instantiates CurvePGTool from GccGeo - (Curve from Geom2dAdaptor, - CurveTool from Geom2dGcc , - OffsetCurve from Adaptor3d); - + (Curve from Geom2dAdaptor, + CurveTool from Geom2dGcc, + OffsetCurve from Adaptor3d); + class MyCirc2d2TanOn instantiates Circ2d2TanOn from GccGeo - (Curve from Geom2dAdaptor, - CurveTool from Geom2dGcc, - MyQCurve from Geom2dGcc, - OffsetCurve from Adaptor3d, - HCurve from Geom2dAdaptor, - MyCurveTool from Geom2dGcc, - TheIntConicCurveOfGInter from Geom2dInt); - + (Curve from Geom2dAdaptor, + CurveTool from Geom2dGcc, + QCurve from Geom2dGcc, + OffsetCurve from Adaptor3d, + HCurve from Geom2dAdaptor, + MyCurveTool from Geom2dGcc, + TheIntConicCurveOfGInter from Geom2dInt); + class MyCirc2d2TanRad instantiates Circ2d2TanRad from GccGeo - (Curve from Geom2dAdaptor , - CurveTool from Geom2dGcc, - MyQCurve from Geom2dGcc, - OffsetCurve from Adaptor3d, - HCurve from Geom2dAdaptor, - MyCurveTool from Geom2dGcc, - TheIntConicCurveOfGInter from Geom2dInt, - GInter from Geom2dInt); + (Curve from Geom2dAdaptor, + CurveTool from Geom2dGcc, + QCurve from Geom2dGcc, + OffsetCurve from Adaptor3d, + HCurve from Geom2dAdaptor, + MyCurveTool from Geom2dGcc, + TheIntConicCurveOfGInter from Geom2dInt, + GInter from Geom2dInt); class MyCirc2dTanOnRad instantiates Circ2dTanOnRad from GccGeo - (Curve from Geom2dAdaptor , - CurveTool from Geom2dGcc, - MyQCurve from Geom2dGcc, - OffsetCurve from Adaptor3d, - HCurve from Geom2dAdaptor, - MyCurveTool from Geom2dGcc, - TheIntConicCurveOfGInter from Geom2dInt, - GInter from Geom2dInt); + (Curve from Geom2dAdaptor , + CurveTool from Geom2dGcc, + QCurve from Geom2dGcc, + OffsetCurve from Adaptor3d, + HCurve from Geom2dAdaptor, + MyCurveTool from Geom2dGcc, + TheIntConicCurveOfGInter from Geom2dInt, + GInter from Geom2dInt); -class MyC2d3Tan instantiates Circ2d3Tan from GccIter - (Curve from Geom2dAdaptor, - CurveTool from Geom2dGcc, - MyQCurve from Geom2dGcc); - -class MyCirc2dTanCen instantiates Circ2dTanCen from GccGeo - (Curve from Geom2dAdaptor, - CurveTool from Geom2dGcc, - ExtPC2d from Extrema, - MyQCurve from Geom2dGcc); - -class MyC2d2TanOn instantiates Circ2d2TanOn from GccIter - (Curve from Geom2dAdaptor, - CurveTool from Geom2dGcc, - MyQCurve from Geom2dGcc); +class MyC2d3Tan instantiates Circ2d3Tan from GccIter + (Curve from Geom2dAdaptor, + CurveTool from Geom2dGcc, + QCurve from Geom2dGcc); + +class MyCirc2dTanCen instantiates Circ2dTanCen from GccGeo + (Curve from Geom2dAdaptor, + CurveTool from Geom2dGcc, + ExtPC2d from Extrema, + QCurve from Geom2dGcc); + +class MyC2d2TanOn instantiates Circ2d2TanOn from GccIter + (Curve from Geom2dAdaptor, + CurveTool from Geom2dGcc, + QCurve from Geom2dGcc); + +class MyL2dTanObl instantiates Lin2dTanObl from GccIter + (Curve from Geom2dAdaptor, + CurveTool from Geom2dGcc, + QCurve from Geom2dGcc); -class MyL2dTanObl instantiates Lin2dTanObl from GccIter - (Curve from Geom2dAdaptor, - CurveTool from Geom2dGcc, - MyQCurve from Geom2dGcc); - class MyL2d2Tan instantiates Lin2d2Tan from GccIter - (Curve from Geom2dAdaptor, - CurveTool from Geom2dGcc, - MyQCurve from Geom2dGcc); + (Curve from Geom2dAdaptor, + CurveTool from Geom2dGcc, + QCurve from Geom2dGcc); Unqualified(Obj : Curve from Geom2dAdaptor) returns QualifiedCurve; ---Purpose: Constructs such a qualified curve that the relative diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx index 6e3a6773bf..6ae5cdcdf4 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -273,8 +273,8 @@ Geom2dGcc_Circ2d2TanOn:: //============================================================================= else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); - Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier()); if ((Type3 == GeomAbs_Circle || Type3 == GeomAbs_Line)) { if (Type3 == GeomAbs_Circle) { Handle(Geom2d_Circle) CCon = Handle(Geom2d_Circle)::DownCast(Con); @@ -445,7 +445,7 @@ Geom2dGcc_Circ2d2TanOn:: //============================================================================= else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); if ((Type3 == GeomAbs_Circle || Type3 == GeomAbs_Line)) { if (Type3 == GeomAbs_Circle) { Handle(Geom2d_Circle) CCon = Handle(Geom2d_Circle)::DownCast(Con); diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx index 71c5846634..d8ba1e7905 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -177,7 +177,7 @@ Geom2dGcc_Circ2d2TanRad:: else { GccEnt_QualifiedLin Ql1 = GccEnt_QualifiedLin(l1, Qualified1.Qualifier()); - Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); + Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_MyCirc2d2TanRad CircGeo(Ql1,Qc2,Radius,Tolerance); WellDone = CircGeo.IsDone(); NbrSol = CircGeo.NbSolutions(); @@ -192,7 +192,7 @@ Geom2dGcc_Circ2d2TanRad:: gp_Circ2d c1(CCC1->Circ2d()); GccEnt_QualifiedCirc Qc1 = GccEnt_QualifiedCirc(c1, Qualified1.Qualifier()); - Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); + Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc1,Qc2,Radius,Tolerance); WellDone = CircGeo.IsDone(); NbrSol = CircGeo.NbSolutions(); @@ -212,7 +212,7 @@ Geom2dGcc_Circ2d2TanRad:: else { GccEnt_QualifiedLin Ql2 = GccEnt_QualifiedLin(l2, Qualified2.Qualifier()); - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_MyCirc2d2TanRad CircGeo(Ql2,Qc1,Radius,Tolerance); WellDone = CircGeo.IsDone(); NbrSol = CircGeo.NbSolutions(); @@ -228,7 +228,7 @@ Geom2dGcc_Circ2d2TanRad:: gp_Circ2d c2(CCC2->Circ2d()); GccEnt_QualifiedCirc Qc2 = GccEnt_QualifiedCirc(c2, Qualified2.Qualifier()); - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc2,Qc1,Radius,Tolerance); WellDone = CircGeo.IsDone(); NbrSol = CircGeo.NbSolutions(); @@ -238,8 +238,8 @@ Geom2dGcc_Circ2d2TanRad:: Results(CircGeo); } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); - Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc1,Qc2,Radius,Tolerance); WellDone = CircGeo.IsDone(); NbrSol = CircGeo.NbSolutions(); @@ -311,7 +311,7 @@ Geom2dGcc_Circ2d2TanRad:: // Appel a GccGeo. + //============================================================================= else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc1,Point->Pnt2d(),Radius,Tolerance); WellDone = CircGeo.IsDone(); NbrSol = CircGeo.NbSolutions(); diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d3Tan.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d3Tan.cxx index 7cee6714e3..356a400cab 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d3Tan.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d3Tan.cxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -212,9 +212,9 @@ Geom2dGcc_Circ2d3Tan:: } } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); - Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); - Geom2dGcc_MyQCurve Qc3(C3,Qualified3.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier()); + Geom2dGcc_QCurve Qc3(C3,Qualified3.Qualifier()); Geom2dGcc_MyC2d3Tan Circ(Qc1,Qc2,Qc3,Param1,Param2,Param3,Tolerance); WellDone = Circ.IsDone(); NbrSol = 1; @@ -332,8 +332,8 @@ Geom2dGcc_Circ2d3Tan:: } } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); - Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_MyC2d3Tan Circ(Qc1,Qc2,Point->Pnt2d(),Param1,Param2,Tolerance); WellDone = Circ.IsDone(); NbrSol = 1; @@ -412,7 +412,7 @@ Geom2dGcc_Circ2d3Tan:: } } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_MyC2d3Tan Circ(Qc1,Point1->Pnt2d(),Point2->Pnt2d(), Param1,Tolerance); WellDone = Circ.IsDone(); diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2dTanCen.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2dTanCen.cxx index 88135971cc..ceaec38c9e 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2dTanCen.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2dTanCen.cxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -84,7 +84,7 @@ Geom2dGcc_Circ2dTanCen:: //============================================================================= else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_MyCirc2dTanCen Circ(Qc1,pcenter,Tolerance); WellDone = Circ.IsDone(); NbrSol = Circ.NbSolutions(); diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRad.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRad.cxx index 48dc2aa675..9ce33a8261 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRad.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRad.cxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -129,7 +129,7 @@ Geom2dGcc_Circ2dTanOnRad:: Results(CircGeo); } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_MyCirc2dTanOnRad CircGeo(Qc1,OnCurve,Radius,Tolerance); WellDone = CircGeo.IsDone(); NbrSol = CircGeo.NbSolutions(); diff --git a/src/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx b/src/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx index 41f01703b1..a34b0e64c2 100644 --- a/src/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx @@ -15,7 +15,7 @@ // commercial license or contractual agreement. #include -#include +#include #include #include #include @@ -74,13 +74,13 @@ Geom2dGcc_Lin2d2Tan:: } } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Standard_Real a1FPar = Geom2dGcc_CurveTool::FirstParameter(C1); Standard_Real a1LPar = Geom2dGcc_CurveTool::LastParameter(C1); Standard_Integer aNbSamples1 = Geom2dGcc_CurveTool::NbSamples(C1); Standard_Real aStep1 = (a1LPar - a1FPar)/aNbSamples1; Standard_Real Param1 = a1FPar; - Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); + Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier()); Standard_Real a2FPar = Geom2dGcc_CurveTool::FirstParameter(C2); Standard_Real a2LPar = Geom2dGcc_CurveTool::LastParameter(C2); Standard_Integer aNbSamples2 = Geom2dGcc_CurveTool::NbSamples(C2); @@ -149,7 +149,7 @@ Geom2dGcc_Lin2d2Tan:: } } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Standard_Real aFirstPar = Geom2dGcc_CurveTool::FirstParameter(C1); Standard_Real aLastPar = Geom2dGcc_CurveTool::LastParameter(C1); Standard_Integer aNbSamples = Geom2dGcc_CurveTool::NbSamples(C1); @@ -224,8 +224,8 @@ Geom2dGcc_Lin2d2Tan:: } } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); - Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_MyL2d2Tan Lin(Qc1,Qc2,Param1,Param2,Tolang); WellDone = Lin.IsDone(); // Modified by Sergey KHROMOV - Thu Apr 5 17:51:59 2001 Begin @@ -283,7 +283,7 @@ Geom2dGcc_Lin2d2Tan:: } } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_MyL2d2Tan Lin(Qc1,ThePoint,Param1,Tolang); WellDone = Lin.IsDone(); // Modified by Sergey KHROMOV - Thu Apr 5 17:53:01 2001 Begin diff --git a/src/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx b/src/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx index 3155d3ee07..2f744e9a4c 100644 --- a/src/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx @@ -15,7 +15,7 @@ // commercial license or contractual agreement. #include -#include +#include #include #include #include @@ -66,7 +66,7 @@ Geom2dGcc_Lin2dTanObl:: } } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Standard_Real aFirstPar = Geom2dGcc_CurveTool::FirstParameter(C1); Standard_Real aLastPar = Geom2dGcc_CurveTool::LastParameter(C1); Standard_Integer aNbSamples = Geom2dGcc_CurveTool::NbSamples(C1); @@ -131,7 +131,7 @@ Geom2dGcc_Lin2dTanObl:: } } else { - Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); + Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_MyL2dTanObl Lin(Qc1,TheLine,TolAng,Param1,Angle); WellDone = Lin.IsDone(); if(WellDone) { diff --git a/src/GccEnt/GccEnt_QualifiedCurv.cdl b/src/Geom2dGcc/Geom2dGcc_QCurve.cdl similarity index 79% rename from src/GccEnt/GccEnt_QualifiedCurv.cdl rename to src/Geom2dGcc/Geom2dGcc_QCurve.cdl index 29ea708251..6975c64c7a 100644 --- a/src/GccEnt/GccEnt_QualifiedCurv.cdl +++ b/src/Geom2dGcc/Geom2dGcc_QCurve.cdl @@ -14,20 +14,21 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -generic class QualifiedCurv from GccEnt (TheCurve as any) +class QCurve from Geom2dGcc ---Purpose: Creates a qualified 2d line. -uses Position from GccEnt +uses Position from GccEnt, + Curve from Geom2dAdaptor is -Create(Curve : TheCurve ; +Create(Curve : Curve from Geom2dAdaptor; Qualifier : Position from GccEnt ) -returns QualifiedCurv from GccEnt; +returns QCurve from Geom2dGcc; -- is private; -Qualified(me) returns TheCurve +Qualified(me) returns Curve from Geom2dAdaptor is static; Qualifier(me) returns Position from GccEnt @@ -56,15 +57,8 @@ is static; fields TheQualifier : Position from GccEnt; -TheQualified : TheCurve; +TheQualified : Curve from Geom2dAdaptor; --- friends - --- Unqualified(Obj : Curv2d) from GccEnt, --- Enclosing (Obj : Curv2d) from GccEnt, --- Enclosed (Obj : Curv2d) from GccEnt, --- Outside (Obj : Curv2d) from GccEnt - -end QualifiedCurv; +end QCurve; diff --git a/src/GccEnt/GccEnt_QualifiedCurv.gxx b/src/Geom2dGcc/Geom2dGcc_QCurve.cxx similarity index 79% rename from src/GccEnt/GccEnt_QualifiedCurv.gxx rename to src/Geom2dGcc/Geom2dGcc_QCurve.cxx index 25b5a41f82..870e0ca057 100644 --- a/src/GccEnt/GccEnt_QualifiedCurv.gxx +++ b/src/Geom2dGcc/Geom2dGcc_QCurve.cxx @@ -12,38 +12,42 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -TheCurve GccEnt_QualifiedCurv:: +#include + +//#include + +Geom2dAdaptor_Curve Geom2dGcc_QCurve:: Qualified () const { return TheQualified; } -GccEnt_Position GccEnt_QualifiedCurv:: +GccEnt_Position Geom2dGcc_QCurve:: Qualifier () const { return TheQualifier; } -Standard_Boolean GccEnt_QualifiedCurv:: +Standard_Boolean Geom2dGcc_QCurve:: IsUnqualified () const { if (TheQualifier == GccEnt_unqualified ) { return Standard_True; } else { return Standard_False; } } -Standard_Boolean GccEnt_QualifiedCurv:: +Standard_Boolean Geom2dGcc_QCurve:: IsEnclosing () const { if (TheQualifier == GccEnt_enclosing) { return Standard_True; } else { return Standard_False; } } -Standard_Boolean GccEnt_QualifiedCurv:: +Standard_Boolean Geom2dGcc_QCurve:: IsEnclosed () const { if (TheQualifier == GccEnt_enclosed) { return Standard_True; } else { return Standard_False; } } -Standard_Boolean GccEnt_QualifiedCurv:: +Standard_Boolean Geom2dGcc_QCurve:: IsOutside () const { if (TheQualifier == GccEnt_outside) { return Standard_True; } else { return Standard_False; } } -GccEnt_QualifiedCurv:: - GccEnt_QualifiedCurv (const TheCurve& Curve, +Geom2dGcc_QCurve:: + Geom2dGcc_QCurve (const Geom2dAdaptor_Curve& Curve, const GccEnt_Position Qualifier) { TheQualified = Curve; TheQualifier = Qualifier; diff --git a/src/Geom2dHatch/Geom2dHatch.cdl b/src/Geom2dHatch/Geom2dHatch.cdl index e24c7c7012..a22abfdc59 100644 --- a/src/Geom2dHatch/Geom2dHatch.cdl +++ b/src/Geom2dHatch/Geom2dHatch.cdl @@ -17,18 +17,38 @@ package Geom2dHatch uses - Geom2dAdaptor , - Geom2dInt , - gp , - HatchGen + Geom2dAdaptor, + Geom2dInt, + gp, + HatchGen, + TCollection, + TColStd, + TopClass, + TopAbs is class Intersector ; - class Hatcher instantiates Hatcher from HatchGen - (Curve from Geom2dAdaptor, - Curve from Geom2dAdaptor, - Intersector from Geom2dHatch) ; + class Hatcher; + + class Element; + class Elements; + class Hatching; + + class Hatchings instantiates DataMap from TCollection + (Integer from Standard, + Hatching from Geom2dHatch, + MapIntegerHasher from TColStd) ; + + class Classifier instantiates FaceClassifier from TopClass + (Elements from Geom2dHatch, + Curve from Geom2dAdaptor, + Intersector from Geom2dHatch); + + private class MapOfElements instantiates DataMap from TCollection + (Integer from Standard, + Element from Geom2dHatch, + MapIntegerHasher from TColStd); end Geom2dHatch ; diff --git a/src/HatchGen/HatchGen_ElementGen.cdl b/src/Geom2dHatch/Geom2dHatch_Element.cdl similarity index 77% rename from src/HatchGen/HatchGen_ElementGen.cdl rename to src/Geom2dHatch/Geom2dHatch_Element.cdl index 3e98bbabf7..9e0ce6cee4 100644 --- a/src/HatchGen/HatchGen_ElementGen.cdl +++ b/src/Geom2dHatch/Geom2dHatch_Element.cdl @@ -14,31 +14,32 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -generic class ElementGen from HatchGen (TheElementCurve as any) +class Element from Geom2dHatch uses - Orientation from TopAbs + Orientation from TopAbs, + Curve from Geom2dAdaptor is Create - returns ElementGen from HatchGen; + returns Element from Geom2dHatch; - Create (Other : ElementGen from HatchGen) + Create (Other : Element from Geom2dHatch) ---Purpose: Magic constructor. - returns ElementGen from HatchGen ; + returns Element from Geom2dHatch ; - Create (Curve : TheElementCurve ; + Create (Curve : Curve from Geom2dAdaptor ; Orientation : Orientation from TopAbs = TopAbs_FORWARD) ---Purpose: Creates an element. - returns ElementGen from HatchGen ; + returns Element from Geom2dHatch ; Curve (me) @@ -47,7 +48,7 @@ is ---C++: return const & - returns TheElementCurve + returns Curve from Geom2dAdaptor is static ; @@ -57,7 +58,7 @@ is ---C++: return & - returns TheElementCurve + returns Curve from Geom2dAdaptor is static ; @@ -78,7 +79,7 @@ is fields - myCurve : TheElementCurve ; + myCurve : Curve from Geom2dAdaptor ; myOrientation : Orientation from TopAbs ; -end ElementGen from HatchGen ; +end Element from Geom2dHatch; diff --git a/src/HatchGen/HatchGen_ElementGen.gxx b/src/Geom2dHatch/Geom2dHatch_Element.cxx similarity index 80% rename from src/HatchGen/HatchGen_ElementGen.gxx rename to src/Geom2dHatch/Geom2dHatch_Element.cxx index 375992988f..a616fc344f 100644 --- a/src/HatchGen/HatchGen_ElementGen.gxx +++ b/src/Geom2dHatch/Geom2dHatch_Element.cxx @@ -15,28 +15,32 @@ // commercial license or contractual agreement. //======================================================================= -// Function : HatchGen_ElementGen +// Function : Geom2dHatch_Element // Purpose : Magic Constructor. //======================================================================= -HatchGen_ElementGen::HatchGen_ElementGen (const HatchGen_ElementGen& Other) +#include + +#include + +Geom2dHatch_Element::Geom2dHatch_Element (const Geom2dHatch_Element& Other) : myCurve(Other.myCurve), myOrientation(Other.myOrientation) { } //======================================================================= -// Function : HatchGen_ElementGen +// Function : Geom2dHatch_Element // Purpose : Empty Constructor. //======================================================================= -HatchGen_ElementGen::HatchGen_ElementGen () { +Geom2dHatch_Element::Geom2dHatch_Element () { } //======================================================================= -// Function : HatchGen_ElementGen +// Function : Geom2dHatch_Element // Purpose : Constructor. //======================================================================= -HatchGen_ElementGen::HatchGen_ElementGen (const TheElementCurve& Curve, +Geom2dHatch_Element::Geom2dHatch_Element (const Geom2dAdaptor_Curve& Curve, const TopAbs_Orientation Orientation) : myCurve (Curve), myOrientation (Orientation) @@ -48,7 +52,7 @@ HatchGen_ElementGen::HatchGen_ElementGen (const TheElementCurve& Curve, // Purpose : Returns the curve associated to the hatching. //======================================================================= -const TheElementCurve& HatchGen_ElementGen::Curve () const +const Geom2dAdaptor_Curve& Geom2dHatch_Element::Curve () const { return myCurve ; } @@ -58,7 +62,7 @@ const TheElementCurve& HatchGen_ElementGen::Curve () const // Purpose : Returns the curve associated to the hatching. //======================================================================= -TheElementCurve& HatchGen_ElementGen::ChangeCurve () +Geom2dAdaptor_Curve& Geom2dHatch_Element::ChangeCurve () { return myCurve ; } @@ -68,7 +72,7 @@ TheElementCurve& HatchGen_ElementGen::ChangeCurve () // Purpose : Sets the orientation of the element. //======================================================================= -void HatchGen_ElementGen::Orientation (const TopAbs_Orientation Orientation) +void Geom2dHatch_Element::Orientation (const TopAbs_Orientation Orientation) { myOrientation = Orientation ; } @@ -78,7 +82,7 @@ void HatchGen_ElementGen::Orientation (const TopAbs_Orientation Orientation) // Purpose : Returns the orientation of the element. //======================================================================= -TopAbs_Orientation HatchGen_ElementGen::Orientation () const +TopAbs_Orientation Geom2dHatch_Element::Orientation () const { return myOrientation ; } diff --git a/src/HatchGen/HatchGen_ElementsGen.cdl b/src/Geom2dHatch/Geom2dHatch_Elements.cdl similarity index 78% rename from src/HatchGen/HatchGen_ElementsGen.cdl rename to src/Geom2dHatch/Geom2dHatch_Elements.cdl index 53ba8c7027..ff66bedee5 100644 --- a/src/HatchGen/HatchGen_ElementsGen.cdl +++ b/src/Geom2dHatch/Geom2dHatch_Elements.cdl @@ -17,37 +17,32 @@ -- Modified by skv - Fri Jul 14 16:46:18 2006 OCC12627 -generic class ElementsGen from HatchGen - (TheKey as any; - TheItem as any; - TheHasher as any; - TheCurve as any) - +class Elements from Geom2dHatch + uses Orientation from TopAbs, Lin2d from gp, - Pnt2d from gp + Pnt2d from gp, + Integer from Standard, + Element from Geom2dHatch, + MapIntegerHasher from TColStd, + Curve from Geom2dAdaptor, + MapOfElements from Geom2dHatch, + DataMapIteratorOfMapOfElements from Geom2dHatch raises DomainError from Standard, NoSuchObject from Standard -private class MapOfElements from HatchGen instantiates - DataMap from TCollection - (TheKey, - TheItem, - TheHasher); - - is Create - returns ElementsGen from HatchGen; + returns Elements from Geom2dHatch; - Create(Other : ElementsGen from HatchGen) - returns ElementsGen from HatchGen; + Create(Other : Elements from Geom2dHatch) + returns Elements from Geom2dHatch; @@ -60,22 +55,22 @@ is ---C++: alias ~ is static; - Bind(me : in out; K : TheKey; I : TheItem) returns Boolean + Bind(me : in out; K : Integer from Standard; I : Element from Geom2dHatch) returns Boolean is static; - IsBound(me; K : TheKey) returns Boolean + IsBound(me; K : Integer from Standard) returns Boolean is static; - UnBind(me : in out; K : TheKey) returns Boolean + UnBind(me : in out; K : Integer from Standard) returns Boolean is static; - Find(me; K : TheKey) returns any TheItem + Find(me; K : Integer from Standard) returns any Element from Geom2dHatch raises NoSuchObject from Standard -- when is not in the map. ---C++: alias operator() ---C++: return const & is static; - ChangeFind(me : in out; K : TheKey) returns any TheItem + ChangeFind(me : in out; K : Integer from Standard) returns any Element from Geom2dHatch raises NoSuchObject from Standard -- when is not in the map. ---C++: alias operator() ---C++: return & @@ -136,17 +131,17 @@ is returns Boolean from Standard is static; - CurrentEdge(me; E : out TheCurve; + CurrentEdge(me; E : out Curve from Geom2dAdaptor; Or : out Orientation from TopAbs) is static; fields - myMap : MapOfElements; + myMap : MapOfElements from Geom2dHatch; Iter : DataMapIteratorOfMapOfElements; NumWire : Integer from Standard; NumEdge : Integer from Standard; myCurEdge: Integer from Standard; -end ElementsGen from HatchGen; +end Elements from Geom2dHatch; diff --git a/src/HatchGen/HatchGen_ElementsGen.gxx b/src/Geom2dHatch/Geom2dHatch_Elements.cxx similarity index 73% rename from src/HatchGen/HatchGen_ElementsGen.gxx rename to src/Geom2dHatch/Geom2dHatch_Elements.cxx index 4cc90382dd..07d53da4a0 100644 --- a/src/HatchGen/HatchGen_ElementsGen.gxx +++ b/src/Geom2dHatch/Geom2dHatch_Elements.cxx @@ -16,42 +16,56 @@ // Modified by skv - Fri Jul 14 17:03:47 2006 OCC12627 +#include + +#include +#include +#include +#include + #include #include #include -//HatchGen_ElementsGen::HatchGen_ElementsGen(const HatchGen_ElementsGen& Other) { -HatchGen_ElementsGen::HatchGen_ElementsGen(const HatchGen_ElementsGen& ) { - cout<<" Magic Constructor in HatchGen_ElementsGen:: "<ChangeFind(Itertemp.Key()); - TheCurve& E = Item.ChangeCurve(); + Geom2dHatch_Element& Item=((Geom2dHatch_MapOfElements*)ptrmyMap)->ChangeFind(Itertemp.Key()); + Geom2dAdaptor_Curve& E = Item.ChangeCurve(); TopAbs_Orientation Or= Item.Orientation(); gp_Pnt2d P2 = E.Value ((E.FirstParameter() + E.LastParameter()) *0.5); @@ -128,7 +142,7 @@ Standard_Boolean HatchGen_ElementsGen::OtherSegment(const gp_Pnt2d& P, //purpose : //======================================================================= -void HatchGen_ElementsGen::InitWires() { +void Geom2dHatch_Elements::InitWires() { NumWire = 0; } @@ -137,7 +151,7 @@ void HatchGen_ElementsGen::InitWires() { //purpose : //======================================================================= -Standard_Boolean HatchGen_ElementsGen::RejectWire(const gp_Lin2d& , +Standard_Boolean Geom2dHatch_Elements::RejectWire(const gp_Lin2d& , const Standard_Real) const { return Standard_False; @@ -148,7 +162,7 @@ Standard_Boolean HatchGen_ElementsGen::RejectWire(const gp_Lin2d& , //purpose : //======================================================================= -void HatchGen_ElementsGen::InitEdges() { +void Geom2dHatch_Elements::InitEdges() { NumEdge = 0; Iter.Initialize(myMap); } @@ -158,7 +172,7 @@ void HatchGen_ElementsGen::InitEdges() { //purpose : //======================================================================= -Standard_Boolean HatchGen_ElementsGen::RejectEdge(const gp_Lin2d& , +Standard_Boolean Geom2dHatch_Elements::RejectEdge(const gp_Lin2d& , const Standard_Real ) const { return Standard_False; @@ -170,11 +184,11 @@ Standard_Boolean HatchGen_ElementsGen::RejectEdge(const gp_Lin2d& , //purpose : //======================================================================= -void HatchGen_ElementsGen::CurrentEdge(TheCurve& E, +void Geom2dHatch_Elements::CurrentEdge(Geom2dAdaptor_Curve& E, TopAbs_Orientation& Or) const { void *ptrmyMap = (void *)(&myMap); - TheItem& Item=((HatchGen_MapOfElements*)ptrmyMap)->ChangeFind(Iter.Key()); + Geom2dHatch_Element& Item=((Geom2dHatch_MapOfElements*)ptrmyMap)->ChangeFind(Iter.Key()); E = Item.ChangeCurve(); Or= Item.Orientation(); @@ -191,7 +205,7 @@ void HatchGen_ElementsGen::CurrentEdge(TheCurve& E, //purpose : //======================================================================= -Standard_Boolean HatchGen_ElementsGen::MoreWires() const +Standard_Boolean Geom2dHatch_Elements::MoreWires() const { return (NumWire == 0); } @@ -201,7 +215,7 @@ Standard_Boolean HatchGen_ElementsGen::MoreWires() const //purpose : //======================================================================= -void HatchGen_ElementsGen::NextWire() { +void Geom2dHatch_Elements::NextWire() { NumWire++; } @@ -210,7 +224,7 @@ void HatchGen_ElementsGen::NextWire() { //purpose : //======================================================================= -Standard_Boolean HatchGen_ElementsGen::MoreEdges() const { +Standard_Boolean Geom2dHatch_Elements::MoreEdges() const { return(Iter.More()); } @@ -219,7 +233,7 @@ Standard_Boolean HatchGen_ElementsGen::MoreEdges() const { //purpose : //======================================================================= -void HatchGen_ElementsGen::NextEdge() { +void Geom2dHatch_Elements::NextEdge() { Iter.Next(); } diff --git a/src/HatchGen/HatchGen_Hatcher.cdl b/src/Geom2dHatch/Geom2dHatch_Hatcher.cdl similarity index 83% rename from src/HatchGen/HatchGen_Hatcher.cdl rename to src/Geom2dHatch/Geom2dHatch_Hatcher.cdl index 52f68c39a5..b12435fc5b 100644 --- a/src/HatchGen/HatchGen_Hatcher.cdl +++ b/src/Geom2dHatch/Geom2dHatch_Hatcher.cdl @@ -14,50 +14,28 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -generic class Hatcher from HatchGen - (TheCurveE as any ; -- as Curve from Geom2dAdaptor - TheCurveH as any ; -- as Curve from Geom2dAdaptor - TheIntersector as any ) -- as Intersector from HatchGen +class Hatcher from Geom2dHatch uses - MapIntegerHasher from TColStd , - PointOnHatching from HatchGen , - Orientation from TopAbs , - State from TopAbs , - Domain from HatchGen , - ErrorStatus from HatchGen + MapIntegerHasher from TColStd, + PointOnHatching from HatchGen, + Orientation from TopAbs, + State from TopAbs, + Domain from HatchGen, + ErrorStatus from HatchGen, + Curve from Geom2dAdaptor, + Intersector from Geom2dHatch, + Element from Geom2dHatch, + Elements from Geom2dHatch, + Hatching from Geom2dHatch, + Hatchings from Geom2dHatch, + Classifier from Geom2dHatch raises NoSuchObject from Standard , OutOfRange from Standard , NotDone from StdFail - ----------------------------------------------------------------------- --- Nested classes descriptions. ----------------------------------------------------------------------- - -class Element from HatchGen instantiates ElementGen from HatchGen - (TheCurveE) ; -class Elements from HatchGen instantiates ElementsGen from HatchGen - (Integer from Standard, - Element from HatchGen, - MapIntegerHasher from TColStd , - TheCurveE ) ; - -class Hatching from HatchGen instantiates HatchingGen from HatchGen - (TheCurveH) ; - -class Hatchings from HatchGen instantiates DataMap from TCollection - (Integer from Standard, - Hatching from HatchGen, - MapIntegerHasher from TColStd) ; - -class Classifier from HatchGen instantiates FaceClassifier from TopClass - (Elements, - TheCurveE, - TheIntersector); - ---------------------------------------------------------------------- -- class Hatcher description. ---------------------------------------------------------------------- @@ -67,7 +45,7 @@ is ---Category: General use - Create (Intersector : TheIntersector ; + Create (Intersector : Intersector from Geom2dHatch ; Confusion2d : Real from Standard ; Confusion3d : Real from Standard ; KeepPnt : Boolean from Standard = Standard_False ; @@ -75,10 +53,10 @@ is ---Purpose: Returns an empty hatcher. - returns Hatcher from HatchGen ; + returns Hatcher from Geom2dHatch; - Intersector (me : in out ; Intersector : TheIntersector) + Intersector (me : in out ; Intersector : Intersector from Geom2dHatch) ---Purpose: Sets the associated intersector. is static ; @@ -91,7 +69,7 @@ is ---C++: inline ---C++: return const & - returns TheIntersector + returns Intersector from Geom2dHatch is static ; @@ -102,7 +80,7 @@ is ---C++: inline ---C++: return & - returns TheIntersector + returns Intersector from Geom2dHatch is static ; @@ -194,7 +172,7 @@ is ---C++: inline ---C++: return & - returns Element from HatchGen + returns Element from Geom2dHatch raises NoSuchObject from Standard is static protected ; @@ -208,12 +186,12 @@ is ---C++: inline ---C++: return const & - returns TheCurveE + returns Curve from Geom2dAdaptor raises NoSuchObject from Standard is static ; - AddElement (me : in out ; Curve : TheCurveE ; + AddElement (me : in out ; Curve : Curve from Geom2dAdaptor ; Orientation : Orientation from TopAbs = TopAbs_FORWARD) ---Purpose: Adds an element to the hatcher and returns its index. @@ -255,7 +233,7 @@ is ---C++: inline ---C++: return & - returns Hatching from HatchGen + returns Hatching from Geom2dHatch raises NoSuchObject from Standard is static protected ; @@ -269,12 +247,12 @@ is ---C++: inline ---C++: return const & - returns TheCurveH + returns Curve from Geom2dAdaptor raises NoSuchObject from Standard is static ; - AddHatching (me : in out ; Curve : TheCurveH) + AddHatching (me : in out ; Curve : Curve from Geom2dAdaptor) ---Purpose: Adds a hatching to the hatcher and returns its index. @@ -342,7 +320,7 @@ is is static ; - Trim (me : in out ; Curve : TheCurveH) + Trim (me : in out ; Curve : Curve from Geom2dAdaptor) ---Purpose: Adds a hatching to the hatcher and trims it by -- the elements already given and returns its index. @@ -500,14 +478,14 @@ is fields - myIntersector : TheIntersector ; + myIntersector : Intersector from Geom2dHatch; myConfusion2d : Real from Standard ; myConfusion3d : Real from Standard ; myKeepPoints : Boolean from Standard ; myKeepSegments : Boolean from Standard ; myNbElements : Integer from Standard ; - myElements : Elements from HatchGen ; + myElements : Elements from Geom2dHatch ; myNbHatchings : Integer from Standard ; - myHatchings : Hatchings from HatchGen ; + myHatchings : Hatchings from Geom2dHatch; -end Hatcher from HatchGen ; +end Hatcher from Geom2dHatch; diff --git a/src/HatchGen/HatchGen_Hatcher.gxx b/src/Geom2dHatch/Geom2dHatch_Hatcher.cxx similarity index 93% rename from src/HatchGen/HatchGen_Hatcher.gxx rename to src/Geom2dHatch/Geom2dHatch_Hatcher.cxx index b8f871b48b..0ff83b0c61 100644 --- a/src/HatchGen/HatchGen_Hatcher.gxx +++ b/src/Geom2dHatch/Geom2dHatch_Hatcher.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -25,6 +27,10 @@ #include #include +#include +#include +#include + #define RAISE_IF_NOSUCHOBJECT 0 #define TRACE_HATCHER 0 @@ -35,11 +41,11 @@ //======================================================================= //======================================================================= -// Function : HatchGen_Hatcher +// Function : Geom2dHatch_Hatcher // Purpose : Constructor. //======================================================================= -HatchGen_Hatcher::HatchGen_Hatcher (const TheIntersector& Intersector, +Geom2dHatch_Hatcher::Geom2dHatch_Hatcher (const Geom2dHatch_Intersector& Intersector, const Standard_Real Confusion2d, const Standard_Real Confusion3d, const Standard_Boolean KeepPnt, @@ -59,12 +65,12 @@ HatchGen_Hatcher::HatchGen_Hatcher (const TheIntersector& Intersector, // Purpose : Sets the associated intersector. //======================================================================= -void HatchGen_Hatcher::Intersector (const TheIntersector& Intersector) +void Geom2dHatch_Hatcher::Intersector (const Geom2dHatch_Intersector& Intersector) { myIntersector = Intersector ; for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { if (myHatchings.IsBound (IndH)) { - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrPoints() ; } } @@ -76,12 +82,12 @@ void HatchGen_Hatcher::Intersector (const TheIntersector& Intersector) // Purpose : Sets the 2dconfusion tolerance. //======================================================================= -void HatchGen_Hatcher::Confusion2d (const Standard_Real Confusion) +void Geom2dHatch_Hatcher::Confusion2d (const Standard_Real Confusion) { myConfusion2d = Confusion ; for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { if (myHatchings.IsBound (IndH)) { - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrPoints() ; } } @@ -93,12 +99,12 @@ void HatchGen_Hatcher::Confusion2d (const Standard_Real Confusion) // Purpose : Sets the 3d confusion tolerance. //======================================================================= -void HatchGen_Hatcher::Confusion3d (const Standard_Real Confusion) +void Geom2dHatch_Hatcher::Confusion3d (const Standard_Real Confusion) { myConfusion3d = Confusion ; for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { if (myHatchings.IsBound (IndH)) { - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrPoints() ; } } @@ -109,12 +115,12 @@ void HatchGen_Hatcher::Confusion3d (const Standard_Real Confusion) // Purpose : Sets the above flag. //======================================================================= -void HatchGen_Hatcher::KeepPoints (const Standard_Boolean Keep) +void Geom2dHatch_Hatcher::KeepPoints (const Standard_Boolean Keep) { myKeepPoints = Keep ; for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { if (myHatchings.IsBound (IndH)) { - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrDomains() ; } } @@ -126,12 +132,12 @@ void HatchGen_Hatcher::KeepPoints (const Standard_Boolean Keep) // Purpose : Sets the above flag. //======================================================================= -void HatchGen_Hatcher::KeepSegments (const Standard_Boolean Keep) +void Geom2dHatch_Hatcher::KeepSegments (const Standard_Boolean Keep) { myKeepSegments = Keep ; for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { if (myHatchings.IsBound (IndH)) { - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrDomains() ; } } @@ -151,7 +157,7 @@ void HatchGen_Hatcher::KeepSegments (const Standard_Boolean Keep) // Purpose : Adds an element to the Hatcher and returns its index. //======================================================================= -Standard_Integer HatchGen_Hatcher::AddElement (const TheCurveE& Curve, +Standard_Integer Geom2dHatch_Hatcher::AddElement (const Geom2dAdaptor_Curve& Curve, const TopAbs_Orientation Orientation) { Standard_Integer IndE ; @@ -160,11 +166,11 @@ Standard_Integer HatchGen_Hatcher::AddElement (const TheCurveE& Curve, myNbElements++ ; IndE = myNbElements ; } - HatchGen_Element Element (Curve, Orientation) ; + Geom2dHatch_Element Element (Curve, Orientation) ; myElements.Bind (IndE, Element) ; for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings; IndH++) { if (myHatchings.IsBound(IndH)) { - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrPoints () ; } } @@ -176,14 +182,14 @@ Standard_Integer HatchGen_Hatcher::AddElement (const TheCurveE& Curve, // Purpose : Removes the IndE-th element from the hatcher. //======================================================================= -void HatchGen_Hatcher::RemElement (const Standard_Integer IndE) +void Geom2dHatch_Hatcher::RemElement (const Standard_Integer IndE) { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ; #endif for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { if (myHatchings.IsBound (IndH)) { - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Standard_Boolean DomainsToClear = Standard_False ; for (Standard_Integer IPntH = Hatching.NbPoints() ; IPntH > 0 ; IPntH--) { HatchGen_PointOnHatching PntH = Hatching.ChangePoint (IPntH) ; @@ -207,13 +213,13 @@ void HatchGen_Hatcher::RemElement (const Standard_Integer IndE) // Purpose : Removes all the elements from the hatcher. //======================================================================= -void HatchGen_Hatcher::ClrElements () +void Geom2dHatch_Hatcher::ClrElements () { if (myNbElements != 0) { if (myNbHatchings != 0) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { if (myHatchings.IsBound(IndH)) { - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrPoints() ; } } @@ -235,7 +241,7 @@ void HatchGen_Hatcher::ClrElements () // Purpose : Adds a hatching to the hatcher and returns its index. //======================================================================= -Standard_Integer HatchGen_Hatcher::AddHatching (const TheCurveH& Curve) +Standard_Integer Geom2dHatch_Hatcher::AddHatching (const Geom2dAdaptor_Curve& Curve) { Standard_Integer IndH ; for (IndH = 1 ; IndH <= myNbHatchings && myHatchings.IsBound(IndH) ; IndH++) ; @@ -243,7 +249,7 @@ Standard_Integer HatchGen_Hatcher::AddHatching (const TheCurveH& Curve) myNbHatchings++ ; IndH = myNbHatchings ; } - HatchGen_Hatching Hatching (Curve) ; + Geom2dHatch_Hatching Hatching (Curve) ; myHatchings.Bind (IndH, Hatching) ; return IndH ; } @@ -253,12 +259,12 @@ Standard_Integer HatchGen_Hatcher::AddHatching (const TheCurveH& Curve) // Purpose : Removes the IndH-th hatching from the hatcher. //======================================================================= -void HatchGen_Hatcher::RemHatching (const Standard_Integer IndH) +void Geom2dHatch_Hatcher::RemHatching (const Standard_Integer IndH) { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrPoints() ; myHatchings.UnBind (IndH) ; if (IndH == myNbHatchings) myNbHatchings-- ; @@ -269,12 +275,12 @@ void HatchGen_Hatcher::RemHatching (const Standard_Integer IndH) // Purpose : Removes all the hatchings from the hatcher. //======================================================================= -void HatchGen_Hatcher::ClrHatchings () +void Geom2dHatch_Hatcher::ClrHatchings () { if (myNbHatchings != 0) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { if (myHatchings.IsBound(IndH)) { - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrPoints() ; } } @@ -297,7 +303,7 @@ void HatchGen_Hatcher::ClrHatchings () // of the hatcher. //======================================================================= -void HatchGen_Hatcher::Trim () +void Geom2dHatch_Hatcher::Trim () { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) if (myHatchings.IsBound (IndH)) @@ -310,7 +316,7 @@ void HatchGen_Hatcher::Trim () // already given and returns its index. //======================================================================= -Standard_Integer HatchGen_Hatcher::Trim (const TheCurveH& Curve) +Standard_Integer Geom2dHatch_Hatcher::Trim (const Geom2dAdaptor_Curve& Curve) { Standard_Integer IndH = AddHatching (Curve) ; Trim (IndH) ; @@ -322,13 +328,13 @@ Standard_Integer HatchGen_Hatcher::Trim (const TheCurveH& Curve) // Purpose : Trims the IndH-th hatching by the elements already given. //======================================================================= -void HatchGen_Hatcher::Trim (const Standard_Integer IndH) +void Geom2dHatch_Hatcher::Trim (const Standard_Integer IndH) { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrPoints() ; @@ -431,7 +437,7 @@ static void IntersectionPointDump (const IntRes2d_IntersectionPoint& Pnt, // element. //======================================================================= -Standard_Boolean HatchGen_Hatcher::Trim (const Standard_Integer IndH, +Standard_Boolean Geom2dHatch_Hatcher::Trim (const Standard_Integer IndH, const Standard_Integer IndE) { #if RAISE_IF_NOSUCHOBJECT @@ -439,11 +445,11 @@ Standard_Boolean HatchGen_Hatcher::Trim (const Standard_Integer IndH, Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ; #endif - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; - HatchGen_Element& Element = myElements.ChangeFind (IndE) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Element& Element = myElements.ChangeFind (IndE) ; - TheCurveH hatching = Hatching.ChangeCurve() ; - TheCurveE element = Element.ChangeCurve() ; + Geom2dAdaptor_Curve hatching = Hatching.ChangeCurve() ; + Geom2dAdaptor_Curve element = Element.ChangeCurve() ; myIntersector.Intersect (hatching, element) ; @@ -728,7 +734,7 @@ Standard_Boolean HatchGen_Hatcher::Trim (const Standard_Integer IndH, // IndH-th hatching. //======================================================================= -Standard_Boolean HatchGen_Hatcher::GlobalTransition (HatchGen_PointOnHatching& Point) +Standard_Boolean Geom2dHatch_Hatcher::GlobalTransition (HatchGen_PointOnHatching& Point) { TopAbs_State StateBefore = TopAbs_UNKNOWN ; TopAbs_State StateAfter = TopAbs_UNKNOWN ; @@ -739,7 +745,7 @@ Standard_Boolean HatchGen_Hatcher::GlobalTransition (HatchGen_PointOnHatching& P gp_Dir Tangente, Normale ; Standard_Real Courbure ; - const TheCurveH& CurveH = HatchingCurve (Point.Index()) ; + const Geom2dAdaptor_Curve& CurveH = HatchingCurve (Point.Index()) ; myIntersector.LocalGeometry(CurveH.Curve(), Point.Parameter(), Tangente2d, Normale2d, Courbure); @@ -765,8 +771,8 @@ Standard_Boolean HatchGen_Hatcher::GlobalTransition (HatchGen_PointOnHatching& P SegmentBegin = SegmentBegin || PntE.SegmentBeginning() ; SegmentEnd = SegmentEnd || PntE.SegmentEnd() ; - const HatchGen_Element& Element = myElements.Find (PntE.Index()) ; - const TheCurveE& CurveE = Element.Curve() ; + const Geom2dHatch_Element& Element = myElements.Find (PntE.Index()) ; + const Geom2dAdaptor_Curve& CurveE = Element.Curve() ; TopAbs_Orientation ElementOrientation = Element.Orientation() ; Standard_Boolean ToReverse = (ElementOrientation == TopAbs_REVERSED); @@ -923,7 +929,7 @@ Standard_Boolean HatchGen_Hatcher::GlobalTransition (HatchGen_PointOnHatching& P // Purpose : Computes the domains of all the hatchings. //======================================================================= -void HatchGen_Hatcher::ComputeDomains () +void Geom2dHatch_Hatcher::ComputeDomains () { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) if (myHatchings.IsBound (IndH)) ComputeDomains (IndH) ; @@ -934,13 +940,13 @@ void HatchGen_Hatcher::ComputeDomains () // Purpose : Computes the domains of the IndH-th hatching. //======================================================================= -void HatchGen_Hatcher::ComputeDomains (const Standard_Integer IndH) +void Geom2dHatch_Hatcher::ComputeDomains (const Standard_Integer IndH) { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Hatching.ClrDomains() ; Hatching.IsDone (Standard_False) ; @@ -958,7 +964,7 @@ void HatchGen_Hatcher::ComputeDomains (const Standard_Integer IndH) if (NbPnt == 0) { //-- cout << "The hatching # " << setw(3) << IndH << " has to be classified" << endl ; - HatchGen_Classifier Classifier(myElements,Hatching.ClassificationPoint(),0.0000001); + Geom2dHatch_Classifier Classifier(myElements,Hatching.ClassificationPoint(),0.0000001); if(Classifier.State() == TopAbs_IN) { HatchGen_Domain domain ; Hatching.AddDomain (domain) ; @@ -1396,14 +1402,14 @@ void HatchGen_Hatcher::ComputeDomains (const Standard_Integer IndH) // Purpose : Returns the IDom-th domain of the IndH-th hatching. //======================================================================= -const HatchGen_Domain& HatchGen_Hatcher::Domain (const Standard_Integer IndH, +const HatchGen_Domain& Geom2dHatch_Hatcher::Domain (const Standard_Integer IndH, const Standard_Integer IDom) const { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; - StdFail_NotDone_Raise_if (!Hatching.IsDone(), "HatchGen_Hatcher::Domain") ; + const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ; + StdFail_NotDone_Raise_if (!Hatching.IsDone(), "Geom2dHatch_Hatcher::Domain") ; #if RAISE_IF_NOSUCHOBJECT Standard_OutOfRange_Raise_if (IDom < 1 || IDom > Hatching.NbDomains(), "") ; #endif @@ -1422,7 +1428,7 @@ const HatchGen_Domain& HatchGen_Hatcher::Domain (const Standard_Integer IndH, // Purpose : Dumps the hatcher. //======================================================================= -void HatchGen_Hatcher::Dump () const +void Geom2dHatch_Hatcher::Dump () const { cout << endl ; cout << "========================================================" << endl ; @@ -1461,7 +1467,7 @@ void HatchGen_Hatcher::Dump () const if (!myHatchings.IsBound (IndH)) { cout << " is not bound" << endl ; } else { - const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; + const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ; Standard_Integer NbPnt = Hatching.NbPoints() ; cout << " contains " << NbPnt << " restriction points :" << endl ; for (Standard_Integer IPnt = 1 ; IPnt <= NbPnt ; IPnt++) { @@ -1483,7 +1489,7 @@ void HatchGen_Hatcher::Dump () const if (!myElements.IsBound (IndE)) { cout << " is not bound" << endl ; } else { - const HatchGen_Element& Element = myElements.Find (IndE) ; + const Geom2dHatch_Element& Element = myElements.Find (IndE) ; switch (Element.Orientation()) { case TopAbs_FORWARD : cout << " is FORWARD" << endl ; break ; case TopAbs_REVERSED : cout << " is REVERSED" << endl ; break ; diff --git a/src/HatchGen/HatchGen_Hatcher.lxx b/src/Geom2dHatch/Geom2dHatch_Hatcher.lxx similarity index 75% rename from src/HatchGen/HatchGen_Hatcher.lxx rename to src/Geom2dHatch/Geom2dHatch_Hatcher.lxx index e0b4074ef7..51773dd57d 100644 --- a/src/HatchGen/HatchGen_Hatcher.lxx +++ b/src/Geom2dHatch/Geom2dHatch_Hatcher.lxx @@ -19,17 +19,17 @@ #include -#include HatchGen_Element_hxx -#include HatchGen_Elements_hxx -#include TheIntersector_hxx -#include TheCurveE_hxx -#include HatchGen_Hatching_hxx +#include +#include +#include +#include + //======================================================================= // Function : Intersector // Purpose : Returns the associated intersector. //======================================================================= -inline const TheIntersector& HatchGen_Hatcher::Intersector () +inline const Geom2dHatch_Intersector& Geom2dHatch_Hatcher::Intersector () { return myIntersector ; } @@ -39,7 +39,7 @@ inline const TheIntersector& HatchGen_Hatcher::Intersector () // Purpose : Returns the associated intersector. //======================================================================= -inline TheIntersector& HatchGen_Hatcher::ChangeIntersector () +inline Geom2dHatch_Intersector& Geom2dHatch_Hatcher::ChangeIntersector () { return myIntersector ; } @@ -49,7 +49,7 @@ inline TheIntersector& HatchGen_Hatcher::ChangeIntersector () // Purpose : Returns the 2d confusion tolerance. //======================================================================= -inline Standard_Real HatchGen_Hatcher::Confusion2d () const +inline Standard_Real Geom2dHatch_Hatcher::Confusion2d () const { return myConfusion2d ; } @@ -59,7 +59,7 @@ inline Standard_Real HatchGen_Hatcher::Confusion2d () const // Purpose : Returns the 3d confusion tolerance. //======================================================================= -inline Standard_Real HatchGen_Hatcher::Confusion3d () const +inline Standard_Real Geom2dHatch_Hatcher::Confusion3d () const { return myConfusion3d ; } @@ -69,7 +69,7 @@ inline Standard_Real HatchGen_Hatcher::Confusion3d () const // Purpose : Returns the flag about the points consideration. //======================================================================= -inline Standard_Boolean HatchGen_Hatcher::KeepPoints () const +inline Standard_Boolean Geom2dHatch_Hatcher::KeepPoints () const { return myKeepPoints ; } @@ -79,7 +79,7 @@ inline Standard_Boolean HatchGen_Hatcher::KeepPoints () const // Purpose : Returns the flag about the segments consideration. //======================================================================= -inline Standard_Boolean HatchGen_Hatcher::KeepSegments () const +inline Standard_Boolean Geom2dHatch_Hatcher::KeepSegments () const { return myKeepSegments ; } @@ -89,7 +89,7 @@ inline Standard_Boolean HatchGen_Hatcher::KeepSegments () const // Purpose : Removes all the hatchings and all the elements. //======================================================================= -inline void HatchGen_Hatcher::Clear () +inline void Geom2dHatch_Hatcher::Clear () { if (myNbHatchings != 0) ClrHatchings () ; if (myNbElements != 0) ClrElements () ; @@ -100,12 +100,12 @@ inline void HatchGen_Hatcher::Clear () // Purpose : Returns the IndE-th element. //======================================================================= -inline HatchGen_Element& HatchGen_Hatcher::Element (const Standard_Integer IndE) +inline Geom2dHatch_Element& Geom2dHatch_Hatcher::Element (const Standard_Integer IndE) { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ; #endif - HatchGen_Element& Element = myElements.ChangeFind (IndE) ; + Geom2dHatch_Element& Element = myElements.ChangeFind (IndE) ; return Element ; } @@ -114,12 +114,12 @@ inline HatchGen_Element& HatchGen_Hatcher::Element (const Standard_Integer IndE) // Purpose : Returns the curve associated to the IndE-th element. //======================================================================= -inline const TheCurveE& HatchGen_Hatcher::ElementCurve (const Standard_Integer IndE) const +inline const Geom2dAdaptor_Curve& Geom2dHatch_Hatcher::ElementCurve (const Standard_Integer IndE) const { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ; #endif - const HatchGen_Element& Element = myElements.Find (IndE) ; + const Geom2dHatch_Element& Element = myElements.Find (IndE) ; return Element.Curve() ; } @@ -129,12 +129,12 @@ inline const TheCurveE& HatchGen_Hatcher::ElementCurve (const Standard_Integer I // Purpose : Returns the IndH-th hatching. //======================================================================= -inline HatchGen_Hatching& HatchGen_Hatcher::Hatching (const Standard_Integer IndH) +inline Geom2dHatch_Hatching& Geom2dHatch_Hatcher::Hatching (const Standard_Integer IndH) { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; + Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; return Hatching ; } @@ -143,12 +143,12 @@ inline HatchGen_Hatching& HatchGen_Hatcher::Hatching (const Standard_Integer Ind // Purpose : Returns the curve associated to the IndH-th hatching. //======================================================================= -inline const TheCurveH& HatchGen_Hatcher::HatchingCurve (const Standard_Integer IndH) const +inline const Geom2dAdaptor_Curve& Geom2dHatch_Hatcher::HatchingCurve (const Standard_Integer IndH) const { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; + const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ; return Hatching.Curve() ; } @@ -158,12 +158,12 @@ inline const TheCurveH& HatchGen_Hatcher::HatchingCurve (const Standard_Integer // hatching. //======================================================================= -inline Standard_Integer HatchGen_Hatcher::NbPoints (const Standard_Integer IndH) const +inline Standard_Integer Geom2dHatch_Hatcher::NbPoints (const Standard_Integer IndH) const { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; + const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ; return Hatching.NbPoints() ; } @@ -173,13 +173,13 @@ inline Standard_Integer HatchGen_Hatcher::NbPoints (const Standard_Integer IndH) // hatching. //======================================================================= -inline const HatchGen_PointOnHatching& HatchGen_Hatcher::Point (const Standard_Integer IndH, +inline const HatchGen_PointOnHatching& Geom2dHatch_Hatcher::Point (const Standard_Integer IndH, const Standard_Integer IndP) const { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; + const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ; #if RAISE_IF_NOSUCHOBJECT Standard_OutOfRange_Raise_if (IndP < 0 || IndP > Hatching.NbPoints(), "") ; #endif @@ -193,12 +193,12 @@ inline const HatchGen_PointOnHatching& HatchGen_Hatcher::Point (const Standard_I // for the IndH-th hatching. //======================================================================= -inline Standard_Boolean HatchGen_Hatcher::TrimDone (const Standard_Integer IndH) const +inline Standard_Boolean Geom2dHatch_Hatcher::TrimDone (const Standard_Integer IndH) const { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; + const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ; return Hatching.TrimDone() ; } //======================================================================= @@ -207,12 +207,12 @@ inline Standard_Boolean HatchGen_Hatcher::TrimDone (const Standard_Integer IndH) // for the IndH-th hatching. //======================================================================= -inline Standard_Boolean HatchGen_Hatcher::TrimFailed (const Standard_Integer IndH) const +inline Standard_Boolean Geom2dHatch_Hatcher::TrimFailed (const Standard_Integer IndH) const { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; + const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ; return Hatching.TrimFailed() ; } @@ -222,12 +222,12 @@ inline Standard_Boolean HatchGen_Hatcher::TrimFailed (const Standard_Integer Ind // for the IndH-th hatching. //======================================================================= -inline Standard_Boolean HatchGen_Hatcher::IsDone (const Standard_Integer IndH) const +inline Standard_Boolean Geom2dHatch_Hatcher::IsDone (const Standard_Integer IndH) const { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; + const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ; return Hatching.IsDone() ; } //======================================================================= @@ -235,12 +235,12 @@ inline Standard_Boolean HatchGen_Hatcher::IsDone (const Standard_Integer IndH) c // Purpose : Returns the status about the IndH-th hatching. //======================================================================= -inline HatchGen_ErrorStatus HatchGen_Hatcher::Status (const Standard_Integer IndH) const +inline HatchGen_ErrorStatus Geom2dHatch_Hatcher::Status (const Standard_Integer IndH) const { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; + const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ; return Hatching.Status() ; } //======================================================================= @@ -248,13 +248,13 @@ inline HatchGen_ErrorStatus HatchGen_Hatcher::Status (const Standard_Integer Ind // Purpose : Returns the number of domains of the IndH-th hatching. //======================================================================= -inline Standard_Integer HatchGen_Hatcher::NbDomains (const Standard_Integer IndH) const +inline Standard_Integer Geom2dHatch_Hatcher::NbDomains (const Standard_Integer IndH) const { #if RAISE_IF_NOSUCHOBJECT Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; #endif - const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; - StdFail_NotDone_Raise_if (!Hatching.IsDone(), "HatchGen_Hatcher::NbDomains") ; + const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ; + StdFail_NotDone_Raise_if (!Hatching.IsDone(), "Geom2dHatch_Hatcher::NbDomains") ; return Hatching.NbDomains() ; } diff --git a/src/HatchGen/HatchGen_HatchingGen.cdl b/src/Geom2dHatch/Geom2dHatch_Hatching.cdl similarity index 93% rename from src/HatchGen/HatchGen_HatchingGen.cdl rename to src/Geom2dHatch/Geom2dHatch_Hatching.cdl index ecb23d9b54..4827702f80 100644 --- a/src/HatchGen/HatchGen_HatchingGen.cdl +++ b/src/Geom2dHatch/Geom2dHatch_Hatching.cdl @@ -14,7 +14,7 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -generic class HatchingGen from HatchGen (TheHatchingCurve as any) +class Hatching from Geom2dHatch uses ErrorStatus from HatchGen , @@ -22,7 +22,8 @@ uses PointsOnHatching from HatchGen , Domain from HatchGen , Domains from HatchGen , - Pnt2d from gp + Pnt2d from gp, + Curve from Geom2dAdaptor raises OutOfRange from Standard @@ -31,14 +32,14 @@ is Create - returns HatchingGen from HatchGen; + returns Hatching from Geom2dHatch; - Create (Curve : TheHatchingCurve) + Create (Curve : Curve from Geom2dAdaptor) ---Purpose: Creates a hatching. - returns HatchingGen from HatchGen ; + returns Hatching from Geom2dHatch ; Curve (me) @@ -47,7 +48,7 @@ is ---C++: return const & - returns TheHatchingCurve + returns Curve from Geom2dAdaptor is static ; @@ -57,7 +58,7 @@ is ---C++: return & - returns TheHatchingCurve + returns Curve from Geom2dAdaptor is static ; @@ -245,7 +246,7 @@ is fields - myCurve : TheHatchingCurve ; + myCurve : Curve from Geom2dAdaptor ; myTrimDone : Boolean from Standard ; myTrimFailed : Boolean from Standard ; myPoints : PointsOnHatching from HatchGen ; @@ -253,4 +254,4 @@ fields myStatus : ErrorStatus from HatchGen ; myDomains : Domains from HatchGen ; -end HatchingGen from HatchGen ; +end Hatching from Geom2dHatch ; diff --git a/src/HatchGen/HatchGen_HatchingGen.gxx b/src/Geom2dHatch/Geom2dHatch_Hatching.cxx similarity index 86% rename from src/HatchGen/HatchGen_HatchingGen.gxx rename to src/Geom2dHatch/Geom2dHatch_Hatching.cxx index 2b02a733df..1c55ea3c69 100644 --- a/src/HatchGen/HatchGen_HatchingGen.gxx +++ b/src/Geom2dHatch/Geom2dHatch_Hatching.cxx @@ -14,25 +14,28 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include +#include #define RAISE_IF_NOSUCHOBJECT 0 #include //======================================================================= -// Function : HatchGen_HatchingGen +// Function : Geom2dHatch_Hatching // Purpose : Constructor. //======================================================================= -HatchGen_HatchingGen::HatchGen_HatchingGen () { +Geom2dHatch_Hatching::Geom2dHatch_Hatching () { } //======================================================================= -// Function : HatchGen_HatchingGen +// Function : Geom2dHatch_Hatching // Purpose : Constructor. //======================================================================= -HatchGen_HatchingGen::HatchGen_HatchingGen (const TheHatchingCurve& Curve) : +Geom2dHatch_Hatching::Geom2dHatch_Hatching (const Geom2dAdaptor_Curve& Curve) : myCurve (Curve), myTrimDone (Standard_False), myTrimFailed (Standard_False), @@ -46,7 +49,7 @@ HatchGen_HatchingGen::HatchGen_HatchingGen (const TheHatchingCurve& Curve) : // Purpose : Returns the curve associated to the hatching. //======================================================================= -const TheHatchingCurve& HatchGen_HatchingGen::Curve () const +const Geom2dAdaptor_Curve& Geom2dHatch_Hatching::Curve () const { return myCurve ; } @@ -56,7 +59,7 @@ const TheHatchingCurve& HatchGen_HatchingGen::Curve () const // Purpose : Returns the curve associated to the hatching. //======================================================================= -TheHatchingCurve& HatchGen_HatchingGen::ChangeCurve () +Geom2dAdaptor_Curve& Geom2dHatch_Hatching::ChangeCurve () { return myCurve ; } @@ -67,7 +70,7 @@ TheHatchingCurve& HatchGen_HatchingGen::ChangeCurve () // value. //======================================================================= -void HatchGen_HatchingGen::TrimDone (const Standard_Boolean Flag) +void Geom2dHatch_Hatching::TrimDone (const Standard_Boolean Flag) { myTrimDone = Flag ; } @@ -77,7 +80,7 @@ void HatchGen_HatchingGen::TrimDone (const Standard_Boolean Flag) // Purpose : Returns the flag about the trimmings computation. //======================================================================= -Standard_Boolean HatchGen_HatchingGen::TrimDone () const +Standard_Boolean Geom2dHatch_Hatching::TrimDone () const { return myTrimDone ; } @@ -88,7 +91,7 @@ Standard_Boolean HatchGen_HatchingGen::TrimDone () const // value. //======================================================================= -void HatchGen_HatchingGen::TrimFailed (const Standard_Boolean Flag) +void Geom2dHatch_Hatching::TrimFailed (const Standard_Boolean Flag) { myTrimFailed = Flag ; if (myTrimFailed) myStatus = HatchGen_TrimFailure ; @@ -99,7 +102,7 @@ void HatchGen_HatchingGen::TrimFailed (const Standard_Boolean Flag) // Purpose : Returns the flag about the trimmings failure. //======================================================================= -Standard_Boolean HatchGen_HatchingGen::TrimFailed () const +Standard_Boolean Geom2dHatch_Hatching::TrimFailed () const { return myTrimFailed ; } @@ -110,7 +113,7 @@ Standard_Boolean HatchGen_HatchingGen::TrimFailed () const // value. //======================================================================= -void HatchGen_HatchingGen::IsDone (const Standard_Boolean Flag) +void Geom2dHatch_Hatching::IsDone (const Standard_Boolean Flag) { myIsDone = Flag ; } @@ -120,7 +123,7 @@ void HatchGen_HatchingGen::IsDone (const Standard_Boolean Flag) // Purpose : Returns the flag about the domains computation. //======================================================================= -Standard_Boolean HatchGen_HatchingGen::IsDone () const +Standard_Boolean Geom2dHatch_Hatching::IsDone () const { return myIsDone ; } @@ -130,7 +133,7 @@ Standard_Boolean HatchGen_HatchingGen::IsDone () const // Purpose : Sets the error status. //======================================================================= -void HatchGen_HatchingGen::Status (const HatchGen_ErrorStatus Status) +void Geom2dHatch_Hatching::Status (const HatchGen_ErrorStatus Status) { myStatus = Status ; } @@ -140,7 +143,7 @@ void HatchGen_HatchingGen::Status (const HatchGen_ErrorStatus Status) // Purpose : Returns the error status. //======================================================================= -HatchGen_ErrorStatus HatchGen_HatchingGen::Status () const +HatchGen_ErrorStatus Geom2dHatch_Hatching::Status () const { return myStatus ; } @@ -150,7 +153,7 @@ HatchGen_ErrorStatus HatchGen_HatchingGen::Status () const // Purpose : Adds an intersection point to the hatching. //======================================================================= -void HatchGen_HatchingGen::AddPoint (const HatchGen_PointOnHatching& Point, +void Geom2dHatch_Hatching::AddPoint (const HatchGen_PointOnHatching& Point, const Standard_Real Confusion) { Standard_Integer NbPoints = myPoints.Length () ; @@ -181,7 +184,7 @@ void HatchGen_HatchingGen::AddPoint (const HatchGen_PointOnHatching& Point, // Purpose : Returns the number of intersection points on the hatching. //======================================================================= -Standard_Integer HatchGen_HatchingGen::NbPoints () const +Standard_Integer Geom2dHatch_Hatching::NbPoints () const { return myPoints.Length () ; } @@ -191,7 +194,7 @@ Standard_Integer HatchGen_HatchingGen::NbPoints () const // Purpose : Returns the Index-th intersection point on the hatching. //======================================================================= -const HatchGen_PointOnHatching& HatchGen_HatchingGen::Point (const Standard_Integer Index) const +const HatchGen_PointOnHatching& Geom2dHatch_Hatching::Point (const Standard_Integer Index) const { #if RAISE_IF_NOSUCHOBJECT Standard_Integer NbPoints = myPoints.Length () ; @@ -206,7 +209,7 @@ const HatchGen_PointOnHatching& HatchGen_HatchingGen::Point (const Standard_Inte // Purpose : Returns the Index-th intersection point on the hatching. //======================================================================= -HatchGen_PointOnHatching& HatchGen_HatchingGen::ChangePoint (const Standard_Integer Index) +HatchGen_PointOnHatching& Geom2dHatch_Hatching::ChangePoint (const Standard_Integer Index) { #if RAISE_IF_NOSUCHOBJECT Standard_Integer NbPoints = myPoints.Length () ; @@ -221,7 +224,7 @@ HatchGen_PointOnHatching& HatchGen_HatchingGen::ChangePoint (const Standard_Inte // Purpose : Removes the Index-th intersection point of the hatching. //======================================================================= -void HatchGen_HatchingGen::RemPoint (const Standard_Integer Index) +void Geom2dHatch_Hatching::RemPoint (const Standard_Integer Index) { #if RAISE_IF_NOSUCHOBJECT Standard_Integer NbPoints = myPoints.Length () ; @@ -236,7 +239,7 @@ void HatchGen_HatchingGen::RemPoint (const Standard_Integer Index) // Purpose : Removes all the intersection points of the hatching. //======================================================================= -void HatchGen_HatchingGen::ClrPoints () +void Geom2dHatch_Hatching::ClrPoints () { if (myIsDone) ClrDomains() ; for (Standard_Integer IPntH = 1 ; IPntH <= myPoints.Length() ; IPntH++) { @@ -253,7 +256,7 @@ void HatchGen_HatchingGen::ClrPoints () // Purpose : Adds a domain to the hatching. //======================================================================= -void HatchGen_HatchingGen::AddDomain (const HatchGen_Domain& Domain) +void Geom2dHatch_Hatching::AddDomain (const HatchGen_Domain& Domain) { myDomains.Append (Domain) ; } @@ -263,7 +266,7 @@ void HatchGen_HatchingGen::AddDomain (const HatchGen_Domain& Domain) // Purpose : Returns the number of domains on the hatching. //======================================================================= -Standard_Integer HatchGen_HatchingGen::NbDomains () const +Standard_Integer Geom2dHatch_Hatching::NbDomains () const { return myDomains.Length () ; } @@ -273,7 +276,7 @@ Standard_Integer HatchGen_HatchingGen::NbDomains () const // Purpose : Returns the Index-th domain on the hatching. //======================================================================= -const HatchGen_Domain& HatchGen_HatchingGen::Domain (const Standard_Integer Index) const +const HatchGen_Domain& Geom2dHatch_Hatching::Domain (const Standard_Integer Index) const { #if RAISE_IF_NOSUCHOBJECT Standard_Integer NbDomains = myDomains.Length () ; @@ -288,7 +291,7 @@ const HatchGen_Domain& HatchGen_HatchingGen::Domain (const Standard_Integer Inde // Purpose : Removes the Index-th domain of the hatching. //======================================================================= -void HatchGen_HatchingGen::RemDomain (const Standard_Integer Index) +void Geom2dHatch_Hatching::RemDomain (const Standard_Integer Index) { #if RAISE_IF_NOSUCHOBJECT Standard_Integer NbDomains = myDomains.Length () ; @@ -302,7 +305,7 @@ void HatchGen_HatchingGen::RemDomain (const Standard_Integer Index) // Purpose : Removes all the domains of the hatching. //======================================================================= -void HatchGen_HatchingGen::ClrDomains () +void Geom2dHatch_Hatching::ClrDomains () { myDomains.Clear () ; myIsDone = Standard_False ; @@ -312,7 +315,7 @@ void HatchGen_HatchingGen::ClrDomains () // Function : ClassificationPoint // Purpose : returns a 2d point on the curve //======================================================================= -gp_Pnt2d HatchGen_HatchingGen::ClassificationPoint () const { +gp_Pnt2d Geom2dHatch_Hatching::ClassificationPoint () const { Standard_Real t,a,b; a = myCurve.FirstParameter(); b = myCurve.LastParameter(); diff --git a/src/HatchGen/HatchGen.cdl b/src/HatchGen/HatchGen.cdl index 941bc0c267..b2cfbd872f 100644 --- a/src/HatchGen/HatchGen.cdl +++ b/src/HatchGen/HatchGen.cdl @@ -17,13 +17,11 @@ package HatchGen uses - IntRes2d , - StdFail , - TopAbs , - TCollection , - TColStd, - gp, - TopClass + IntRes2d, + StdFail, + TopAbs, + TCollection, + gp is @@ -65,17 +63,6 @@ is class Domain ; class Domains instantiates Sequence from TCollection (Domain from HatchGen) ; - - generic class HatchingGen ; - generic class ElementGen ; - generic class ElementsGen,MapOfElements; - - generic class Hatcher , - Hatching , - Hatchings , - Element , - Elements, - Classifier; end HatchGen ; diff --git a/src/QABugs/QABugs_17.cxx b/src/QABugs/QABugs_17.cxx index f35476d7b9..28d7a61d1f 100644 --- a/src/QABugs/QABugs_17.cxx +++ b/src/QABugs/QABugs_17.cxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include @@ -154,7 +154,7 @@ static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,co } if(c1IsCircle) { Geom2dAdaptor_Curve acur(aCur2d2); - Geom2dGcc_MyQCurve qcur(acur, GccEnt_unqualified); + Geom2dGcc_QCurve qcur(acur, GccEnt_unqualified); GccEnt_QualifiedCirc qfromcur(aCir2d->Circ2d(), GccEnt_unqualified); Geom2dGcc_MyL2d2Tan lintan(qfromcur, qcur , par1, tol); if (lintan.IsDone()) { @@ -168,8 +168,8 @@ static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,co else { Geom2dAdaptor_Curve acur1(aCur2d1); Geom2dAdaptor_Curve acur2(aCur2d2); - Geom2dGcc_MyQCurve qcur1(acur1, GccEnt_unqualified); - Geom2dGcc_MyQCurve qcur2(acur2, GccEnt_unqualified); + Geom2dGcc_QCurve qcur1(acur1, GccEnt_unqualified); + Geom2dGcc_QCurve qcur2(acur2, GccEnt_unqualified); Geom2dGcc_MyL2d2Tan lintan(qcur1, qcur2 , par1, par2, tol); if (lintan.IsDone()) { gp_Lin2d lin = lintan.ThisSolution();