1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-06 18:26:22 +03:00

0024761: Convertation of the generic classes to the non-generic. Part 5

1) Generic class "GccEnt_QualifiedCurv" from "GccEnt" package converted to the non-generic class and moved to the "Geom2dGcc" package. Name of this class was changed to "Geom2dGcc_QCurve".

2) Generic classes "HatchGen_ElementGen", "HatchGen_ElementsGen", "HatchGen_HatchingGen" and "HatchGen_Hatcher" from "HatchGen" package converted to the non-generic classes and moved to the "Geom2dHatch" package. Names of this classes were changed to "Geom2dHatch_Element", "Geom2dHatch_Elements", "Geom2dHatch_Hatching" and "Geom2dHatch_Hatcher". Also all instantiations of the "internal" classes of this classes were moved to the "Geom2dHatch.cdl".

3) Generic classes "Extrema_GExtCC", "Extrema_GExtCC2d", "Extrema_GLocateExtCC" and "Extrema_GLocateExtCC2d" from "Extrema" package converted to the non-generic classes. Names of this classes were changed to "Extrema_ExtCC", "Extrema_ExtCC2d", "Extrema_LocateExtCC" and "Extrema_LocateExtCC2d". Also all instantiations of the "internal" classes of this classes were moved to the "Extrema.cdl".
This commit is contained in:
dln 2014-03-20 08:19:13 +04:00 committed by apn
parent e2065c2fb9
commit 0b85f9a605
32 changed files with 736 additions and 745 deletions

View File

@ -125,11 +125,96 @@ is
-- Curve-Curve: -- Curve-Curve:
-- 3d: -- 3d:
generic class GExtCC, CCache, ECC; class ExtCC;
generic class GLocateExtCC, LCCache, ELCC, LocECC;
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: -- 2d:
generic class GExtCC2d, CCache2d, ECC2d; class ExtCC2d;
generic class GLocateExtCC2d, LCCache2d, ELCC2d, LocECC2d;
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: -- Curve-Surface:
class ExtCS; class ExtCS;
@ -227,20 +312,6 @@ is
POnCurv from Extrema, POnCurv from Extrema,
SequenceOfPOnCurv 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: --- 2d instantiations:
class ExtPC2d instantiates GExtPC from Extrema class ExtPC2d instantiates GExtPC from Extrema
(Curve2d from Adaptor2d, (Curve2d from Adaptor2d,
@ -262,19 +333,4 @@ is
SequenceOfPOnCurv2d 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; end Extrema;

View File

@ -14,13 +14,10 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class GExtCC from Extrema (Curve1 as any; class ExtCC from Extrema
Tool1 as any;
Curve2 as any;
Tool2 as any)
---Purpose: It calculates all the distance between two curves. ---Purpose: It calculates all the distance between two curves.
-- These distances can be maximum or minimum. -- These distances can be maximum or minimum.
uses POnCurv from Extrema, uses POnCurv from Extrema,
SequenceOfPOnCurv from Extrema, SequenceOfPOnCurv from Extrema,
@ -28,52 +25,42 @@ uses POnCurv from Extrema,
Pnt from gp, Pnt from gp,
HArray1OfPnt from TColgp, HArray1OfPnt from TColgp,
SequenceOfReal from TColStd, SequenceOfReal from TColStd,
ListOfTransient from TColStd ListOfTransient from TColStd,
Curve from Adaptor3d,
CurveTool from Extrema,
ECC from Extrema
raises InfiniteSolutions from StdFail, raises InfiniteSolutions from StdFail,
NotDone from StdFail, NotDone from StdFail,
OutOfRange from Standard 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);
is 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; Create (C1: Curve from Adaptor3d; C2: Curve from Adaptor3d;
TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC; TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns ExtCC;
---Purpose: It calculates all the distances. ---Purpose: It calculates all the distances.
Create (C1: Curve1; Create (C1: Curve from Adaptor3d;
C2: Curve2; C2: Curve from Adaptor3d;
U1: Real from Standard; U1: Real from Standard;
U2: Real from Standard; U2: Real from Standard;
V1: Real from Standard; V1: Real from Standard;
V2: Real from Standard; V2: Real from Standard;
TolC1: Real = 1.0e-10; 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. ---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: ---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: ---Purpose:
SetRange (me: in out; theRank: Integer; Uinf, Usup: Real); SetRange (me: in out; theRank: Integer; Uinf, Usup: Real);
@ -140,7 +127,7 @@ is
is static protected; is static protected;
Results(me: in out;AlgExt: ECC; Results(me: in out;AlgExt: ECC from Extrema;
Ut11, Ut12, Ut21, Ut22: Real) Ut11, Ut12, Ut21, Ut22: Real)
is static protected; is static protected;
@ -172,4 +159,4 @@ fields
end GExtCC; end ExtCC;

View File

@ -19,7 +19,7 @@
// tri des solutions pour eviter de rendre plusieurs // tri des solutions pour eviter de rendre plusieurs
// fois la meme solution // fois la meme solution
#include Extrema_ECC_hxx #include <Extrema_ExtCC.ixx>
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
#include <Extrema_ExtElC.hxx> #include <Extrema_ExtElC.hxx>
@ -43,12 +43,16 @@
#include <Extrema_ExtPElC.hxx> #include <Extrema_ExtPElC.hxx>
#include <Standard_NullObject.hxx> #include <Standard_NullObject.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Extrema_CurveTool.hxx>
#include <Extrema_CCache.hxx>
//======================================================================= //=======================================================================
//function : Extrema_GExtCC //function : Extrema_ExtCC
//purpose : //purpose :
//======================================================================= //=======================================================================
Extrema_GExtCC::Extrema_GExtCC (const Standard_Real TolC1, Extrema_ExtCC::Extrema_ExtCC (const Standard_Real TolC1,
const Standard_Real TolC2) : const Standard_Real TolC2) :
myDone (Standard_False) myDone (Standard_False)
{ {
@ -57,12 +61,12 @@ Extrema_GExtCC::Extrema_GExtCC (const Standard_Real TolC1,
} }
//======================================================================= //=======================================================================
//function : Extrema_GExtCC //function : Extrema_ExtCC
//purpose : //purpose :
//======================================================================= //=======================================================================
Extrema_GExtCC::Extrema_GExtCC(const Curve1& C1, Extrema_ExtCC::Extrema_ExtCC(const Adaptor3d_Curve& C1,
const Curve2& C2, const Adaptor3d_Curve& C2,
const Standard_Real U1, const Standard_Real U1,
const Standard_Real U2, const Standard_Real U2,
const Standard_Real V1, const Standard_Real V1,
@ -80,12 +84,12 @@ Extrema_GExtCC::Extrema_GExtCC(const Curve1& C1,
//======================================================================= //=======================================================================
//function : Extrema_GExtCC //function : Extrema_ExtCC
//purpose : //purpose :
//======================================================================= //=======================================================================
Extrema_GExtCC::Extrema_GExtCC(const Curve1& C1, Extrema_ExtCC::Extrema_ExtCC(const Adaptor3d_Curve& C1,
const Curve2& C2, const Adaptor3d_Curve& C2,
const Standard_Real TolC1, const Standard_Real TolC1,
const Standard_Real TolC2) : const Standard_Real TolC2) :
myDone (Standard_False) myDone (Standard_False)
@ -102,9 +106,9 @@ Extrema_GExtCC::Extrema_GExtCC(const Curve1& C1,
//purpose : //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; Standard_Integer anInd = theRank - 1;
myC[anInd] = (Standard_Address)&C; myC[anInd] = (Standard_Address)&C;
@ -117,7 +121,7 @@ void Extrema_GExtCC::SetCurve (const Standard_Integer theRank, const Curve1& C)
//purpose : //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) const Standard_Real Uinf, const Standard_Real Usup)
{ {
SetCurve (theRank, C); SetCurve (theRank, C);
@ -129,10 +133,10 @@ void Extrema_GExtCC::SetCurve (const Standard_Integer theRank, const Curve1& C,
//purpose : //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) 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; Standard_Integer anInd = theRank - 1;
myInf[anInd] = Uinf; myInf[anInd] = Uinf;
mySup[anInd] = Usup; mySup[anInd] = Usup;
@ -143,9 +147,9 @@ void Extrema_GExtCC::SetRange (const Standard_Integer theRank,
//purpose : //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; Standard_Integer anInd = theRank - 1;
myTol[anInd] = theTol; myTol[anInd] = theTol;
} }
@ -156,16 +160,16 @@ void Extrema_GExtCC::SetTolerance (const Standard_Integer theRank, const Standar
//purpose : //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; myDone = Standard_False;
mypoints.Clear(); mypoints.Clear();
mySqDist.Clear(); mySqDist.Clear();
myIsPar = Standard_False; myIsPar = Standard_False;
GeomAbs_CurveType type1 = (*((Curve1*)myC[0])).GetType(); GeomAbs_CurveType type1 = (*((Adaptor3d_Curve*)myC[0])).GetType();
GeomAbs_CurveType type2 = (*((Curve2*)myC[1])).GetType(); GeomAbs_CurveType type2 = (*((Adaptor3d_Curve*)myC[1])).GetType();
Standard_Real U11, U12, U21, U22, Tol = Min(myTol[0], myTol[1]); Standard_Real U11, U12, U21, U22, Tol = Min(myTol[0], myTol[1]);
mynbext = 0; mynbext = 0;
inverse = Standard_False; inverse = Standard_False;
@ -175,10 +179,10 @@ void Extrema_GExtCC::Perform()
U21 = myInf[1]; U21 = myInf[1];
U22 = mySup[1]; U22 = mySup[1];
if (!Precision::IsInfinite(U11)) P1f = Tool1::Value(*((Curve1*)myC[0]), U11); if (!Precision::IsInfinite(U11)) P1f = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), U11);
if (!Precision::IsInfinite(U12)) P1l = Tool1::Value(*((Curve1*)myC[0]), U12); if (!Precision::IsInfinite(U12)) P1l = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), U12);
if (!Precision::IsInfinite(U21)) P2f = Tool2::Value(*((Curve2*)myC[1]), U21); if (!Precision::IsInfinite(U21)) P2f = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), U21);
if (!Precision::IsInfinite(U22)) P2l = Tool2::Value(*((Curve2*)myC[1]), U22); if (!Precision::IsInfinite(U22)) P2l = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), U22);
if (Precision::IsInfinite(U11) || Precision::IsInfinite(U21)) mydist11 = RealLast(); if (Precision::IsInfinite(U11) || Precision::IsInfinite(U21)) mydist11 = RealLast();
@ -210,27 +214,27 @@ void Extrema_GExtCC::Perform()
} }
switch (aType2) { switch (aType2) {
case GeomAbs_Line: { 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); Results(Xtrem, U11, U12, U21, U22);
break; break;
} }
case GeomAbs_Circle: { 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); Results(Xtrem, U11, U12, U21, U22);
break; break;
} }
case GeomAbs_Ellipse: { 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); Results(Xtrem, U11, U12, U21, U22);
break; break;
} }
case GeomAbs_Hyperbola: { 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); Results(Xtrem, U11, U12, U21, U22);
break; break;
} }
case GeomAbs_Parabola: { 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); Results(Xtrem, U11, U12, U21, U22);
break; break;
} }
@ -239,7 +243,7 @@ void Extrema_GExtCC::Perform()
} else if (type1 == GeomAbs_Circle && type2 == GeomAbs_Circle) { } else if (type1 == GeomAbs_Circle && type2 == GeomAbs_Circle) {
//analytical case - two circles //analytical case - two circles
Standard_Boolean bIsDone; 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(); bIsDone = CCXtrem.IsDone();
if(bIsDone) { if(bIsDone) {
Results(CCXtrem, U11, U12, U21, U22); Results(CCXtrem, U11, U12, U21, U22);
@ -251,9 +255,9 @@ void Extrema_GExtCC::Perform()
TColStd_ListOfTransient& aCacheList = myCacheLists[i]; TColStd_ListOfTransient& aCacheList = myCacheLists[i];
if (aCacheList.IsEmpty()) { if (aCacheList.IsEmpty()) {
//no caches, build them //no caches, build them
Curve1& aC = *(Curve1*)myC[i]; Adaptor3d_Curve& aC = *(Adaptor3d_Curve*)myC[i];
//single interval from myInf[i] to mySup[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); aCacheList.Append (aCache);
} }
} }
@ -277,7 +281,7 @@ void Extrema_GExtCC::Perform()
TColStd_ListOfTransient& aCacheList = myCacheLists[i]; TColStd_ListOfTransient& aCacheList = myCacheLists[i];
if (aCacheList.IsEmpty()) { if (aCacheList.IsEmpty()) {
//no caches, build them //no caches, build them
Curve1& aC = *(Curve1*)myC[i]; Adaptor3d_Curve& aC = *(Adaptor3d_Curve*)myC[i];
Standard_Real du1 = 0., t = 0.; Standard_Real du1 = 0., t = 0.;
gp_Pnt P1, P2; gp_Pnt P1, P2;
@ -292,8 +296,8 @@ void Extrema_GExtCC::Perform()
KnotSampling[i] = Standard_True; KnotSampling[i] = Standard_True;
aNbS[i] = aC.NbPoles() * 2; aNbS[i] = aC.NbPoles() * 2;
rf = (Tool1::BSpline(*((Curve1*)myC[i])))->FirstParameter(); rf = (Extrema_CurveTool::BSpline(*((Adaptor3d_Curve*)myC[i])))->FirstParameter();
rl = (Tool1::BSpline(*((Curve1*)myC[i])))->LastParameter(); rl = (Extrema_CurveTool::BSpline(*((Adaptor3d_Curve*)myC[i])))->LastParameter();
aNbS[i] = (Standard_Integer) ( aNbS[i] * ((mySup[i] - myInf[i]) / (rl - rf)) + 1 ); aNbS[i] = (Standard_Integer) ( aNbS[i] * ((mySup[i] - myInf[i]) / (rl - rf)) + 1 );
case GeomAbs_OtherCurve: case GeomAbs_OtherCurve:
case GeomAbs_Line: case GeomAbs_Line:
@ -302,9 +306,9 @@ void Extrema_GExtCC::Perform()
aNbS[i] = Max(aNbS[i] / aNbInter[i], 3); aNbS[i] = Max(aNbS[i] / aNbInter[i], 3);
LL[i] = 0.; LL[i] = 0.;
du1 = (mySup[i] - myInf[i]) / ((aNbS[i]-1)*aNbInter[i]); 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) { 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); LL[i] += P1.Distance(P2);
P1 = P2; P1 = P2;
} }
@ -343,7 +347,7 @@ void Extrema_GExtCC::Perform()
TColStd_ListOfTransient& aCacheList = myCacheLists[i]; TColStd_ListOfTransient& aCacheList = myCacheLists[i];
if (aCacheList.IsEmpty()) { if (aCacheList.IsEmpty()) {
//no caches, build them //no caches, build them
Curve1& aC = *(Curve1*)myC[i]; Adaptor3d_Curve& aC = *(Adaptor3d_Curve*)myC[i];
if (aC.GetType() >= GeomAbs_BSplineCurve) if (aC.GetType() >= GeomAbs_BSplineCurve)
{ {
@ -369,7 +373,7 @@ void Extrema_GExtCC::Perform()
while (NextKnot != anArr(k+1)); while (NextKnot != anArr(k+1));
Handle(Extrema_CCache) aCache = 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]); IntervalsCN, start_j, j, Coeff[i]);
aCacheList.Append (aCache); aCacheList.Append (aCache);
@ -380,7 +384,7 @@ void Extrema_GExtCC::Perform()
{ {
for (Standard_Integer k = 1; k <= aNbInter[i]; k++) { for (Standard_Integer k = 1; k <= aNbInter[i]; k++) {
Handle(Extrema_CCache) aCache = 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); aCacheList.Append (aCache);
} }
} }
@ -417,7 +421,7 @@ void Extrema_GExtCC::Perform()
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Extrema_GExtCC::IsDone() const Standard_Boolean Extrema_ExtCC::IsDone() const
{ {
return myDone; return myDone;
} }
@ -427,7 +431,7 @@ Standard_Boolean Extrema_GExtCC::IsDone() const
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Extrema_GExtCC::IsParallel() const Standard_Boolean Extrema_ExtCC::IsParallel() const
{ {
return myIsPar; return myIsPar;
} }
@ -438,7 +442,7 @@ Standard_Boolean Extrema_GExtCC::IsParallel() const
//purpose : //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(!myDone) StdFail_NotDone::Raise();
if ((N <= 0) || (N > mynbext)) Standard_OutOfRange::Raise(); if ((N <= 0) || (N > mynbext)) Standard_OutOfRange::Raise();
@ -451,7 +455,7 @@ Standard_Real Extrema_GExtCC::SquareDistance(const Standard_Integer N) const
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer Extrema_GExtCC::NbExt() const Standard_Integer Extrema_ExtCC::NbExt() const
{ {
if(!myDone) StdFail_NotDone::Raise(); if(!myDone) StdFail_NotDone::Raise();
return mynbext; return mynbext;
@ -463,7 +467,7 @@ Standard_Integer Extrema_GExtCC::NbExt() const
//purpose : //purpose :
//======================================================================= //=======================================================================
void Extrema_GExtCC::Points(const Standard_Integer N, void Extrema_ExtCC::Points(const Standard_Integer N,
Extrema_POnCurv& P1, Extrema_POnCurv& P1,
Extrema_POnCurv& P2) const Extrema_POnCurv& P2) const
{ {
@ -480,7 +484,7 @@ void Extrema_GExtCC::Points(const Standard_Integer N,
//purpose : //purpose :
//======================================================================= //=======================================================================
void Extrema_GExtCC::TrimmedSquareDistances(Standard_Real& dist11, void Extrema_ExtCC::TrimmedSquareDistances(Standard_Real& dist11,
Standard_Real& dist12, Standard_Real& dist12,
Standard_Real& dist21, Standard_Real& dist21,
Standard_Real& dist22, Standard_Real& dist22,
@ -506,7 +510,7 @@ void Extrema_GExtCC::TrimmedSquareDistances(Standard_Real& dist11,
//purpose : //purpose :
//======================================================================= //=======================================================================
void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt, void Extrema_ExtCC::Results(const Extrema_ExtElC& AlgExt,
const Standard_Real Ut11, const Standard_Real Ut11,
const Standard_Real Ut12, const Standard_Real Ut12,
const Standard_Real Ut21, const Standard_Real Ut21,
@ -520,17 +524,17 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
if (myDone) { if (myDone) {
myIsPar = AlgExt.IsParallel(); myIsPar = AlgExt.IsParallel();
if (myIsPar) { if (myIsPar) {
GeomAbs_CurveType type = Tool1::GetType(*((Curve1*)myC[0])); GeomAbs_CurveType type = Extrema_CurveTool::GetType(*((Adaptor3d_Curve*)myC[0]));
GeomAbs_CurveType type2 = Tool2::GetType(*((Curve2*)myC[1])); GeomAbs_CurveType type2 = Extrema_CurveTool::GetType(*((Adaptor3d_Curve*)myC[1]));
// Parallel case is only for line-line, circle-circle and circle-line!!! // Parallel case is only for line-line, circle-circle and circle-line!!!
// But really for trimmed curves extremas can not exist! // But really for trimmed curves extremas can not exist!
Extrema_POnCurv dummypoint(0., gp_Pnt(0.,0.,0.)); Extrema_POnCurv dummypoint(0., gp_Pnt(0.,0.,0.));
if(type != type2) { if(type != type2) {
mySqDist.Append(AlgExt.SquareDistance(1)); mySqDist.Append(AlgExt.SquareDistance(1));
if(type == GeomAbs_Circle) { 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); 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()) { if(ExtPLin.IsDone()) {
mynbext = 1; mynbext = 1;
P2 = ExtPLin.Point(1); P2 = ExtPLin.Point(1);
@ -545,9 +549,9 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
} }
} }
else { 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); 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()) { if(ExtPLin.IsDone()) {
mynbext = 1; mynbext = 1;
P1 = ExtPLin.Point(1); P1 = ExtPLin.Point(1);
@ -573,9 +577,9 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
if(infinite) { if(infinite) {
mynbext = 1; mynbext = 1;
mySqDist.Append(AlgExt.SquareDistance(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); 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()) { if(ExtPLin.IsDone()) {
P2 = ExtPLin.Point(1); P2 = ExtPLin.Point(1);
mypoints.Append(P1); mypoints.Append(P1);
@ -590,8 +594,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
else { else {
Standard_Boolean finish = Standard_False; Standard_Boolean finish = Standard_False;
if(!Precision::IsInfinite(Ut11)) { if(!Precision::IsInfinite(Ut11)) {
gp_Pnt PonC1 = Tool1::Value(*((Curve1*)myC[0]), Ut11); gp_Pnt PonC1 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), Ut11);
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() && ExtPLin.NbExt() > 0) { if(ExtPLin.IsDone() && ExtPLin.NbExt() > 0) {
mynbext = 1; mynbext = 1;
mySqDist.Append(AlgExt.SquareDistance(1)); mySqDist.Append(AlgExt.SquareDistance(1));
@ -604,8 +608,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
} }
if(!finish) { if(!finish) {
if(!Precision::IsInfinite(Ut12)) { if(!Precision::IsInfinite(Ut12)) {
gp_Pnt PonC1 = Tool1::Value(*((Curve1*)myC[0]), Ut12); gp_Pnt PonC1 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), Ut12);
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() && ExtPLin.NbExt() > 0) { if(ExtPLin.IsDone() && ExtPLin.NbExt() > 0) {
mynbext = 1; mynbext = 1;
mySqDist.Append(AlgExt.SquareDistance(1)); mySqDist.Append(AlgExt.SquareDistance(1));
@ -619,8 +623,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
} }
if(!finish) { if(!finish) {
if(!Precision::IsInfinite(Ut21)) { if(!Precision::IsInfinite(Ut21)) {
gp_Pnt PonC2 = Tool2::Value(*((Curve2*)myC[1]), Ut21); gp_Pnt PonC2 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), Ut21);
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() && ExtPLin.NbExt() > 0) { if(ExtPLin.IsDone() && ExtPLin.NbExt() > 0) {
mynbext = 1; mynbext = 1;
mySqDist.Append(AlgExt.SquareDistance(1)); mySqDist.Append(AlgExt.SquareDistance(1));
@ -634,8 +638,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
} }
if(!finish) { if(!finish) {
if(!Precision::IsInfinite(Ut22)) { if(!Precision::IsInfinite(Ut22)) {
gp_Pnt PonC2 = Tool2::Value(*((Curve2*)myC[1]), Ut22); gp_Pnt PonC2 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), Ut22);
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() && ExtPLin.NbExt() > 0) { if(ExtPLin.IsDone() && ExtPLin.NbExt() > 0) {
mynbext = 1; mynbext = 1;
mySqDist.Append(AlgExt.SquareDistance(1)); mySqDist.Append(AlgExt.SquareDistance(1));
@ -659,9 +663,9 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
} }
else { else {
Standard_Boolean finish = Standard_False; 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); 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) { if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) {
for(i = 1; i <= ExtPCir.NbExt(); i++) { for(i = 1; i <= ExtPCir.NbExt(); i++) {
mynbext++; mynbext++;
@ -673,8 +677,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
if(mynbext == 2) finish = Standard_True; if(mynbext == 2) finish = Standard_True;
} }
if(!finish) { if(!finish) {
PonC1 = Tool1::Value(*((Curve1*)myC[0]), Ut12); PonC1 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[0]), Ut12);
ExtPCir.Perform(PonC1, Tool2::Circle(*((Curve2*)myC[1])), Precision::Confusion(), Ut21, Ut22); ExtPCir.Perform(PonC1, Extrema_CurveTool::Circle(*((Adaptor3d_Curve*)myC[1])), Precision::Confusion(), Ut21, Ut22);
P1.SetValues(Ut12, PonC1); P1.SetValues(Ut12, PonC1);
if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) { if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) {
if(mynbext == 0) { if(mynbext == 0) {
@ -703,8 +707,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
} }
} }
if(!finish) { if(!finish) {
gp_Pnt PonC2 = Tool2::Value(*((Curve2*)myC[1]), Ut21); gp_Pnt PonC2 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), Ut21);
ExtPCir.Perform(PonC2, Tool1::Circle(*((Curve1*)myC[0])), Precision::Confusion(), Ut11, Ut12); ExtPCir.Perform(PonC2, Extrema_CurveTool::Circle(*((Adaptor3d_Curve*)myC[0])), Precision::Confusion(), Ut11, Ut12);
P2.SetValues(Ut21, PonC2); P2.SetValues(Ut21, PonC2);
if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) { if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) {
if(mynbext == 0) { if(mynbext == 0) {
@ -733,8 +737,8 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
} }
} }
if(!finish) { if(!finish) {
gp_Pnt PonC2 = Tool2::Value(*((Curve2*)myC[1]), Ut22); gp_Pnt PonC2 = Extrema_CurveTool::Value(*((Adaptor3d_Curve*)myC[1]), Ut22);
ExtPCir.Perform(PonC2, Tool1::Circle(*((Curve1*)myC[0])), Precision::Confusion(), Ut11, Ut12); ExtPCir.Perform(PonC2, Extrema_CurveTool::Circle(*((Adaptor3d_Curve*)myC[0])), Precision::Confusion(), Ut11, Ut12);
P2.SetValues(Ut22, PonC2); P2.SetValues(Ut22, PonC2);
if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) { if(ExtPCir.IsDone() && ExtPCir.NbExt() > 0) {
if(mynbext == 0) { if(mynbext == 0) {
@ -787,11 +791,11 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
U = P2.Parameter(); U = P2.Parameter();
} }
if (Tool1::IsPeriodic(*((Curve1*)myC[0]))) { if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[0]))) {
U = ElCLib::InPeriod(U, Ut11, Ut11+Tool1::Period(*((Curve1*)myC[0]))); U = ElCLib::InPeriod(U, Ut11, Ut11+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[0])));
} }
if (Tool2::IsPeriodic(*((Curve2*)myC[1]))) { if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[1]))) {
U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Tool2::Period(*((Curve2*)myC[1]))); U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[1])));
} }
if ((U >= Ut11 - RealEpsilon()) && if ((U >= Ut11 - RealEpsilon()) &&
@ -826,7 +830,7 @@ void Extrema_GExtCC::Results(const Extrema_ExtElC& AlgExt,
//purpose : //purpose :
//======================================================================= //=======================================================================
void Extrema_GExtCC::Results(const Extrema_ECC& AlgExt, void Extrema_ExtCC::Results(const Extrema_ECC& AlgExt,
const Standard_Real Ut11, const Standard_Real Ut11,
const Standard_Real Ut12, const Standard_Real Ut12,
const Standard_Real Ut21, const Standard_Real Ut21,
@ -856,11 +860,11 @@ void Extrema_GExtCC::Results(const Extrema_ECC& AlgExt,
if (IsExtrema) if (IsExtrema)
{ {
// Verification de la validite des parametres // Verification de la validite des parametres
if (Tool1::IsPeriodic(*((Curve1*)myC[0]))) { if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[0]))) {
U = ElCLib::InPeriod(U, Ut11, Ut11+Tool1::Period(*((Curve1*)myC[0]))); U = ElCLib::InPeriod(U, Ut11, Ut11+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[0])));
} }
if (Tool2::IsPeriodic(*((Curve2*)myC[1]))) { if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[1]))) {
U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Tool2::Period(*((Curve2*)myC[1]))); U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[1])));
} }
if ((U >= Ut11 - RealEpsilon()) && if ((U >= Ut11 - RealEpsilon()) &&

View File

@ -14,61 +14,49 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class GExtCC2d from Extrema (Curve1 as any; class ExtCC2d from Extrema
Tool1 as any;
Curve2 as any;
Tool2 as any)
---Purpose: It calculates all the distance between two curves. ---Purpose: It calculates all the distance between two curves.
-- These distances can be maximum or minimum. -- These distances can be maximum or minimum.
uses POnCurv2d from Extrema, uses POnCurv2d from Extrema,
SequenceOfPOnCurv2d from Extrema, SequenceOfPOnCurv2d from Extrema,
ExtElC2d from Extrema, ExtElC2d from Extrema,
Pnt2d from gp, Pnt2d from gp,
HArray1OfPnt2d from TColgp, 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, raises InfiniteSolutions from StdFail,
NotDone from StdFail, NotDone from StdFail,
OutOfRange from Standard 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);
is is
Create returns GExtCC2d; Create returns ExtCC2d;
Create (C1: Curve1; C2: Curve2; Create (C1: Curve2d from Adaptor2d; C2: Curve2d from Adaptor2d;
TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC2d; TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns ExtCC2d;
---Purpose: It calculates all the distances. ---Purpose: It calculates all the distances.
Create (C1: Curve1; Create (C1: Curve2d from Adaptor2d;
C2: Curve2; C2: Curve2d from Adaptor2d;
U1: Real from Standard; U1: Real from Standard;
U2: Real from Standard; U2: Real from Standard;
V1: Real from Standard; V1: Real from Standard;
V2: Real from Standard; V2: Real from Standard;
TolC1: Real = 1.0e-10; 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. ---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; V1, V2: Real from Standard;
TolC1: Real = 1.0e-10; TolC1: Real = 1.0e-10;
TolC2: Real = 1.0e-10) TolC2: Real = 1.0e-10)
@ -76,7 +64,7 @@ is
is static; is static;
Perform(me: in out; C1: Curve1; Perform(me: in out; C1: Curve2d from Adaptor2d;
U1, U2: Real from Standard) U1, U2: Real from Standard)
is static; is static;
@ -139,7 +127,7 @@ is
is static protected; is static protected;
-- modified by NIZHNY-EAP Thu Jan 27 16:53:25 2000 ___BEGIN___ -- 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___ -- modified by NIZHNY-EAP Thu Jan 27 16:53:26 2000 ___END___
Ut11, Ut12, Ut21, Ut22: Real; Ut11, Ut12, Ut21, Ut22: Real;
Period1 : Real from Standard = 0.0; Period1 : Real from Standard = 0.0;
@ -171,4 +159,4 @@ fields
end GExtCC2d; end ExtCC2d;

View File

@ -14,7 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include Extrema_ECC2d_hxx #include <Extrema_ExtCC2d.ixx>
#include <Extrema_ExtElC2d.hxx> #include <Extrema_ExtElC2d.hxx>
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
#include <Extrema_ExtElC.hxx> #include <Extrema_ExtElC.hxx>
@ -33,6 +34,9 @@
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <Extrema_Curve2dTool.hxx>
//======================================================================= //=======================================================================
//function : IsParallelDot //function : IsParallelDot
@ -48,20 +52,20 @@ static Standard_Boolean IsParallelDot( gp_Vec2d theV1,
theV1.Magnitude()*theV2.Magnitude()*cos(AngTol); theV1.Magnitude()*theV2.Magnitude()*cos(AngTol);
} }
Extrema_GExtCC2d::Extrema_GExtCC2d() {} Extrema_ExtCC2d::Extrema_ExtCC2d() {}
Extrema_GExtCC2d::Extrema_GExtCC2d(const Curve1& C1, Extrema_ExtCC2d::Extrema_ExtCC2d(const Adaptor2d_Curve2d& C1,
const Curve2& C2, const Adaptor2d_Curve2d& C2,
const Standard_Real TolC1, const Standard_Real TolC1,
const Standard_Real TolC2) const Standard_Real TolC2)
{ {
Initialize(C2, Tool2::FirstParameter(C2), Tool2::LastParameter(C2), TolC1, TolC2); Initialize(C2, Extrema_Curve2dTool::FirstParameter(C2), Extrema_Curve2dTool::LastParameter(C2), TolC1, TolC2);
Perform(C1, Tool1::FirstParameter(C1), Tool1::LastParameter(C1)); Perform(C1, Extrema_Curve2dTool::FirstParameter(C1), Extrema_Curve2dTool::LastParameter(C1));
} }
Extrema_GExtCC2d::Extrema_GExtCC2d(const Curve1& C1, Extrema_ExtCC2d::Extrema_ExtCC2d(const Adaptor2d_Curve2d& C1,
const Curve2& C2, const Adaptor2d_Curve2d& C2,
const Standard_Real U1, const Standard_Real U1,
const Standard_Real U2, const Standard_Real U2,
const Standard_Real V1, 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 V1,
const Standard_Real V2, const Standard_Real V2,
const Standard_Real TolC1, 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 U1,
const Standard_Real U2) const Standard_Real U2)
{ {
mypoints.Clear(); mypoints.Clear();
mySqDist.Clear(); mySqDist.Clear();
Standard_Integer NbU = 32, NbV = 32; 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); Standard_Real U11, U12, U21, U22, Tol = Min(mytolc1, mytolc2);
// Extrema_POnCurv2d P1, P2; // Extrema_POnCurv2d P1, P2;
mynbext = 0; mynbext = 0;
@ -108,10 +112,10 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
U12 = U2; U12 = U2;
U21 = myv1; U21 = myv1;
U22 = myv2; U22 = myv2;
P1f = Tool1::Value(C1, U11); P1f = Extrema_Curve2dTool::Value(C1, U11);
P1l = Tool1::Value(C1, U12); P1l = Extrema_Curve2dTool::Value(C1, U12);
P2f = Tool2::Value(*((Curve2*)myC), U21); P2f = Extrema_Curve2dTool::Value(*((Adaptor2d_Curve2d*)myC), U21);
P2l = Tool2::Value(*((Curve2*)myC), U22); P2l = Extrema_Curve2dTool::Value(*((Adaptor2d_Curve2d*)myC), U22);
switch(type1) { switch(type1) {
@ -122,38 +126,38 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
switch(type2) { switch(type2) {
case GeomAbs_Circle: { 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); Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI);
} }
break; break;
case GeomAbs_Ellipse: { 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 ); Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI );
} }
break; break;
case GeomAbs_Parabola: { 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.); Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
} }
break; break;
case GeomAbs_Hyperbola: { 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. ); Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0. );
} }
break; break;
case GeomAbs_BezierCurve: case GeomAbs_BezierCurve:
case GeomAbs_OtherCurve: case GeomAbs_OtherCurve:
case GeomAbs_BSplineCurve: { case GeomAbs_BSplineCurve: {
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Standard_Real Period2 = 0.; 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); Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI,Period2);
} }
break; break;
case GeomAbs_Line: { case GeomAbs_Line: {
inverse = Standard_True; 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.); Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
} }
break; break;
@ -169,27 +173,27 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
switch(type2) { switch(type2) {
case GeomAbs_Circle: { case GeomAbs_Circle: {
inverse = Standard_True; 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); Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI);
} }
break; break;
case GeomAbs_Ellipse: { case GeomAbs_Ellipse: {
//Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Ellipse(*((Curve2*)myC))); //Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Results(Xtrem, C1, U11, U12, U21, U22,2*M_PI, 2*M_PI); Results(Xtrem, C1, U11, U12, U21, U22,2*M_PI, 2*M_PI);
} }
break; break;
case GeomAbs_Parabola: { case GeomAbs_Parabola: {
//Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Parabola(*((Curve2*)myC))); //Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI, 0.); Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI, 0.);
} }
break; break;
case GeomAbs_Hyperbola: { case GeomAbs_Hyperbola: {
//Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Hyperbola(*((Curve2*)myC))); //Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI, 0.); 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_BezierCurve:
case GeomAbs_OtherCurve: case GeomAbs_OtherCurve:
case GeomAbs_BSplineCurve: { case GeomAbs_BSplineCurve: {
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Standard_Real Period2 = 0.; 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); Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI,Period2);
} }
break; break;
case GeomAbs_Line: { case GeomAbs_Line: {
inverse = Standard_True; 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.); Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
} }
break; break;
@ -222,29 +226,29 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
switch(type2) { switch(type2) {
case GeomAbs_Circle: { case GeomAbs_Circle: {
inverse = Standard_True; 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); Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
} }
break; break;
case GeomAbs_Ellipse: { case GeomAbs_Ellipse: {
//inverse = Standard_True; //inverse = Standard_True;
//Extrema_ExtElC2d Xtrem(Tool2::Ellipse(*((Curve2*)myC)), Tool1::Parabola(C1)); //Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Parabola(C1));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*M_PI); Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*M_PI);
} }
break; break;
case GeomAbs_Parabola: { case GeomAbs_Parabola: {
//Extrema_ExtElC2d Xtrem(Tool1::Parabola(C1), Tool2::Parabola(*((Curve2*)myC))); //Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Parabola(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Results(Xtrem, C1, U11, U12, U21, U22, 0., 0.); Results(Xtrem, C1, U11, U12, U21, U22, 0., 0.);
} }
break; break;
case GeomAbs_Hyperbola: { case GeomAbs_Hyperbola: {
//inverse = Standard_True; //inverse = Standard_True;
//Extrema_ExtElC2d Xtrem(Tool2::Hyperbola(*((Curve2*)myC)), Tool1::Parabola(C1)); //Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Parabola(C1));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Results(Xtrem, C1, U11, U12, U21, U22, 0., 0.); 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_BezierCurve:
case GeomAbs_OtherCurve: case GeomAbs_OtherCurve:
case GeomAbs_BSplineCurve: { case GeomAbs_BSplineCurve: {
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Standard_Real Period2 = 0.; 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); Results(Xtrem, C1, U11, U12, U21, U22, 0., Period2);
} }
break; break;
case GeomAbs_Line: { case GeomAbs_Line: {
inverse = Standard_True; 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.); Results(Xtrem, U11, U12, U21, U22, 0., 0.);
} }
break; break;
@ -277,28 +281,28 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
switch(type2) { switch(type2) {
case GeomAbs_Circle: { case GeomAbs_Circle: {
inverse = Standard_True; 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); Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
} }
break; break;
case GeomAbs_Ellipse: { case GeomAbs_Ellipse: {
//inverse = Standard_True; //inverse = Standard_True;
//Extrema_ExtElC2d Xtrem(Tool2::Ellipse(*((Curve2*)myC)), Tool1::Hyperbola(C1)); //Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(*((Adaptor2d_Curve2d*)myC)), Extrema_Curve2dTool::Hyperbola(C1));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*M_PI ); Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*M_PI );
} }
break; break;
case GeomAbs_Parabola: { case GeomAbs_Parabola: {
//Extrema_ExtElC2d Xtrem(Tool1::Hyperbola(C1), Tool2::Parabola(*((Curve2*)myC))); //Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(C1), Extrema_Curve2dTool::Parabola(*((Adaptor2d_Curve2d*)myC)));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Results(Xtrem, C1, U11, U12, U21, U22, 0., 0.); Results(Xtrem, C1, U11, U12, U21, U22, 0., 0.);
} }
break; break;
case GeomAbs_Hyperbola: { case GeomAbs_Hyperbola: {
//Extrema_ExtElC2d Xtrem(Tool1::Hyperbola(C1), Tool2::Hyperbola(*((Curve2*)myC))); //Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(C1), Extrema_Curve2dTool::Hyperbola(*((Adaptor2d_Curve2d*)myC)));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Results(Xtrem, C1, U11, U12, U21, U22, 0., 0.); 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_OtherCurve:
case GeomAbs_BezierCurve: case GeomAbs_BezierCurve:
case GeomAbs_BSplineCurve: { case GeomAbs_BSplineCurve: {
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC) Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC)
, NbU, NbV, mytolc1, mytolc2); , NbU, NbV, mytolc1, mytolc2);
Standard_Real Period2 = 0.; 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); Results(Xtrem, C1, U11, U12, U21, U22, 0., Period2);
} }
break; break;
case GeomAbs_Line: { case GeomAbs_Line: {
inverse = Standard_True; 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.); Results(Xtrem, U11, U12, U21, U22, 0., 0.);
} }
break; break;
@ -329,12 +333,12 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
case GeomAbs_BezierCurve: case GeomAbs_BezierCurve:
case GeomAbs_OtherCurve: case GeomAbs_OtherCurve:
case GeomAbs_BSplineCurve: { case GeomAbs_BSplineCurve: {
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Standard_Real Period1 = 0.; 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.; 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); Results(Xtrem, C1, U11, U12, U21, U22, Period1, Period2);
} }
break; break;
@ -346,37 +350,37 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1,
switch(type2) { switch(type2) {
case GeomAbs_Circle: { 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); Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
} }
break; break;
case GeomAbs_Ellipse: { 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); Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
} }
break; break;
case GeomAbs_Parabola: { 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.); Results(Xtrem, U11, U12, U21, U22, 0., 0.);
} }
break; break;
case GeomAbs_Hyperbola: { 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.); Results(Xtrem, U11, U12, U21, U22, 0., 0.);
} }
break; break;
case GeomAbs_BezierCurve: case GeomAbs_BezierCurve:
case GeomAbs_OtherCurve: case GeomAbs_OtherCurve:
case GeomAbs_BSplineCurve: { case GeomAbs_BSplineCurve: {
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), Extrema_ECC2d Xtrem(C1, *((Adaptor2d_Curve2d*)myC),
NbU, NbV, mytolc1, mytolc2); NbU, NbV, mytolc1, mytolc2);
Standard_Real Period2 = 0.; 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); Results(Xtrem, C1, U11, U12, U21, U22, 0., Period2);
} }
break; break;
case GeomAbs_Line: { 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.); Results(Xtrem, U11, U12, U21, U22, 0., 0.);
} }
break; 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; 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(!myDone) StdFail_NotDone::Raise();
if ((N <= 0) || (N > mynbext)) Standard_OutOfRange::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(); if(!myDone) StdFail_NotDone::Raise();
return mynbext; return mynbext;
} }
void Extrema_GExtCC2d::Points(const Standard_Integer N, void Extrema_ExtCC2d::Points(const Standard_Integer N,
Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P1,
Extrema_POnCurv2d& P2) const 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& dist12,
Standard_Real& dist21, Standard_Real& dist21,
Standard_Real& dist22, 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 Ut11,
const Standard_Real Ut12, const Standard_Real Ut12,
const Standard_Real Ut21, 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___ // 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___ // modified by NIZHNY-EAP Wed Feb 23 14:51:26 2000 ___END___
const Standard_Real Ut11, const Standard_Real Ut11,
const Standard_Real Ut12, 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 // to be sure that it's a real extrema
gp_Pnt2d p; gp_Pnt2d p;
gp_Vec2d v1, v2; gp_Vec2d v1, v2;
Tool1::D1(C1,U,p, v1); Extrema_Curve2dTool::D1(C1,U,p, v1);
Tool2::D1(*((Curve2*)myC),U2,p, v2); Extrema_Curve2dTool::D1(*((Adaptor2d_Curve2d*)myC),U2,p, v2);
if (IsParallelDot(v1, v2, Precision::Angular())) if (IsParallelDot(v1, v2, Precision::Angular()))
{ {
mynbext++; 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(); if (!myDone) StdFail_NotDone::Raise();
return myIsPar; return myIsPar;

View File

@ -14,50 +14,24 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class GLocateExtCC from Extrema (Curve1 as any; class LocateExtCC from Extrema
Tool1 as any;
Curve2 as any;
Tool2 as any)
---Purpose: It calculates the distance between two curves with ---Purpose: It calculates the distance between two curves with
-- a close point; these distances can be maximum or -- a close point; these distances can be maximum or
-- minimum. -- minimum.
uses POnCurv from Extrema, uses POnCurv from Extrema,
Pnt from gp, Pnt from gp,
HArray1OfPnt from TColgp HArray1OfPnt from TColgp,
Curve from Adaptor3d,
CurveTool from Extrema
raises DomainError from Standard, raises DomainError from Standard,
NotDone from StdFail 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);
is is
Create (C1: Curve1; C2: Curve2; U0,V0: Real) Create (C1: Curve from Adaptor3d; C2: Curve from Adaptor3d; U0,V0: Real)
returns GLocateExtCC returns LocateExtCC
---Purpose: Calculates the distance with a close point. The ---Purpose: Calculates the distance with a close point. The
-- close point is defined by a parameter value on each -- close point is defined by a parameter value on each
-- curve. -- curve.
@ -91,4 +65,4 @@ fields
myPoint1: POnCurv; myPoint1: POnCurv;
myPoint2: POnCurv; myPoint2: POnCurv;
end GLocateExtCC; end LocateExtCC;

View File

@ -14,16 +14,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include Extrema_ELCC_hxx #include <Extrema_LocateExtCC.ixx>
#include Extrema_LocECC_hxx
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
#include <Extrema_POnCurv.hxx> #include <Extrema_POnCurv.hxx>
#include <Precision.hxx> #include <Precision.hxx>
Extrema_GLocateExtCC::Extrema_GLocateExtCC (const Curve1& C1, #include <Adaptor3d_Curve.hxx>
const Curve2& C2, #include <Extrema_LocECC.hxx>
const Standard_Real U0,
const Standard_Real V0) 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 TolU = C1.Resolution(Precision::Confusion());
Standard_Real TolV = C2.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. // Non implemente pour l instant: l appel a Extrema_ELCC.
Extrema_LocECC Xtrem(C1, C2, Extrema_LocECC Xtrem(C1, C2,
U0, V0, TolU, TolV); U0, V0, TolU, TolV);
// Exploitation // Exploitation
myDone = Xtrem.IsDone(); myDone = Xtrem.IsDone();
@ -43,27 +45,20 @@ Extrema_GLocateExtCC::Extrema_GLocateExtCC (const Curve1& C1,
myPoint1 = P1; myPoint1 = P1;
myPoint2 = P2; myPoint2 = P2;
} }
} }
Standard_Boolean Extrema_LocateExtCC::IsDone () const {
Standard_Boolean Extrema_GLocateExtCC::IsDone () const {
return myDone; return myDone;
} }
Standard_Real Extrema_LocateExtCC::SquareDistance() const {
Standard_Real Extrema_GLocateExtCC::SquareDistance() const {
if (!myDone) { StdFail_NotDone::Raise(); } if (!myDone) { StdFail_NotDone::Raise(); }
return mySqDist; return mySqDist;
} }
void Extrema_LocateExtCC::Point (Extrema_POnCurv& P1, Extrema_POnCurv& P2) const {
void Extrema_GLocateExtCC::Point (Extrema_POnCurv& P1, Extrema_POnCurv& P2) const {
if (!myDone) { StdFail_NotDone::Raise(); } if (!myDone) { StdFail_NotDone::Raise(); }
P1 = myPoint1; P1 = myPoint1;

View File

@ -14,51 +14,26 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class GLocateExtCC2d from Extrema (Curve1 as any; class LocateExtCC2d from Extrema
Tool1 as any;
Curve2 as any;
Tool2 as any)
---Purpose: It calculates the distance between two curves with ---Purpose: It calculates the distance between two curves with
-- a close point; these distances can be maximum or -- a close point; these distances can be maximum or
-- minimum. -- minimum.
uses POnCurv2d from Extrema, uses POnCurv2d from Extrema,
Pnt2d from gp, Pnt2d from gp,
Vec2d from gp, Vec2d from gp,
HArray1OfPnt2d from TColgp HArray1OfPnt2d from TColgp,
Curve2d from Adaptor2d,
Curve2dTool from Extrema,
LCCache2d from Extrema
raises DomainError from Standard, raises DomainError from Standard,
NotDone from StdFail 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);
is is
Create (C1: Curve1; C2: Curve2; U0,V0: Real) Create (C1: Curve2d from Adaptor2d; C2: Curve2d from Adaptor2d; U0,V0: Real)
returns GLocateExtCC2d returns LocateExtCC2d
---Purpose: Calculates the distance with a close point. The ---Purpose: Calculates the distance with a close point. The
-- close point is defined by a parameter value on each -- close point is defined by a parameter value on each
-- curve. -- curve.
@ -92,4 +67,4 @@ fields
myPoint1: POnCurv2d; myPoint1: POnCurv2d;
myPoint2: POnCurv2d; myPoint2: POnCurv2d;
end GLocateExtCC2d; end LocateExtCC2d;

View File

@ -14,26 +14,30 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include Extrema_ELCC2d_hxx #include <Extrema_LocateExtCC2d.hxx>
#include Extrema_LocECC2d_hxx
#include <GeomAbs_CurveType.hxx> #include <GeomAbs_CurveType.hxx>
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
#include <Extrema_POnCurv2d.hxx> #include <Extrema_POnCurv2d.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <Extrema_Curve2dTool.hxx>
#include <Extrema_LocECC2d.hxx>
//======================================================================= //=======================================================================
//function : Extrema_GLocateExtCC2d //function : Extrema_LocateExtCC2d
//purpose : //purpose :
//======================================================================= //=======================================================================
Extrema_GLocateExtCC2d::Extrema_GLocateExtCC2d (const Curve1& C1, Extrema_LocateExtCC2d::Extrema_LocateExtCC2d (const Adaptor2d_Curve2d& C1,
const Curve2& C2, const Adaptor2d_Curve2d& C2,
const Standard_Real U0, const Standard_Real U0,
const Standard_Real V0) const Standard_Real V0)
{ {
Standard_Real TolU = Tool1::Resolution(C1, Precision::Confusion()); Standard_Real TolU = Extrema_Curve2dTool::Resolution(C1, Precision::Confusion());
Standard_Real TolV = Tool2::Resolution(C2, Precision::Confusion()); Standard_Real TolV = Extrema_Curve2dTool::Resolution(C2, Precision::Confusion());
Extrema_POnCurv2d P1, P2; Extrema_POnCurv2d P1, P2;
// Non implemente pour l instant: l appel a Geom2dExtrema_ExtCC. // Non implemente pour l instant: l appel a Geom2dExtrema_ExtCC.
@ -60,7 +64,7 @@ Extrema_GLocateExtCC2d::Extrema_GLocateExtCC2d (const Curve1& C1,
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Extrema_GLocateExtCC2d::IsDone () const { Standard_Boolean Extrema_LocateExtCC2d::IsDone () const {
return myDone; return myDone;
} }
@ -71,7 +75,7 @@ Standard_Boolean Extrema_GLocateExtCC2d::IsDone () const {
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real Extrema_GLocateExtCC2d::SquareDistance() const { Standard_Real Extrema_LocateExtCC2d::SquareDistance() const {
if (!myDone) { StdFail_NotDone::Raise(); } if (!myDone) { StdFail_NotDone::Raise(); }
return mySqDist; return mySqDist;
@ -84,8 +88,8 @@ Standard_Real Extrema_GLocateExtCC2d::SquareDistance() const {
//purpose : //purpose :
//======================================================================= //=======================================================================
void Extrema_GLocateExtCC2d::Point (Extrema_POnCurv2d& P1, void Extrema_LocateExtCC2d::Point (Extrema_POnCurv2d& P1,
Extrema_POnCurv2d& P2) const Extrema_POnCurv2d& P2) const
{ {
if (!myDone) { StdFail_NotDone::Raise(); } if (!myDone) { StdFail_NotDone::Raise(); }
P1 = myPoint1; P1 = myPoint1;

View File

@ -52,8 +52,6 @@ is
class QualifiedCirc; class QualifiedCirc;
generic class QualifiedCurv;
enumeration Position is enumeration Position is
unqualified, enclosing, enclosed, outside, noqualifier; unqualified, enclosing, enclosed, outside, noqualifier;
---Purpose: ---Purpose:

View File

@ -67,68 +67,67 @@ class Lin2d2Tan;
class Lin2dTanObl; class Lin2dTanObl;
class MyQCurve instantiates QualifiedCurv from GccEnt class QCurve;
(Curve from Geom2dAdaptor);
class MyCurveTool instantiates CurvePGTool from GccGeo class MyCurveTool instantiates CurvePGTool from GccGeo
(Curve from Geom2dAdaptor, (Curve from Geom2dAdaptor,
CurveTool from Geom2dGcc , CurveTool from Geom2dGcc,
OffsetCurve from Adaptor3d); OffsetCurve from Adaptor3d);
class MyCirc2d2TanOn instantiates Circ2d2TanOn from GccGeo class MyCirc2d2TanOn instantiates Circ2d2TanOn from GccGeo
(Curve from Geom2dAdaptor, (Curve from Geom2dAdaptor,
CurveTool from Geom2dGcc, CurveTool from Geom2dGcc,
MyQCurve from Geom2dGcc, QCurve from Geom2dGcc,
OffsetCurve from Adaptor3d, OffsetCurve from Adaptor3d,
HCurve from Geom2dAdaptor, HCurve from Geom2dAdaptor,
MyCurveTool from Geom2dGcc, MyCurveTool from Geom2dGcc,
TheIntConicCurveOfGInter from Geom2dInt); TheIntConicCurveOfGInter from Geom2dInt);
class MyCirc2d2TanRad instantiates Circ2d2TanRad from GccGeo class MyCirc2d2TanRad instantiates Circ2d2TanRad from GccGeo
(Curve from Geom2dAdaptor , (Curve from Geom2dAdaptor,
CurveTool from Geom2dGcc, CurveTool from Geom2dGcc,
MyQCurve from Geom2dGcc, QCurve from Geom2dGcc,
OffsetCurve from Adaptor3d, OffsetCurve from Adaptor3d,
HCurve from Geom2dAdaptor, HCurve from Geom2dAdaptor,
MyCurveTool from Geom2dGcc, MyCurveTool from Geom2dGcc,
TheIntConicCurveOfGInter from Geom2dInt, TheIntConicCurveOfGInter from Geom2dInt,
GInter from Geom2dInt); GInter from Geom2dInt);
class MyCirc2dTanOnRad instantiates Circ2dTanOnRad from GccGeo class MyCirc2dTanOnRad instantiates Circ2dTanOnRad from GccGeo
(Curve from Geom2dAdaptor , (Curve from Geom2dAdaptor ,
CurveTool from Geom2dGcc, CurveTool from Geom2dGcc,
MyQCurve from Geom2dGcc, QCurve from Geom2dGcc,
OffsetCurve from Adaptor3d, OffsetCurve from Adaptor3d,
HCurve from Geom2dAdaptor, HCurve from Geom2dAdaptor,
MyCurveTool from Geom2dGcc, MyCurveTool from Geom2dGcc,
TheIntConicCurveOfGInter from Geom2dInt, TheIntConicCurveOfGInter from Geom2dInt,
GInter from Geom2dInt); GInter from Geom2dInt);
class MyC2d3Tan instantiates Circ2d3Tan from GccIter class MyC2d3Tan instantiates Circ2d3Tan from GccIter
(Curve from Geom2dAdaptor, (Curve from Geom2dAdaptor,
CurveTool from Geom2dGcc, CurveTool from Geom2dGcc,
MyQCurve from Geom2dGcc); QCurve from Geom2dGcc);
class MyCirc2dTanCen instantiates Circ2dTanCen from GccGeo class MyCirc2dTanCen instantiates Circ2dTanCen from GccGeo
(Curve from Geom2dAdaptor, (Curve from Geom2dAdaptor,
CurveTool from Geom2dGcc, CurveTool from Geom2dGcc,
ExtPC2d from Extrema, ExtPC2d from Extrema,
MyQCurve from Geom2dGcc); QCurve from Geom2dGcc);
class MyC2d2TanOn instantiates Circ2d2TanOn from GccIter class MyC2d2TanOn instantiates Circ2d2TanOn from GccIter
(Curve from Geom2dAdaptor, (Curve from Geom2dAdaptor,
CurveTool from Geom2dGcc, CurveTool from Geom2dGcc,
MyQCurve from Geom2dGcc); QCurve from Geom2dGcc);
class MyL2dTanObl instantiates Lin2dTanObl from GccIter class MyL2dTanObl instantiates Lin2dTanObl from GccIter
(Curve from Geom2dAdaptor, (Curve from Geom2dAdaptor,
CurveTool from Geom2dGcc, CurveTool from Geom2dGcc,
MyQCurve from Geom2dGcc); QCurve from Geom2dGcc);
class MyL2d2Tan instantiates Lin2d2Tan from GccIter class MyL2d2Tan instantiates Lin2d2Tan from GccIter
(Curve from Geom2dAdaptor, (Curve from Geom2dAdaptor,
CurveTool from Geom2dGcc, CurveTool from Geom2dGcc,
MyQCurve from Geom2dGcc); QCurve from Geom2dGcc);
Unqualified(Obj : Curve from Geom2dAdaptor) returns QualifiedCurve; Unqualified(Obj : Curve from Geom2dAdaptor) returns QualifiedCurve;
---Purpose: Constructs such a qualified curve that the relative ---Purpose: Constructs such a qualified curve that the relative

View File

@ -19,7 +19,7 @@
#include <GccAna_Circ2d2TanOn.hxx> #include <GccAna_Circ2d2TanOn.hxx>
#include <Geom2dGcc_MyCirc2d2TanOn.hxx> #include <Geom2dGcc_MyCirc2d2TanOn.hxx>
#include <Geom2dGcc_MyC2d2TanOn.hxx> #include <Geom2dGcc_MyC2d2TanOn.hxx>
#include <Geom2dGcc_MyQCurve.hxx> #include <Geom2dGcc_QCurve.hxx>
#include <GccEnt_BadQualifier.hxx> #include <GccEnt_BadQualifier.hxx>
#include <Geom2d_Circle.hxx> #include <Geom2d_Circle.hxx>
#include <Geom2d_Line.hxx> #include <Geom2d_Line.hxx>
@ -273,8 +273,8 @@ Geom2dGcc_Circ2d2TanOn::
//============================================================================= //=============================================================================
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier());
if ((Type3 == GeomAbs_Circle || Type3 == GeomAbs_Line)) { if ((Type3 == GeomAbs_Circle || Type3 == GeomAbs_Line)) {
if (Type3 == GeomAbs_Circle) { if (Type3 == GeomAbs_Circle) {
Handle(Geom2d_Circle) CCon = Handle(Geom2d_Circle)::DownCast(Con); Handle(Geom2d_Circle) CCon = Handle(Geom2d_Circle)::DownCast(Con);
@ -445,7 +445,7 @@ Geom2dGcc_Circ2d2TanOn::
//============================================================================= //=============================================================================
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
if ((Type3 == GeomAbs_Circle || Type3 == GeomAbs_Line)) { if ((Type3 == GeomAbs_Circle || Type3 == GeomAbs_Line)) {
if (Type3 == GeomAbs_Circle) { if (Type3 == GeomAbs_Circle) {
Handle(Geom2d_Circle) CCon = Handle(Geom2d_Circle)::DownCast(Con); Handle(Geom2d_Circle) CCon = Handle(Geom2d_Circle)::DownCast(Con);

View File

@ -18,7 +18,7 @@
#include <Geom2dAdaptor_Curve.hxx> #include <Geom2dAdaptor_Curve.hxx>
#include <GccAna_Circ2d2TanRad.hxx> #include <GccAna_Circ2d2TanRad.hxx>
#include <Geom2dGcc_MyCirc2d2TanRad.hxx> #include <Geom2dGcc_MyCirc2d2TanRad.hxx>
#include <Geom2dGcc_MyQCurve.hxx> #include <Geom2dGcc_QCurve.hxx>
#include <GccEnt_BadQualifier.hxx> #include <GccEnt_BadQualifier.hxx>
#include <Geom2d_Circle.hxx> #include <Geom2d_Circle.hxx>
#include <Geom2d_Line.hxx> #include <Geom2d_Line.hxx>
@ -177,7 +177,7 @@ Geom2dGcc_Circ2d2TanRad::
else { else {
GccEnt_QualifiedLin Ql1 = GccEnt_QualifiedLin(l1, GccEnt_QualifiedLin Ql1 = GccEnt_QualifiedLin(l1,
Qualified1.Qualifier()); Qualified1.Qualifier());
Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier());
Geom2dGcc_MyCirc2d2TanRad CircGeo(Ql1,Qc2,Radius,Tolerance); Geom2dGcc_MyCirc2d2TanRad CircGeo(Ql1,Qc2,Radius,Tolerance);
WellDone = CircGeo.IsDone(); WellDone = CircGeo.IsDone();
NbrSol = CircGeo.NbSolutions(); NbrSol = CircGeo.NbSolutions();
@ -192,7 +192,7 @@ Geom2dGcc_Circ2d2TanRad::
gp_Circ2d c1(CCC1->Circ2d()); gp_Circ2d c1(CCC1->Circ2d());
GccEnt_QualifiedCirc Qc1 = GccEnt_QualifiedCirc(c1, GccEnt_QualifiedCirc Qc1 = GccEnt_QualifiedCirc(c1,
Qualified1.Qualifier()); Qualified1.Qualifier());
Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier());
Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc1,Qc2,Radius,Tolerance); Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc1,Qc2,Radius,Tolerance);
WellDone = CircGeo.IsDone(); WellDone = CircGeo.IsDone();
NbrSol = CircGeo.NbSolutions(); NbrSol = CircGeo.NbSolutions();
@ -212,7 +212,7 @@ Geom2dGcc_Circ2d2TanRad::
else { else {
GccEnt_QualifiedLin Ql2 = GccEnt_QualifiedLin(l2, GccEnt_QualifiedLin Ql2 = GccEnt_QualifiedLin(l2,
Qualified2.Qualifier()); Qualified2.Qualifier());
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyCirc2d2TanRad CircGeo(Ql2,Qc1,Radius,Tolerance); Geom2dGcc_MyCirc2d2TanRad CircGeo(Ql2,Qc1,Radius,Tolerance);
WellDone = CircGeo.IsDone(); WellDone = CircGeo.IsDone();
NbrSol = CircGeo.NbSolutions(); NbrSol = CircGeo.NbSolutions();
@ -228,7 +228,7 @@ Geom2dGcc_Circ2d2TanRad::
gp_Circ2d c2(CCC2->Circ2d()); gp_Circ2d c2(CCC2->Circ2d());
GccEnt_QualifiedCirc Qc2 = GccEnt_QualifiedCirc(c2, GccEnt_QualifiedCirc Qc2 = GccEnt_QualifiedCirc(c2,
Qualified2.Qualifier()); Qualified2.Qualifier());
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc2,Qc1,Radius,Tolerance); Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc2,Qc1,Radius,Tolerance);
WellDone = CircGeo.IsDone(); WellDone = CircGeo.IsDone();
NbrSol = CircGeo.NbSolutions(); NbrSol = CircGeo.NbSolutions();
@ -238,8 +238,8 @@ Geom2dGcc_Circ2d2TanRad::
Results(CircGeo); Results(CircGeo);
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier());
Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc1,Qc2,Radius,Tolerance); Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc1,Qc2,Radius,Tolerance);
WellDone = CircGeo.IsDone(); WellDone = CircGeo.IsDone();
NbrSol = CircGeo.NbSolutions(); NbrSol = CircGeo.NbSolutions();
@ -311,7 +311,7 @@ Geom2dGcc_Circ2d2TanRad::
// Appel a GccGeo. + // Appel a GccGeo. +
//============================================================================= //=============================================================================
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc1,Point->Pnt2d(),Radius,Tolerance); Geom2dGcc_MyCirc2d2TanRad CircGeo(Qc1,Point->Pnt2d(),Radius,Tolerance);
WellDone = CircGeo.IsDone(); WellDone = CircGeo.IsDone();
NbrSol = CircGeo.NbSolutions(); NbrSol = CircGeo.NbSolutions();

View File

@ -18,7 +18,7 @@
#include <Geom2dAdaptor_Curve.hxx> #include <Geom2dAdaptor_Curve.hxx>
#include <Geom2d_Line.hxx> #include <Geom2d_Line.hxx>
#include <Geom2d_Circle.hxx> #include <Geom2d_Circle.hxx>
#include <Geom2dGcc_MyQCurve.hxx> #include <Geom2dGcc_QCurve.hxx>
#include <Geom2dGcc_MyC2d3Tan.hxx> #include <Geom2dGcc_MyC2d3Tan.hxx>
#include <GccEnt_QualifiedCirc.hxx> #include <GccEnt_QualifiedCirc.hxx>
#include <GccEnt_QualifiedLin.hxx> #include <GccEnt_QualifiedLin.hxx>
@ -212,9 +212,9 @@ Geom2dGcc_Circ2d3Tan::
} }
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier());
Geom2dGcc_MyQCurve Qc3(C3,Qualified3.Qualifier()); Geom2dGcc_QCurve Qc3(C3,Qualified3.Qualifier());
Geom2dGcc_MyC2d3Tan Circ(Qc1,Qc2,Qc3,Param1,Param2,Param3,Tolerance); Geom2dGcc_MyC2d3Tan Circ(Qc1,Qc2,Qc3,Param1,Param2,Param3,Tolerance);
WellDone = Circ.IsDone(); WellDone = Circ.IsDone();
NbrSol = 1; NbrSol = 1;
@ -332,8 +332,8 @@ Geom2dGcc_Circ2d3Tan::
} }
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier());
Geom2dGcc_MyC2d3Tan Circ(Qc1,Qc2,Point->Pnt2d(),Param1,Param2,Tolerance); Geom2dGcc_MyC2d3Tan Circ(Qc1,Qc2,Point->Pnt2d(),Param1,Param2,Tolerance);
WellDone = Circ.IsDone(); WellDone = Circ.IsDone();
NbrSol = 1; NbrSol = 1;
@ -412,7 +412,7 @@ Geom2dGcc_Circ2d3Tan::
} }
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyC2d3Tan Circ(Qc1,Point1->Pnt2d(),Point2->Pnt2d(), Geom2dGcc_MyC2d3Tan Circ(Qc1,Point1->Pnt2d(),Point2->Pnt2d(),
Param1,Tolerance); Param1,Tolerance);
WellDone = Circ.IsDone(); WellDone = Circ.IsDone();

View File

@ -18,7 +18,7 @@
#include <Geom2dAdaptor_Curve.hxx> #include <Geom2dAdaptor_Curve.hxx>
#include <GccAna_Circ2dTanCen.hxx> #include <GccAna_Circ2dTanCen.hxx>
#include <Geom2dGcc_MyCirc2dTanCen.hxx> #include <Geom2dGcc_MyCirc2dTanCen.hxx>
#include <Geom2dGcc_MyQCurve.hxx> #include <Geom2dGcc_QCurve.hxx>
#include <GccEnt_BadQualifier.hxx> #include <GccEnt_BadQualifier.hxx>
#include <Geom2d_Circle.hxx> #include <Geom2d_Circle.hxx>
#include <Geom2d_Line.hxx> #include <Geom2d_Line.hxx>
@ -84,7 +84,7 @@ Geom2dGcc_Circ2dTanCen::
//============================================================================= //=============================================================================
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyCirc2dTanCen Circ(Qc1,pcenter,Tolerance); Geom2dGcc_MyCirc2dTanCen Circ(Qc1,pcenter,Tolerance);
WellDone = Circ.IsDone(); WellDone = Circ.IsDone();
NbrSol = Circ.NbSolutions(); NbrSol = Circ.NbSolutions();

View File

@ -18,7 +18,7 @@
#include <Geom2dAdaptor_Curve.hxx> #include <Geom2dAdaptor_Curve.hxx>
#include <GccAna_Circ2dTanOnRad.hxx> #include <GccAna_Circ2dTanOnRad.hxx>
#include <Geom2dGcc_MyCirc2dTanOnRad.hxx> #include <Geom2dGcc_MyCirc2dTanOnRad.hxx>
#include <Geom2dGcc_MyQCurve.hxx> #include <Geom2dGcc_QCurve.hxx>
#include <GccEnt_BadQualifier.hxx> #include <GccEnt_BadQualifier.hxx>
#include <Geom2d_Circle.hxx> #include <Geom2d_Circle.hxx>
#include <Geom2d_Line.hxx> #include <Geom2d_Line.hxx>
@ -129,7 +129,7 @@ Geom2dGcc_Circ2dTanOnRad::
Results(CircGeo); Results(CircGeo);
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyCirc2dTanOnRad CircGeo(Qc1,OnCurve,Radius,Tolerance); Geom2dGcc_MyCirc2dTanOnRad CircGeo(Qc1,OnCurve,Radius,Tolerance);
WellDone = CircGeo.IsDone(); WellDone = CircGeo.IsDone();
NbrSol = CircGeo.NbSolutions(); NbrSol = CircGeo.NbSolutions();

View File

@ -15,7 +15,7 @@
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <Geom2dGcc_Lin2d2Tan.ixx> #include <Geom2dGcc_Lin2d2Tan.ixx>
#include <Geom2dGcc_MyQCurve.hxx> #include <Geom2dGcc_QCurve.hxx>
#include <GccAna_Lin2d2Tan.hxx> #include <GccAna_Lin2d2Tan.hxx>
#include <Geom2dGcc_MyL2d2Tan.hxx> #include <Geom2dGcc_MyL2d2Tan.hxx>
#include <Geom2d_Circle.hxx> #include <Geom2d_Circle.hxx>
@ -74,13 +74,13 @@ Geom2dGcc_Lin2d2Tan::
} }
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Standard_Real a1FPar = Geom2dGcc_CurveTool::FirstParameter(C1); Standard_Real a1FPar = Geom2dGcc_CurveTool::FirstParameter(C1);
Standard_Real a1LPar = Geom2dGcc_CurveTool::LastParameter(C1); Standard_Real a1LPar = Geom2dGcc_CurveTool::LastParameter(C1);
Standard_Integer aNbSamples1 = Geom2dGcc_CurveTool::NbSamples(C1); Standard_Integer aNbSamples1 = Geom2dGcc_CurveTool::NbSamples(C1);
Standard_Real aStep1 = (a1LPar - a1FPar)/aNbSamples1; Standard_Real aStep1 = (a1LPar - a1FPar)/aNbSamples1;
Standard_Real Param1 = a1FPar; 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 a2FPar = Geom2dGcc_CurveTool::FirstParameter(C2);
Standard_Real a2LPar = Geom2dGcc_CurveTool::LastParameter(C2); Standard_Real a2LPar = Geom2dGcc_CurveTool::LastParameter(C2);
Standard_Integer aNbSamples2 = Geom2dGcc_CurveTool::NbSamples(C2); Standard_Integer aNbSamples2 = Geom2dGcc_CurveTool::NbSamples(C2);
@ -149,7 +149,7 @@ Geom2dGcc_Lin2d2Tan::
} }
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Standard_Real aFirstPar = Geom2dGcc_CurveTool::FirstParameter(C1); Standard_Real aFirstPar = Geom2dGcc_CurveTool::FirstParameter(C1);
Standard_Real aLastPar = Geom2dGcc_CurveTool::LastParameter(C1); Standard_Real aLastPar = Geom2dGcc_CurveTool::LastParameter(C1);
Standard_Integer aNbSamples = Geom2dGcc_CurveTool::NbSamples(C1); Standard_Integer aNbSamples = Geom2dGcc_CurveTool::NbSamples(C1);
@ -224,8 +224,8 @@ Geom2dGcc_Lin2d2Tan::
} }
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyQCurve Qc2(C2,Qualified2.Qualifier()); Geom2dGcc_QCurve Qc2(C2,Qualified2.Qualifier());
Geom2dGcc_MyL2d2Tan Lin(Qc1,Qc2,Param1,Param2,Tolang); Geom2dGcc_MyL2d2Tan Lin(Qc1,Qc2,Param1,Param2,Tolang);
WellDone = Lin.IsDone(); WellDone = Lin.IsDone();
// Modified by Sergey KHROMOV - Thu Apr 5 17:51:59 2001 Begin // Modified by Sergey KHROMOV - Thu Apr 5 17:51:59 2001 Begin
@ -283,7 +283,7 @@ Geom2dGcc_Lin2d2Tan::
} }
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyL2d2Tan Lin(Qc1,ThePoint,Param1,Tolang); Geom2dGcc_MyL2d2Tan Lin(Qc1,ThePoint,Param1,Tolang);
WellDone = Lin.IsDone(); WellDone = Lin.IsDone();
// Modified by Sergey KHROMOV - Thu Apr 5 17:53:01 2001 Begin // Modified by Sergey KHROMOV - Thu Apr 5 17:53:01 2001 Begin

View File

@ -15,7 +15,7 @@
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <Geom2dGcc_Lin2dTanObl.ixx> #include <Geom2dGcc_Lin2dTanObl.ixx>
#include <Geom2dGcc_MyQCurve.hxx> #include <Geom2dGcc_QCurve.hxx>
#include <GccAna_Lin2dTanObl.hxx> #include <GccAna_Lin2dTanObl.hxx>
#include <Geom2dGcc_MyL2dTanObl.hxx> #include <Geom2dGcc_MyL2dTanObl.hxx>
#include <Geom2d_Circle.hxx> #include <Geom2d_Circle.hxx>
@ -66,7 +66,7 @@ Geom2dGcc_Lin2dTanObl::
} }
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Standard_Real aFirstPar = Geom2dGcc_CurveTool::FirstParameter(C1); Standard_Real aFirstPar = Geom2dGcc_CurveTool::FirstParameter(C1);
Standard_Real aLastPar = Geom2dGcc_CurveTool::LastParameter(C1); Standard_Real aLastPar = Geom2dGcc_CurveTool::LastParameter(C1);
Standard_Integer aNbSamples = Geom2dGcc_CurveTool::NbSamples(C1); Standard_Integer aNbSamples = Geom2dGcc_CurveTool::NbSamples(C1);
@ -131,7 +131,7 @@ Geom2dGcc_Lin2dTanObl::
} }
} }
else { else {
Geom2dGcc_MyQCurve Qc1(C1,Qualified1.Qualifier()); Geom2dGcc_QCurve Qc1(C1,Qualified1.Qualifier());
Geom2dGcc_MyL2dTanObl Lin(Qc1,TheLine,TolAng,Param1,Angle); Geom2dGcc_MyL2dTanObl Lin(Qc1,TheLine,TolAng,Param1,Angle);
WellDone = Lin.IsDone(); WellDone = Lin.IsDone();
if(WellDone) { if(WellDone) {

View File

@ -14,20 +14,21 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class QualifiedCurv from GccEnt (TheCurve as any) class QCurve from Geom2dGcc
---Purpose: Creates a qualified 2d line. ---Purpose: Creates a qualified 2d line.
uses Position from GccEnt uses Position from GccEnt,
Curve from Geom2dAdaptor
is is
Create(Curve : TheCurve ; Create(Curve : Curve from Geom2dAdaptor;
Qualifier : Position from GccEnt ) Qualifier : Position from GccEnt )
returns QualifiedCurv from GccEnt; returns QCurve from Geom2dGcc;
-- is private; -- is private;
Qualified(me) returns TheCurve Qualified(me) returns Curve from Geom2dAdaptor
is static; is static;
Qualifier(me) returns Position from GccEnt Qualifier(me) returns Position from GccEnt
@ -56,15 +57,8 @@ is static;
fields fields
TheQualifier : Position from GccEnt; TheQualifier : Position from GccEnt;
TheQualified : TheCurve; TheQualified : Curve from Geom2dAdaptor;
-- friends end QCurve;
-- Unqualified(Obj : Curv2d) from GccEnt,
-- Enclosing (Obj : Curv2d) from GccEnt,
-- Enclosed (Obj : Curv2d) from GccEnt,
-- Outside (Obj : Curv2d) from GccEnt
end QualifiedCurv;

View File

@ -12,38 +12,42 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
TheCurve GccEnt_QualifiedCurv:: #include <Geom2dGcc_QCurve.ixx>
//#include <Geom2dAdaptor_Curve.hxx>
Geom2dAdaptor_Curve Geom2dGcc_QCurve::
Qualified () const { return TheQualified; } Qualified () const { return TheQualified; }
GccEnt_Position GccEnt_QualifiedCurv:: GccEnt_Position Geom2dGcc_QCurve::
Qualifier () const { return TheQualifier; } Qualifier () const { return TheQualifier; }
Standard_Boolean GccEnt_QualifiedCurv:: Standard_Boolean Geom2dGcc_QCurve::
IsUnqualified () const { IsUnqualified () const {
if (TheQualifier == GccEnt_unqualified ) { return Standard_True; } if (TheQualifier == GccEnt_unqualified ) { return Standard_True; }
else { return Standard_False; } else { return Standard_False; }
} }
Standard_Boolean GccEnt_QualifiedCurv:: Standard_Boolean Geom2dGcc_QCurve::
IsEnclosing () const { IsEnclosing () const {
if (TheQualifier == GccEnt_enclosing) { return Standard_True; } if (TheQualifier == GccEnt_enclosing) { return Standard_True; }
else { return Standard_False; } else { return Standard_False; }
} }
Standard_Boolean GccEnt_QualifiedCurv:: Standard_Boolean Geom2dGcc_QCurve::
IsEnclosed () const { IsEnclosed () const {
if (TheQualifier == GccEnt_enclosed) { return Standard_True; } if (TheQualifier == GccEnt_enclosed) { return Standard_True; }
else { return Standard_False; } else { return Standard_False; }
} }
Standard_Boolean GccEnt_QualifiedCurv:: Standard_Boolean Geom2dGcc_QCurve::
IsOutside () const { IsOutside () const {
if (TheQualifier == GccEnt_outside) { return Standard_True; } if (TheQualifier == GccEnt_outside) { return Standard_True; }
else { return Standard_False; } else { return Standard_False; }
} }
GccEnt_QualifiedCurv:: Geom2dGcc_QCurve::
GccEnt_QualifiedCurv (const TheCurve& Curve, Geom2dGcc_QCurve (const Geom2dAdaptor_Curve& Curve,
const GccEnt_Position Qualifier) { const GccEnt_Position Qualifier) {
TheQualified = Curve; TheQualified = Curve;
TheQualifier = Qualifier; TheQualifier = Qualifier;

View File

@ -17,18 +17,38 @@
package Geom2dHatch package Geom2dHatch
uses uses
Geom2dAdaptor , Geom2dAdaptor,
Geom2dInt , Geom2dInt,
gp , gp,
HatchGen HatchGen,
TCollection,
TColStd,
TopClass,
TopAbs
is is
class Intersector ; class Intersector ;
class Hatcher instantiates Hatcher from HatchGen class Hatcher;
(Curve from Geom2dAdaptor,
Curve from Geom2dAdaptor, class Element;
Intersector from Geom2dHatch) ; 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 ; end Geom2dHatch ;

View File

@ -14,31 +14,32 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class ElementGen from HatchGen (TheElementCurve as any) class Element from Geom2dHatch
uses uses
Orientation from TopAbs Orientation from TopAbs,
Curve from Geom2dAdaptor
is is
Create Create
returns ElementGen from HatchGen; returns Element from Geom2dHatch;
Create (Other : ElementGen from HatchGen) Create (Other : Element from Geom2dHatch)
---Purpose: Magic constructor. ---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) Orientation : Orientation from TopAbs = TopAbs_FORWARD)
---Purpose: Creates an element. ---Purpose: Creates an element.
returns ElementGen from HatchGen ; returns Element from Geom2dHatch ;
Curve (me) Curve (me)
@ -47,7 +48,7 @@ is
---C++: return const & ---C++: return const &
returns TheElementCurve returns Curve from Geom2dAdaptor
is static ; is static ;
@ -57,7 +58,7 @@ is
---C++: return & ---C++: return &
returns TheElementCurve returns Curve from Geom2dAdaptor
is static ; is static ;
@ -78,7 +79,7 @@ is
fields fields
myCurve : TheElementCurve ; myCurve : Curve from Geom2dAdaptor ;
myOrientation : Orientation from TopAbs ; myOrientation : Orientation from TopAbs ;
end ElementGen from HatchGen ; end Element from Geom2dHatch;

View File

@ -15,28 +15,32 @@
// commercial license or contractual agreement. // commercial license or contractual agreement.
//======================================================================= //=======================================================================
// Function : HatchGen_ElementGen // Function : Geom2dHatch_Element
// Purpose : Magic Constructor. // Purpose : Magic Constructor.
//======================================================================= //=======================================================================
HatchGen_ElementGen::HatchGen_ElementGen (const HatchGen_ElementGen& Other) #include <Geom2dHatch_Element.ixx>
#include <Geom2dAdaptor_Curve.hxx>
Geom2dHatch_Element::Geom2dHatch_Element (const Geom2dHatch_Element& Other)
: myCurve(Other.myCurve), myOrientation(Other.myOrientation) { : myCurve(Other.myCurve), myOrientation(Other.myOrientation) {
} }
//======================================================================= //=======================================================================
// Function : HatchGen_ElementGen // Function : Geom2dHatch_Element
// Purpose : Empty Constructor. // Purpose : Empty Constructor.
//======================================================================= //=======================================================================
HatchGen_ElementGen::HatchGen_ElementGen () { Geom2dHatch_Element::Geom2dHatch_Element () {
} }
//======================================================================= //=======================================================================
// Function : HatchGen_ElementGen // Function : Geom2dHatch_Element
// Purpose : Constructor. // Purpose : Constructor.
//======================================================================= //=======================================================================
HatchGen_ElementGen::HatchGen_ElementGen (const TheElementCurve& Curve, Geom2dHatch_Element::Geom2dHatch_Element (const Geom2dAdaptor_Curve& Curve,
const TopAbs_Orientation Orientation) : const TopAbs_Orientation Orientation) :
myCurve (Curve), myCurve (Curve),
myOrientation (Orientation) myOrientation (Orientation)
@ -48,7 +52,7 @@ HatchGen_ElementGen::HatchGen_ElementGen (const TheElementCurve& Curve,
// Purpose : Returns the curve associated to the hatching. // Purpose : Returns the curve associated to the hatching.
//======================================================================= //=======================================================================
const TheElementCurve& HatchGen_ElementGen::Curve () const const Geom2dAdaptor_Curve& Geom2dHatch_Element::Curve () const
{ {
return myCurve ; return myCurve ;
} }
@ -58,7 +62,7 @@ const TheElementCurve& HatchGen_ElementGen::Curve () const
// Purpose : Returns the curve associated to the hatching. // Purpose : Returns the curve associated to the hatching.
//======================================================================= //=======================================================================
TheElementCurve& HatchGen_ElementGen::ChangeCurve () Geom2dAdaptor_Curve& Geom2dHatch_Element::ChangeCurve ()
{ {
return myCurve ; return myCurve ;
} }
@ -68,7 +72,7 @@ TheElementCurve& HatchGen_ElementGen::ChangeCurve ()
// Purpose : Sets the orientation of the element. // 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 ; myOrientation = Orientation ;
} }
@ -78,7 +82,7 @@ void HatchGen_ElementGen::Orientation (const TopAbs_Orientation Orientation)
// Purpose : Returns the orientation of the element. // Purpose : Returns the orientation of the element.
//======================================================================= //=======================================================================
TopAbs_Orientation HatchGen_ElementGen::Orientation () const TopAbs_Orientation Geom2dHatch_Element::Orientation () const
{ {
return myOrientation ; return myOrientation ;
} }

View File

@ -17,37 +17,32 @@
-- Modified by skv - Fri Jul 14 16:46:18 2006 OCC12627 -- Modified by skv - Fri Jul 14 16:46:18 2006 OCC12627
generic class ElementsGen from HatchGen class Elements from Geom2dHatch
(TheKey as any;
TheItem as any;
TheHasher as any;
TheCurve as any)
uses uses
Orientation from TopAbs, Orientation from TopAbs,
Lin2d from gp, 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 raises
DomainError from Standard, DomainError from Standard,
NoSuchObject from Standard NoSuchObject from Standard
private class MapOfElements from HatchGen instantiates
DataMap from TCollection
(TheKey,
TheItem,
TheHasher);
is is
Create Create
returns ElementsGen from HatchGen; returns Elements from Geom2dHatch;
Create(Other : ElementsGen from HatchGen) Create(Other : Elements from Geom2dHatch)
returns ElementsGen from HatchGen; returns Elements from Geom2dHatch;
@ -60,22 +55,22 @@ is
---C++: alias ~ ---C++: alias ~
is static; 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; is static;
IsBound(me; K : TheKey) returns Boolean IsBound(me; K : Integer from Standard) returns Boolean
is static; is static;
UnBind(me : in out; K : TheKey) returns Boolean UnBind(me : in out; K : Integer from Standard) returns Boolean
is static; 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 <K> is not in the map. raises NoSuchObject from Standard -- when <K> is not in the map.
---C++: alias operator() ---C++: alias operator()
---C++: return const & ---C++: return const &
is static; 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 <K> is not in the map. raises NoSuchObject from Standard -- when <K> is not in the map.
---C++: alias operator() ---C++: alias operator()
---C++: return & ---C++: return &
@ -136,17 +131,17 @@ is
returns Boolean from Standard returns Boolean from Standard
is static; is static;
CurrentEdge(me; E : out TheCurve; CurrentEdge(me; E : out Curve from Geom2dAdaptor;
Or : out Orientation from TopAbs) Or : out Orientation from TopAbs)
is static; is static;
fields fields
myMap : MapOfElements; myMap : MapOfElements from Geom2dHatch;
Iter : DataMapIteratorOfMapOfElements; Iter : DataMapIteratorOfMapOfElements;
NumWire : Integer from Standard; NumWire : Integer from Standard;
NumEdge : Integer from Standard; NumEdge : Integer from Standard;
myCurEdge: Integer from Standard; myCurEdge: Integer from Standard;
end ElementsGen from HatchGen; end Elements from Geom2dHatch;

View File

@ -16,42 +16,56 @@
// Modified by skv - Fri Jul 14 17:03:47 2006 OCC12627 // Modified by skv - Fri Jul 14 17:03:47 2006 OCC12627
#include <Geom2dHatch_Elements.ixx>
#include <Standard_Integer.hxx>
#include <Geom2dHatch_Element.hxx>
#include <TColStd_MapIntegerHasher.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <TopAbs_Orientation.hxx> #include <TopAbs_Orientation.hxx>
#include <gp.hxx> #include <gp.hxx>
#include <gp_Vec2d.hxx> #include <gp_Vec2d.hxx>
//HatchGen_ElementsGen::HatchGen_ElementsGen(const HatchGen_ElementsGen& Other) { Geom2dHatch_Elements::Geom2dHatch_Elements(const Geom2dHatch_Elements& )
HatchGen_ElementsGen::HatchGen_ElementsGen(const HatchGen_ElementsGen& ) { {
cout<<" Magic Constructor in HatchGen_ElementsGen:: "<<endl; cout<<" Magic Constructor in Geom2dHatch_Elements:: "<<endl;
} }
HatchGen_ElementsGen::HatchGen_ElementsGen() { Geom2dHatch_Elements::Geom2dHatch_Elements()
{
NumWire = 0; NumWire = 0;
NumEdge = 0; NumEdge = 0;
myCurEdge = 1; myCurEdge = 1;
} }
void HatchGen_ElementsGen::Clear() { void Geom2dHatch_Elements::Clear()
{
myMap.Clear(); myMap.Clear();
} }
Standard_Boolean HatchGen_ElementsGen::IsBound(const TheKey& K) const { Standard_Boolean Geom2dHatch_Elements::IsBound(const Standard_Integer K) const
{
return(myMap.IsBound(K)); return(myMap.IsBound(K));
} }
Standard_Boolean HatchGen_ElementsGen::UnBind(const TheKey& K) { Standard_Boolean Geom2dHatch_Elements::UnBind(const Standard_Integer K)
{
return(myMap.UnBind(K)); return(myMap.UnBind(K));
} }
Standard_Boolean HatchGen_ElementsGen::Bind(const TheKey& K,const TheItem& I) { Standard_Boolean Geom2dHatch_Elements::Bind(const Standard_Integer K,const Geom2dHatch_Element& I)
{
return(myMap.Bind(K,I)); return(myMap.Bind(K,I));
} }
const TheItem& HatchGen_ElementsGen::Find(const TheKey& K) const { const Geom2dHatch_Element& Geom2dHatch_Elements::Find(const Standard_Integer K) const
{
return(myMap.Find(K)); return(myMap.Find(K));
} }
TheItem& HatchGen_ElementsGen::ChangeFind(const TheKey& K) { Geom2dHatch_Element& Geom2dHatch_Elements::ChangeFind(const Standard_Integer K)
{
return(myMap.ChangeFind(K)); return(myMap.ChangeFind(K));
} }
@ -60,7 +74,7 @@ TheItem& HatchGen_ElementsGen::ChangeFind(const TheKey& K) {
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_ElementsGen::Reject(const gp_Pnt2d&) const { Standard_Boolean Geom2dHatch_Elements::Reject(const gp_Pnt2d&) const {
return Standard_False; return Standard_False;
} }
@ -69,7 +83,7 @@ Standard_Boolean HatchGen_ElementsGen::Reject(const gp_Pnt2d&) const {
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_ElementsGen::Segment(const gp_Pnt2d& P, Standard_Boolean Geom2dHatch_Elements::Segment(const gp_Pnt2d& P,
gp_Lin2d& L, gp_Lin2d& L,
Standard_Real& Par) Standard_Real& Par)
{ {
@ -83,11 +97,11 @@ Standard_Boolean HatchGen_ElementsGen::Segment(const gp_Pnt2d& P,
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_ElementsGen::OtherSegment(const gp_Pnt2d& P, Standard_Boolean Geom2dHatch_Elements::OtherSegment(const gp_Pnt2d& P,
gp_Lin2d& L, gp_Lin2d& L,
Standard_Real& Par) Standard_Real& Par)
{ {
HatchGen_DataMapIteratorOfMapOfElements Itertemp; Geom2dHatch_DataMapIteratorOfMapOfElements Itertemp;
Standard_Integer i; Standard_Integer i;
for( Itertemp.Initialize(myMap), i = 1; Itertemp.More(); Itertemp.Next(), i++) { for( Itertemp.Initialize(myMap), i = 1; Itertemp.More(); Itertemp.Next(), i++) {
@ -95,8 +109,8 @@ Standard_Boolean HatchGen_ElementsGen::OtherSegment(const gp_Pnt2d& P,
continue; continue;
void *ptrmyMap = (void *)(&myMap); void *ptrmyMap = (void *)(&myMap);
TheItem& Item=((HatchGen_MapOfElements*)ptrmyMap)->ChangeFind(Itertemp.Key()); Geom2dHatch_Element& Item=((Geom2dHatch_MapOfElements*)ptrmyMap)->ChangeFind(Itertemp.Key());
TheCurve& E = Item.ChangeCurve(); Geom2dAdaptor_Curve& E = Item.ChangeCurve();
TopAbs_Orientation Or= Item.Orientation(); TopAbs_Orientation Or= Item.Orientation();
gp_Pnt2d P2 = E.Value gp_Pnt2d P2 = E.Value
((E.FirstParameter() + E.LastParameter()) *0.5); ((E.FirstParameter() + E.LastParameter()) *0.5);
@ -128,7 +142,7 @@ Standard_Boolean HatchGen_ElementsGen::OtherSegment(const gp_Pnt2d& P,
//purpose : //purpose :
//======================================================================= //=======================================================================
void HatchGen_ElementsGen::InitWires() { void Geom2dHatch_Elements::InitWires() {
NumWire = 0; NumWire = 0;
} }
@ -137,7 +151,7 @@ void HatchGen_ElementsGen::InitWires() {
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_ElementsGen::RejectWire(const gp_Lin2d& , Standard_Boolean Geom2dHatch_Elements::RejectWire(const gp_Lin2d& ,
const Standard_Real) const const Standard_Real) const
{ {
return Standard_False; return Standard_False;
@ -148,7 +162,7 @@ Standard_Boolean HatchGen_ElementsGen::RejectWire(const gp_Lin2d& ,
//purpose : //purpose :
//======================================================================= //=======================================================================
void HatchGen_ElementsGen::InitEdges() { void Geom2dHatch_Elements::InitEdges() {
NumEdge = 0; NumEdge = 0;
Iter.Initialize(myMap); Iter.Initialize(myMap);
} }
@ -158,7 +172,7 @@ void HatchGen_ElementsGen::InitEdges() {
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_ElementsGen::RejectEdge(const gp_Lin2d& , Standard_Boolean Geom2dHatch_Elements::RejectEdge(const gp_Lin2d& ,
const Standard_Real ) const const Standard_Real ) const
{ {
return Standard_False; return Standard_False;
@ -170,11 +184,11 @@ Standard_Boolean HatchGen_ElementsGen::RejectEdge(const gp_Lin2d& ,
//purpose : //purpose :
//======================================================================= //=======================================================================
void HatchGen_ElementsGen::CurrentEdge(TheCurve& E, void Geom2dHatch_Elements::CurrentEdge(Geom2dAdaptor_Curve& E,
TopAbs_Orientation& Or) const TopAbs_Orientation& Or) const
{ {
void *ptrmyMap = (void *)(&myMap); void *ptrmyMap = (void *)(&myMap);
TheItem& Item=((HatchGen_MapOfElements*)ptrmyMap)->ChangeFind(Iter.Key()); Geom2dHatch_Element& Item=((Geom2dHatch_MapOfElements*)ptrmyMap)->ChangeFind(Iter.Key());
E = Item.ChangeCurve(); E = Item.ChangeCurve();
Or= Item.Orientation(); Or= Item.Orientation();
@ -191,7 +205,7 @@ void HatchGen_ElementsGen::CurrentEdge(TheCurve& E,
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_ElementsGen::MoreWires() const Standard_Boolean Geom2dHatch_Elements::MoreWires() const
{ {
return (NumWire == 0); return (NumWire == 0);
} }
@ -201,7 +215,7 @@ Standard_Boolean HatchGen_ElementsGen::MoreWires() const
//purpose : //purpose :
//======================================================================= //=======================================================================
void HatchGen_ElementsGen::NextWire() { void Geom2dHatch_Elements::NextWire() {
NumWire++; NumWire++;
} }
@ -210,7 +224,7 @@ void HatchGen_ElementsGen::NextWire() {
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_ElementsGen::MoreEdges() const { Standard_Boolean Geom2dHatch_Elements::MoreEdges() const {
return(Iter.More()); return(Iter.More());
} }
@ -219,7 +233,7 @@ Standard_Boolean HatchGen_ElementsGen::MoreEdges() const {
//purpose : //purpose :
//======================================================================= //=======================================================================
void HatchGen_ElementsGen::NextEdge() { void Geom2dHatch_Elements::NextEdge() {
Iter.Next(); Iter.Next();
} }

View File

@ -14,50 +14,28 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class Hatcher from HatchGen class Hatcher from Geom2dHatch
(TheCurveE as any ; -- as Curve from Geom2dAdaptor
TheCurveH as any ; -- as Curve from Geom2dAdaptor
TheIntersector as any ) -- as Intersector from HatchGen
uses uses
MapIntegerHasher from TColStd , MapIntegerHasher from TColStd,
PointOnHatching from HatchGen , PointOnHatching from HatchGen,
Orientation from TopAbs , Orientation from TopAbs,
State from TopAbs , State from TopAbs,
Domain from HatchGen , Domain from HatchGen,
ErrorStatus 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 raises
NoSuchObject from Standard , NoSuchObject from Standard ,
OutOfRange from Standard , OutOfRange from Standard ,
NotDone from StdFail 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. -- class Hatcher description.
---------------------------------------------------------------------- ----------------------------------------------------------------------
@ -67,7 +45,7 @@ is
---Category: General use ---Category: General use
Create (Intersector : TheIntersector ; Create (Intersector : Intersector from Geom2dHatch ;
Confusion2d : Real from Standard ; Confusion2d : Real from Standard ;
Confusion3d : Real from Standard ; Confusion3d : Real from Standard ;
KeepPnt : Boolean from Standard = Standard_False ; KeepPnt : Boolean from Standard = Standard_False ;
@ -75,10 +53,10 @@ is
---Purpose: Returns an empty hatcher. ---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. ---Purpose: Sets the associated intersector.
is static ; is static ;
@ -91,7 +69,7 @@ is
---C++: inline ---C++: inline
---C++: return const & ---C++: return const &
returns TheIntersector returns Intersector from Geom2dHatch
is static ; is static ;
@ -102,7 +80,7 @@ is
---C++: inline ---C++: inline
---C++: return & ---C++: return &
returns TheIntersector returns Intersector from Geom2dHatch
is static ; is static ;
@ -194,7 +172,7 @@ is
---C++: inline ---C++: inline
---C++: return & ---C++: return &
returns Element from HatchGen returns Element from Geom2dHatch
raises NoSuchObject from Standard raises NoSuchObject from Standard
is static protected ; is static protected ;
@ -208,12 +186,12 @@ is
---C++: inline ---C++: inline
---C++: return const & ---C++: return const &
returns TheCurveE returns Curve from Geom2dAdaptor
raises NoSuchObject from Standard raises NoSuchObject from Standard
is static ; is static ;
AddElement (me : in out ; Curve : TheCurveE ; AddElement (me : in out ; Curve : Curve from Geom2dAdaptor ;
Orientation : Orientation from TopAbs = TopAbs_FORWARD) Orientation : Orientation from TopAbs = TopAbs_FORWARD)
---Purpose: Adds an element to the hatcher and returns its index. ---Purpose: Adds an element to the hatcher and returns its index.
@ -255,7 +233,7 @@ is
---C++: inline ---C++: inline
---C++: return & ---C++: return &
returns Hatching from HatchGen returns Hatching from Geom2dHatch
raises NoSuchObject from Standard raises NoSuchObject from Standard
is static protected ; is static protected ;
@ -269,12 +247,12 @@ is
---C++: inline ---C++: inline
---C++: return const & ---C++: return const &
returns TheCurveH returns Curve from Geom2dAdaptor
raises NoSuchObject from Standard raises NoSuchObject from Standard
is static ; 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. ---Purpose: Adds a hatching to the hatcher and returns its index.
@ -342,7 +320,7 @@ is
is static ; 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 ---Purpose: Adds a hatching to the hatcher and trims it by
-- the elements already given and returns its index. -- the elements already given and returns its index.
@ -500,14 +478,14 @@ is
fields fields
myIntersector : TheIntersector ; myIntersector : Intersector from Geom2dHatch;
myConfusion2d : Real from Standard ; myConfusion2d : Real from Standard ;
myConfusion3d : Real from Standard ; myConfusion3d : Real from Standard ;
myKeepPoints : Boolean from Standard ; myKeepPoints : Boolean from Standard ;
myKeepSegments : Boolean from Standard ; myKeepSegments : Boolean from Standard ;
myNbElements : Integer from Standard ; myNbElements : Integer from Standard ;
myElements : Elements from HatchGen ; myElements : Elements from Geom2dHatch ;
myNbHatchings : Integer from Standard ; myNbHatchings : Integer from Standard ;
myHatchings : Hatchings from HatchGen ; myHatchings : Hatchings from Geom2dHatch;
end Hatcher from HatchGen ; end Hatcher from Geom2dHatch;

View File

@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <Geom2dHatch_Hatcher.ixx>
#include <HatchGen_Domain.hxx> #include <HatchGen_Domain.hxx>
#include <HatchGen_Domains.hxx> #include <HatchGen_Domains.hxx>
#include <HatchGen_PointOnElement.hxx> #include <HatchGen_PointOnElement.hxx>
@ -25,6 +27,10 @@
#include <TopAbs.hxx> #include <TopAbs.hxx>
#include <TopTrans_CurveTransition.hxx> #include <TopTrans_CurveTransition.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dHatch_Intersector.hxx>
#include <Geom2dHatch_Classifier.hxx>
#define RAISE_IF_NOSUCHOBJECT 0 #define RAISE_IF_NOSUCHOBJECT 0
#define TRACE_HATCHER 0 #define TRACE_HATCHER 0
@ -35,11 +41,11 @@
//======================================================================= //=======================================================================
//======================================================================= //=======================================================================
// Function : HatchGen_Hatcher // Function : Geom2dHatch_Hatcher
// Purpose : Constructor. // Purpose : Constructor.
//======================================================================= //=======================================================================
HatchGen_Hatcher::HatchGen_Hatcher (const TheIntersector& Intersector, Geom2dHatch_Hatcher::Geom2dHatch_Hatcher (const Geom2dHatch_Intersector& Intersector,
const Standard_Real Confusion2d, const Standard_Real Confusion2d,
const Standard_Real Confusion3d, const Standard_Real Confusion3d,
const Standard_Boolean KeepPnt, const Standard_Boolean KeepPnt,
@ -59,12 +65,12 @@ HatchGen_Hatcher::HatchGen_Hatcher (const TheIntersector& Intersector,
// Purpose : Sets the associated intersector. // Purpose : Sets the associated intersector.
//======================================================================= //=======================================================================
void HatchGen_Hatcher::Intersector (const TheIntersector& Intersector) void Geom2dHatch_Hatcher::Intersector (const Geom2dHatch_Intersector& Intersector)
{ {
myIntersector = Intersector ; myIntersector = Intersector ;
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) {
if (myHatchings.IsBound (IndH)) { if (myHatchings.IsBound (IndH)) {
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrPoints() ; Hatching.ClrPoints() ;
} }
} }
@ -76,12 +82,12 @@ void HatchGen_Hatcher::Intersector (const TheIntersector& Intersector)
// Purpose : Sets the 2dconfusion tolerance. // Purpose : Sets the 2dconfusion tolerance.
//======================================================================= //=======================================================================
void HatchGen_Hatcher::Confusion2d (const Standard_Real Confusion) void Geom2dHatch_Hatcher::Confusion2d (const Standard_Real Confusion)
{ {
myConfusion2d = Confusion ; myConfusion2d = Confusion ;
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) {
if (myHatchings.IsBound (IndH)) { if (myHatchings.IsBound (IndH)) {
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrPoints() ; Hatching.ClrPoints() ;
} }
} }
@ -93,12 +99,12 @@ void HatchGen_Hatcher::Confusion2d (const Standard_Real Confusion)
// Purpose : Sets the 3d confusion tolerance. // Purpose : Sets the 3d confusion tolerance.
//======================================================================= //=======================================================================
void HatchGen_Hatcher::Confusion3d (const Standard_Real Confusion) void Geom2dHatch_Hatcher::Confusion3d (const Standard_Real Confusion)
{ {
myConfusion3d = Confusion ; myConfusion3d = Confusion ;
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) {
if (myHatchings.IsBound (IndH)) { if (myHatchings.IsBound (IndH)) {
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrPoints() ; Hatching.ClrPoints() ;
} }
} }
@ -109,12 +115,12 @@ void HatchGen_Hatcher::Confusion3d (const Standard_Real Confusion)
// Purpose : Sets the above flag. // Purpose : Sets the above flag.
//======================================================================= //=======================================================================
void HatchGen_Hatcher::KeepPoints (const Standard_Boolean Keep) void Geom2dHatch_Hatcher::KeepPoints (const Standard_Boolean Keep)
{ {
myKeepPoints = Keep ; myKeepPoints = Keep ;
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) {
if (myHatchings.IsBound (IndH)) { if (myHatchings.IsBound (IndH)) {
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrDomains() ; Hatching.ClrDomains() ;
} }
} }
@ -126,12 +132,12 @@ void HatchGen_Hatcher::KeepPoints (const Standard_Boolean Keep)
// Purpose : Sets the above flag. // Purpose : Sets the above flag.
//======================================================================= //=======================================================================
void HatchGen_Hatcher::KeepSegments (const Standard_Boolean Keep) void Geom2dHatch_Hatcher::KeepSegments (const Standard_Boolean Keep)
{ {
myKeepSegments = Keep ; myKeepSegments = Keep ;
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) {
if (myHatchings.IsBound (IndH)) { if (myHatchings.IsBound (IndH)) {
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrDomains() ; 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. // 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) const TopAbs_Orientation Orientation)
{ {
Standard_Integer IndE ; Standard_Integer IndE ;
@ -160,11 +166,11 @@ Standard_Integer HatchGen_Hatcher::AddElement (const TheCurveE& Curve,
myNbElements++ ; myNbElements++ ;
IndE = myNbElements ; IndE = myNbElements ;
} }
HatchGen_Element Element (Curve, Orientation) ; Geom2dHatch_Element Element (Curve, Orientation) ;
myElements.Bind (IndE, Element) ; myElements.Bind (IndE, Element) ;
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings; IndH++) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings; IndH++) {
if (myHatchings.IsBound(IndH)) { if (myHatchings.IsBound(IndH)) {
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrPoints () ; Hatching.ClrPoints () ;
} }
} }
@ -176,14 +182,14 @@ Standard_Integer HatchGen_Hatcher::AddElement (const TheCurveE& Curve,
// Purpose : Removes the IndE-th element from the hatcher. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ; Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ;
#endif #endif
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) {
if (myHatchings.IsBound (IndH)) { if (myHatchings.IsBound (IndH)) {
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Standard_Boolean DomainsToClear = Standard_False ; Standard_Boolean DomainsToClear = Standard_False ;
for (Standard_Integer IPntH = Hatching.NbPoints() ; IPntH > 0 ; IPntH--) { for (Standard_Integer IPntH = Hatching.NbPoints() ; IPntH > 0 ; IPntH--) {
HatchGen_PointOnHatching PntH = Hatching.ChangePoint (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. // Purpose : Removes all the elements from the hatcher.
//======================================================================= //=======================================================================
void HatchGen_Hatcher::ClrElements () void Geom2dHatch_Hatcher::ClrElements ()
{ {
if (myNbElements != 0) { if (myNbElements != 0) {
if (myNbHatchings != 0) { if (myNbHatchings != 0) {
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) {
if (myHatchings.IsBound(IndH)) { if (myHatchings.IsBound(IndH)) {
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrPoints() ; Hatching.ClrPoints() ;
} }
} }
@ -235,7 +241,7 @@ void HatchGen_Hatcher::ClrElements ()
// Purpose : Adds a hatching to the hatcher and returns its index. // 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 ; Standard_Integer IndH ;
for (IndH = 1 ; IndH <= myNbHatchings && myHatchings.IsBound(IndH) ; IndH++) ; for (IndH = 1 ; IndH <= myNbHatchings && myHatchings.IsBound(IndH) ; IndH++) ;
@ -243,7 +249,7 @@ Standard_Integer HatchGen_Hatcher::AddHatching (const TheCurveH& Curve)
myNbHatchings++ ; myNbHatchings++ ;
IndH = myNbHatchings ; IndH = myNbHatchings ;
} }
HatchGen_Hatching Hatching (Curve) ; Geom2dHatch_Hatching Hatching (Curve) ;
myHatchings.Bind (IndH, Hatching) ; myHatchings.Bind (IndH, Hatching) ;
return IndH ; return IndH ;
} }
@ -253,12 +259,12 @@ Standard_Integer HatchGen_Hatcher::AddHatching (const TheCurveH& Curve)
// Purpose : Removes the IndH-th hatching from the hatcher. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrPoints() ; Hatching.ClrPoints() ;
myHatchings.UnBind (IndH) ; myHatchings.UnBind (IndH) ;
if (IndH == myNbHatchings) myNbHatchings-- ; if (IndH == myNbHatchings) myNbHatchings-- ;
@ -269,12 +275,12 @@ void HatchGen_Hatcher::RemHatching (const Standard_Integer IndH)
// Purpose : Removes all the hatchings from the hatcher. // Purpose : Removes all the hatchings from the hatcher.
//======================================================================= //=======================================================================
void HatchGen_Hatcher::ClrHatchings () void Geom2dHatch_Hatcher::ClrHatchings ()
{ {
if (myNbHatchings != 0) { if (myNbHatchings != 0) {
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) { for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) {
if (myHatchings.IsBound(IndH)) { if (myHatchings.IsBound(IndH)) {
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrPoints() ; Hatching.ClrPoints() ;
} }
} }
@ -297,7 +303,7 @@ void HatchGen_Hatcher::ClrHatchings ()
// of the hatcher. // of the hatcher.
//======================================================================= //=======================================================================
void HatchGen_Hatcher::Trim () void Geom2dHatch_Hatcher::Trim ()
{ {
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++)
if (myHatchings.IsBound (IndH)) if (myHatchings.IsBound (IndH))
@ -310,7 +316,7 @@ void HatchGen_Hatcher::Trim ()
// already given and returns its index. // 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) ; Standard_Integer IndH = AddHatching (Curve) ;
Trim (IndH) ; 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. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrPoints() ; Hatching.ClrPoints() ;
@ -431,7 +437,7 @@ static void IntersectionPointDump (const IntRes2d_IntersectionPoint& Pnt,
// element. // element.
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_Hatcher::Trim (const Standard_Integer IndH, Standard_Boolean Geom2dHatch_Hatcher::Trim (const Standard_Integer IndH,
const Standard_Integer IndE) const Standard_Integer IndE)
{ {
#if RAISE_IF_NOSUCHOBJECT #if RAISE_IF_NOSUCHOBJECT
@ -439,11 +445,11 @@ Standard_Boolean HatchGen_Hatcher::Trim (const Standard_Integer IndH,
Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ; Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ;
#endif #endif
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
HatchGen_Element& Element = myElements.ChangeFind (IndE) ; Geom2dHatch_Element& Element = myElements.ChangeFind (IndE) ;
TheCurveH hatching = Hatching.ChangeCurve() ; Geom2dAdaptor_Curve hatching = Hatching.ChangeCurve() ;
TheCurveE element = Element.ChangeCurve() ; Geom2dAdaptor_Curve element = Element.ChangeCurve() ;
myIntersector.Intersect (hatching, element) ; myIntersector.Intersect (hatching, element) ;
@ -728,7 +734,7 @@ Standard_Boolean HatchGen_Hatcher::Trim (const Standard_Integer IndH,
// IndH-th hatching. // 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 StateBefore = TopAbs_UNKNOWN ;
TopAbs_State StateAfter = TopAbs_UNKNOWN ; TopAbs_State StateAfter = TopAbs_UNKNOWN ;
@ -739,7 +745,7 @@ Standard_Boolean HatchGen_Hatcher::GlobalTransition (HatchGen_PointOnHatching& P
gp_Dir Tangente, Normale ; gp_Dir Tangente, Normale ;
Standard_Real Courbure ; 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); 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() ; SegmentBegin = SegmentBegin || PntE.SegmentBeginning() ;
SegmentEnd = SegmentEnd || PntE.SegmentEnd() ; SegmentEnd = SegmentEnd || PntE.SegmentEnd() ;
const HatchGen_Element& Element = myElements.Find (PntE.Index()) ; const Geom2dHatch_Element& Element = myElements.Find (PntE.Index()) ;
const TheCurveE& CurveE = Element.Curve() ; const Geom2dAdaptor_Curve& CurveE = Element.Curve() ;
TopAbs_Orientation ElementOrientation = Element.Orientation() ; TopAbs_Orientation ElementOrientation = Element.Orientation() ;
Standard_Boolean ToReverse = (ElementOrientation == TopAbs_REVERSED); 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. // Purpose : Computes the domains of all the hatchings.
//======================================================================= //=======================================================================
void HatchGen_Hatcher::ComputeDomains () void Geom2dHatch_Hatcher::ComputeDomains ()
{ {
for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++) for (Standard_Integer IndH = 1 ; IndH <= myNbHatchings ; IndH++)
if (myHatchings.IsBound (IndH)) ComputeDomains (IndH) ; if (myHatchings.IsBound (IndH)) ComputeDomains (IndH) ;
@ -934,13 +940,13 @@ void HatchGen_Hatcher::ComputeDomains ()
// Purpose : Computes the domains of the IndH-th hatching. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
Hatching.ClrDomains() ; Hatching.ClrDomains() ;
Hatching.IsDone (Standard_False) ; Hatching.IsDone (Standard_False) ;
@ -958,7 +964,7 @@ void HatchGen_Hatcher::ComputeDomains (const Standard_Integer IndH)
if (NbPnt == 0) { if (NbPnt == 0) {
//-- cout << "The hatching # " << setw(3) << IndH << " has to be classified" << endl ; //-- 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) { if(Classifier.State() == TopAbs_IN) {
HatchGen_Domain domain ; HatchGen_Domain domain ;
Hatching.AddDomain (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. // 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 const Standard_Integer IDom) const
{ {
#if RAISE_IF_NOSUCHOBJECT #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
StdFail_NotDone_Raise_if (!Hatching.IsDone(), "HatchGen_Hatcher::Domain") ; StdFail_NotDone_Raise_if (!Hatching.IsDone(), "Geom2dHatch_Hatcher::Domain") ;
#if RAISE_IF_NOSUCHOBJECT #if RAISE_IF_NOSUCHOBJECT
Standard_OutOfRange_Raise_if (IDom < 1 || IDom > Hatching.NbDomains(), "") ; Standard_OutOfRange_Raise_if (IDom < 1 || IDom > Hatching.NbDomains(), "") ;
#endif #endif
@ -1422,7 +1428,7 @@ const HatchGen_Domain& HatchGen_Hatcher::Domain (const Standard_Integer IndH,
// Purpose : Dumps the hatcher. // Purpose : Dumps the hatcher.
//======================================================================= //=======================================================================
void HatchGen_Hatcher::Dump () const void Geom2dHatch_Hatcher::Dump () const
{ {
cout << endl ; cout << endl ;
cout << "========================================================" << endl ; cout << "========================================================" << endl ;
@ -1461,7 +1467,7 @@ void HatchGen_Hatcher::Dump () const
if (!myHatchings.IsBound (IndH)) { if (!myHatchings.IsBound (IndH)) {
cout << " is not bound" << endl ; cout << " is not bound" << endl ;
} else { } else {
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
Standard_Integer NbPnt = Hatching.NbPoints() ; Standard_Integer NbPnt = Hatching.NbPoints() ;
cout << " contains " << NbPnt << " restriction points :" << endl ; cout << " contains " << NbPnt << " restriction points :" << endl ;
for (Standard_Integer IPnt = 1 ; IPnt <= NbPnt ; IPnt++) { for (Standard_Integer IPnt = 1 ; IPnt <= NbPnt ; IPnt++) {
@ -1483,7 +1489,7 @@ void HatchGen_Hatcher::Dump () const
if (!myElements.IsBound (IndE)) { if (!myElements.IsBound (IndE)) {
cout << " is not bound" << endl ; cout << " is not bound" << endl ;
} else { } else {
const HatchGen_Element& Element = myElements.Find (IndE) ; const Geom2dHatch_Element& Element = myElements.Find (IndE) ;
switch (Element.Orientation()) { switch (Element.Orientation()) {
case TopAbs_FORWARD : cout << " is FORWARD" << endl ; break ; case TopAbs_FORWARD : cout << " is FORWARD" << endl ; break ;
case TopAbs_REVERSED : cout << " is REVERSED" << endl ; break ; case TopAbs_REVERSED : cout << " is REVERSED" << endl ; break ;

View File

@ -19,17 +19,17 @@
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
#include HatchGen_Element_hxx #include <Geom2dAdaptor_Curve.hxx>
#include HatchGen_Elements_hxx #include <Geom2dHatch_Intersector.hxx>
#include TheIntersector_hxx #include <Geom2dHatch_Hatching.hxx>
#include TheCurveE_hxx #include <Geom2dHatch_Element.hxx>
#include HatchGen_Hatching_hxx
//======================================================================= //=======================================================================
// Function : Intersector // Function : Intersector
// Purpose : Returns the associated intersector. // Purpose : Returns the associated intersector.
//======================================================================= //=======================================================================
inline const TheIntersector& HatchGen_Hatcher::Intersector () inline const Geom2dHatch_Intersector& Geom2dHatch_Hatcher::Intersector ()
{ {
return myIntersector ; return myIntersector ;
} }
@ -39,7 +39,7 @@ inline const TheIntersector& HatchGen_Hatcher::Intersector ()
// Purpose : Returns the associated intersector. // Purpose : Returns the associated intersector.
//======================================================================= //=======================================================================
inline TheIntersector& HatchGen_Hatcher::ChangeIntersector () inline Geom2dHatch_Intersector& Geom2dHatch_Hatcher::ChangeIntersector ()
{ {
return myIntersector ; return myIntersector ;
} }
@ -49,7 +49,7 @@ inline TheIntersector& HatchGen_Hatcher::ChangeIntersector ()
// Purpose : Returns the 2d confusion tolerance. // Purpose : Returns the 2d confusion tolerance.
//======================================================================= //=======================================================================
inline Standard_Real HatchGen_Hatcher::Confusion2d () const inline Standard_Real Geom2dHatch_Hatcher::Confusion2d () const
{ {
return myConfusion2d ; return myConfusion2d ;
} }
@ -59,7 +59,7 @@ inline Standard_Real HatchGen_Hatcher::Confusion2d () const
// Purpose : Returns the 3d confusion tolerance. // Purpose : Returns the 3d confusion tolerance.
//======================================================================= //=======================================================================
inline Standard_Real HatchGen_Hatcher::Confusion3d () const inline Standard_Real Geom2dHatch_Hatcher::Confusion3d () const
{ {
return myConfusion3d ; return myConfusion3d ;
} }
@ -69,7 +69,7 @@ inline Standard_Real HatchGen_Hatcher::Confusion3d () const
// Purpose : Returns the flag about the points consideration. // Purpose : Returns the flag about the points consideration.
//======================================================================= //=======================================================================
inline Standard_Boolean HatchGen_Hatcher::KeepPoints () const inline Standard_Boolean Geom2dHatch_Hatcher::KeepPoints () const
{ {
return myKeepPoints ; return myKeepPoints ;
} }
@ -79,7 +79,7 @@ inline Standard_Boolean HatchGen_Hatcher::KeepPoints () const
// Purpose : Returns the flag about the segments consideration. // Purpose : Returns the flag about the segments consideration.
//======================================================================= //=======================================================================
inline Standard_Boolean HatchGen_Hatcher::KeepSegments () const inline Standard_Boolean Geom2dHatch_Hatcher::KeepSegments () const
{ {
return myKeepSegments ; return myKeepSegments ;
} }
@ -89,7 +89,7 @@ inline Standard_Boolean HatchGen_Hatcher::KeepSegments () const
// Purpose : Removes all the hatchings and all the elements. // Purpose : Removes all the hatchings and all the elements.
//======================================================================= //=======================================================================
inline void HatchGen_Hatcher::Clear () inline void Geom2dHatch_Hatcher::Clear ()
{ {
if (myNbHatchings != 0) ClrHatchings () ; if (myNbHatchings != 0) ClrHatchings () ;
if (myNbElements != 0) ClrElements () ; if (myNbElements != 0) ClrElements () ;
@ -100,12 +100,12 @@ inline void HatchGen_Hatcher::Clear ()
// Purpose : Returns the IndE-th element. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ; Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ;
#endif #endif
HatchGen_Element& Element = myElements.ChangeFind (IndE) ; Geom2dHatch_Element& Element = myElements.ChangeFind (IndE) ;
return Element ; 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. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ; Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ;
#endif #endif
const HatchGen_Element& Element = myElements.Find (IndE) ; const Geom2dHatch_Element& Element = myElements.Find (IndE) ;
return Element.Curve() ; return Element.Curve() ;
} }
@ -129,12 +129,12 @@ inline const TheCurveE& HatchGen_Hatcher::ElementCurve (const Standard_Integer I
// Purpose : Returns the IndH-th hatching. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ; Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
return Hatching ; 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. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.Curve() ; return Hatching.Curve() ;
} }
@ -158,12 +158,12 @@ inline const TheCurveH& HatchGen_Hatcher::HatchingCurve (const Standard_Integer
// hatching. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.NbPoints() ; return Hatching.NbPoints() ;
} }
@ -173,13 +173,13 @@ inline Standard_Integer HatchGen_Hatcher::NbPoints (const Standard_Integer IndH)
// hatching. // 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 const Standard_Integer IndP) const
{ {
#if RAISE_IF_NOSUCHOBJECT #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
#if RAISE_IF_NOSUCHOBJECT #if RAISE_IF_NOSUCHOBJECT
Standard_OutOfRange_Raise_if (IndP < 0 || IndP > Hatching.NbPoints(), "") ; Standard_OutOfRange_Raise_if (IndP < 0 || IndP > Hatching.NbPoints(), "") ;
#endif #endif
@ -193,12 +193,12 @@ inline const HatchGen_PointOnHatching& HatchGen_Hatcher::Point (const Standard_I
// for the IndH-th hatching. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.TrimDone() ; return Hatching.TrimDone() ;
} }
//======================================================================= //=======================================================================
@ -207,12 +207,12 @@ inline Standard_Boolean HatchGen_Hatcher::TrimDone (const Standard_Integer IndH)
// for the IndH-th hatching. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.TrimFailed() ; return Hatching.TrimFailed() ;
} }
@ -222,12 +222,12 @@ inline Standard_Boolean HatchGen_Hatcher::TrimFailed (const Standard_Integer Ind
// for the IndH-th hatching. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.IsDone() ; 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. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.Status() ; 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. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ; Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif #endif
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ; const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
StdFail_NotDone_Raise_if (!Hatching.IsDone(), "HatchGen_Hatcher::NbDomains") ; StdFail_NotDone_Raise_if (!Hatching.IsDone(), "Geom2dHatch_Hatcher::NbDomains") ;
return Hatching.NbDomains() ; return Hatching.NbDomains() ;
} }

View File

@ -14,7 +14,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class HatchingGen from HatchGen (TheHatchingCurve as any) class Hatching from Geom2dHatch
uses uses
ErrorStatus from HatchGen , ErrorStatus from HatchGen ,
@ -22,7 +22,8 @@ uses
PointsOnHatching from HatchGen , PointsOnHatching from HatchGen ,
Domain from HatchGen , Domain from HatchGen ,
Domains from HatchGen , Domains from HatchGen ,
Pnt2d from gp Pnt2d from gp,
Curve from Geom2dAdaptor
raises raises
OutOfRange from Standard OutOfRange from Standard
@ -31,14 +32,14 @@ is
Create Create
returns HatchingGen from HatchGen; returns Hatching from Geom2dHatch;
Create (Curve : TheHatchingCurve) Create (Curve : Curve from Geom2dAdaptor)
---Purpose: Creates a hatching. ---Purpose: Creates a hatching.
returns HatchingGen from HatchGen ; returns Hatching from Geom2dHatch ;
Curve (me) Curve (me)
@ -47,7 +48,7 @@ is
---C++: return const & ---C++: return const &
returns TheHatchingCurve returns Curve from Geom2dAdaptor
is static ; is static ;
@ -57,7 +58,7 @@ is
---C++: return & ---C++: return &
returns TheHatchingCurve returns Curve from Geom2dAdaptor
is static ; is static ;
@ -245,7 +246,7 @@ is
fields fields
myCurve : TheHatchingCurve ; myCurve : Curve from Geom2dAdaptor ;
myTrimDone : Boolean from Standard ; myTrimDone : Boolean from Standard ;
myTrimFailed : Boolean from Standard ; myTrimFailed : Boolean from Standard ;
myPoints : PointsOnHatching from HatchGen ; myPoints : PointsOnHatching from HatchGen ;
@ -253,4 +254,4 @@ fields
myStatus : ErrorStatus from HatchGen ; myStatus : ErrorStatus from HatchGen ;
myDomains : Domains from HatchGen ; myDomains : Domains from HatchGen ;
end HatchingGen from HatchGen ; end Hatching from Geom2dHatch ;

View File

@ -14,25 +14,28 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <Geom2dHatch_Hatching.ixx>
#include <HatchGen_PointOnElement.hxx> #include <HatchGen_PointOnElement.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#define RAISE_IF_NOSUCHOBJECT 0 #define RAISE_IF_NOSUCHOBJECT 0
#include <Precision.hxx> #include <Precision.hxx>
//======================================================================= //=======================================================================
// Function : HatchGen_HatchingGen // Function : Geom2dHatch_Hatching
// Purpose : Constructor. // Purpose : Constructor.
//======================================================================= //=======================================================================
HatchGen_HatchingGen::HatchGen_HatchingGen () { Geom2dHatch_Hatching::Geom2dHatch_Hatching () {
} }
//======================================================================= //=======================================================================
// Function : HatchGen_HatchingGen // Function : Geom2dHatch_Hatching
// Purpose : Constructor. // Purpose : Constructor.
//======================================================================= //=======================================================================
HatchGen_HatchingGen::HatchGen_HatchingGen (const TheHatchingCurve& Curve) : Geom2dHatch_Hatching::Geom2dHatch_Hatching (const Geom2dAdaptor_Curve& Curve) :
myCurve (Curve), myCurve (Curve),
myTrimDone (Standard_False), myTrimDone (Standard_False),
myTrimFailed (Standard_False), myTrimFailed (Standard_False),
@ -46,7 +49,7 @@ HatchGen_HatchingGen::HatchGen_HatchingGen (const TheHatchingCurve& Curve) :
// Purpose : Returns the curve associated to the hatching. // Purpose : Returns the curve associated to the hatching.
//======================================================================= //=======================================================================
const TheHatchingCurve& HatchGen_HatchingGen::Curve () const const Geom2dAdaptor_Curve& Geom2dHatch_Hatching::Curve () const
{ {
return myCurve ; return myCurve ;
} }
@ -56,7 +59,7 @@ const TheHatchingCurve& HatchGen_HatchingGen::Curve () const
// Purpose : Returns the curve associated to the hatching. // Purpose : Returns the curve associated to the hatching.
//======================================================================= //=======================================================================
TheHatchingCurve& HatchGen_HatchingGen::ChangeCurve () Geom2dAdaptor_Curve& Geom2dHatch_Hatching::ChangeCurve ()
{ {
return myCurve ; return myCurve ;
} }
@ -67,7 +70,7 @@ TheHatchingCurve& HatchGen_HatchingGen::ChangeCurve ()
// value. // value.
//======================================================================= //=======================================================================
void HatchGen_HatchingGen::TrimDone (const Standard_Boolean Flag) void Geom2dHatch_Hatching::TrimDone (const Standard_Boolean Flag)
{ {
myTrimDone = Flag ; myTrimDone = Flag ;
} }
@ -77,7 +80,7 @@ void HatchGen_HatchingGen::TrimDone (const Standard_Boolean Flag)
// Purpose : Returns the flag about the trimmings computation. // Purpose : Returns the flag about the trimmings computation.
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_HatchingGen::TrimDone () const Standard_Boolean Geom2dHatch_Hatching::TrimDone () const
{ {
return myTrimDone ; return myTrimDone ;
} }
@ -88,7 +91,7 @@ Standard_Boolean HatchGen_HatchingGen::TrimDone () const
// value. // value.
//======================================================================= //=======================================================================
void HatchGen_HatchingGen::TrimFailed (const Standard_Boolean Flag) void Geom2dHatch_Hatching::TrimFailed (const Standard_Boolean Flag)
{ {
myTrimFailed = Flag ; myTrimFailed = Flag ;
if (myTrimFailed) myStatus = HatchGen_TrimFailure ; 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. // Purpose : Returns the flag about the trimmings failure.
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_HatchingGen::TrimFailed () const Standard_Boolean Geom2dHatch_Hatching::TrimFailed () const
{ {
return myTrimFailed ; return myTrimFailed ;
} }
@ -110,7 +113,7 @@ Standard_Boolean HatchGen_HatchingGen::TrimFailed () const
// value. // value.
//======================================================================= //=======================================================================
void HatchGen_HatchingGen::IsDone (const Standard_Boolean Flag) void Geom2dHatch_Hatching::IsDone (const Standard_Boolean Flag)
{ {
myIsDone = Flag ; myIsDone = Flag ;
} }
@ -120,7 +123,7 @@ void HatchGen_HatchingGen::IsDone (const Standard_Boolean Flag)
// Purpose : Returns the flag about the domains computation. // Purpose : Returns the flag about the domains computation.
//======================================================================= //=======================================================================
Standard_Boolean HatchGen_HatchingGen::IsDone () const Standard_Boolean Geom2dHatch_Hatching::IsDone () const
{ {
return myIsDone ; return myIsDone ;
} }
@ -130,7 +133,7 @@ Standard_Boolean HatchGen_HatchingGen::IsDone () const
// Purpose : Sets the error status. // Purpose : Sets the error status.
//======================================================================= //=======================================================================
void HatchGen_HatchingGen::Status (const HatchGen_ErrorStatus Status) void Geom2dHatch_Hatching::Status (const HatchGen_ErrorStatus Status)
{ {
myStatus = Status ; myStatus = Status ;
} }
@ -140,7 +143,7 @@ void HatchGen_HatchingGen::Status (const HatchGen_ErrorStatus Status)
// Purpose : Returns the error status. // Purpose : Returns the error status.
//======================================================================= //=======================================================================
HatchGen_ErrorStatus HatchGen_HatchingGen::Status () const HatchGen_ErrorStatus Geom2dHatch_Hatching::Status () const
{ {
return myStatus ; return myStatus ;
} }
@ -150,7 +153,7 @@ HatchGen_ErrorStatus HatchGen_HatchingGen::Status () const
// Purpose : Adds an intersection point to the hatching. // 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) const Standard_Real Confusion)
{ {
Standard_Integer NbPoints = myPoints.Length () ; 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. // 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 () ; return myPoints.Length () ;
} }
@ -191,7 +194,7 @@ Standard_Integer HatchGen_HatchingGen::NbPoints () const
// Purpose : Returns the Index-th intersection point on the hatching. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_Integer NbPoints = myPoints.Length () ; 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. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_Integer NbPoints = myPoints.Length () ; 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. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_Integer NbPoints = myPoints.Length () ; 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. // Purpose : Removes all the intersection points of the hatching.
//======================================================================= //=======================================================================
void HatchGen_HatchingGen::ClrPoints () void Geom2dHatch_Hatching::ClrPoints ()
{ {
if (myIsDone) ClrDomains() ; if (myIsDone) ClrDomains() ;
for (Standard_Integer IPntH = 1 ; IPntH <= myPoints.Length() ; IPntH++) { for (Standard_Integer IPntH = 1 ; IPntH <= myPoints.Length() ; IPntH++) {
@ -253,7 +256,7 @@ void HatchGen_HatchingGen::ClrPoints ()
// Purpose : Adds a domain to the hatching. // 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) ; myDomains.Append (Domain) ;
} }
@ -263,7 +266,7 @@ void HatchGen_HatchingGen::AddDomain (const HatchGen_Domain& Domain)
// Purpose : Returns the number of domains on the hatching. // Purpose : Returns the number of domains on the hatching.
//======================================================================= //=======================================================================
Standard_Integer HatchGen_HatchingGen::NbDomains () const Standard_Integer Geom2dHatch_Hatching::NbDomains () const
{ {
return myDomains.Length () ; return myDomains.Length () ;
} }
@ -273,7 +276,7 @@ Standard_Integer HatchGen_HatchingGen::NbDomains () const
// Purpose : Returns the Index-th domain on the hatching. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_Integer NbDomains = myDomains.Length () ; 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. // 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 #if RAISE_IF_NOSUCHOBJECT
Standard_Integer NbDomains = myDomains.Length () ; 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. // Purpose : Removes all the domains of the hatching.
//======================================================================= //=======================================================================
void HatchGen_HatchingGen::ClrDomains () void Geom2dHatch_Hatching::ClrDomains ()
{ {
myDomains.Clear () ; myDomains.Clear () ;
myIsDone = Standard_False ; myIsDone = Standard_False ;
@ -312,7 +315,7 @@ void HatchGen_HatchingGen::ClrDomains ()
// Function : ClassificationPoint // Function : ClassificationPoint
// Purpose : returns a 2d point on the curve // 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; Standard_Real t,a,b;
a = myCurve.FirstParameter(); a = myCurve.FirstParameter();
b = myCurve.LastParameter(); b = myCurve.LastParameter();

View File

@ -17,13 +17,11 @@
package HatchGen package HatchGen
uses uses
IntRes2d , IntRes2d,
StdFail , StdFail,
TopAbs , TopAbs,
TCollection , TCollection,
TColStd, gp
gp,
TopClass
is is
@ -66,16 +64,5 @@ is
class Domains instantiates Sequence from TCollection class Domains instantiates Sequence from TCollection
(Domain from HatchGen) ; (Domain from HatchGen) ;
generic class HatchingGen ;
generic class ElementGen ;
generic class ElementsGen,MapOfElements;
generic class Hatcher ,
Hatching ,
Hatchings ,
Element ,
Elements,
Classifier;
end HatchGen ; end HatchGen ;

View File

@ -41,7 +41,7 @@
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <Geom2d_Circle.hxx> #include <Geom2d_Circle.hxx>
#include <Geom2dGcc_MyQCurve.hxx> #include <Geom2dGcc_QCurve.hxx>
#include <GccEnt_QualifiedCirc.hxx> #include <GccEnt_QualifiedCirc.hxx>
#include <Geom2dGcc_MyL2d2Tan.hxx> #include <Geom2dGcc_MyL2d2Tan.hxx>
#include <BRepBuilderAPI_MakeWire.hxx> #include <BRepBuilderAPI_MakeWire.hxx>
@ -154,7 +154,7 @@ static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,co
} }
if(c1IsCircle) { if(c1IsCircle) {
Geom2dAdaptor_Curve acur(aCur2d2); Geom2dAdaptor_Curve acur(aCur2d2);
Geom2dGcc_MyQCurve qcur(acur, GccEnt_unqualified); Geom2dGcc_QCurve qcur(acur, GccEnt_unqualified);
GccEnt_QualifiedCirc qfromcur(aCir2d->Circ2d(), GccEnt_unqualified); GccEnt_QualifiedCirc qfromcur(aCir2d->Circ2d(), GccEnt_unqualified);
Geom2dGcc_MyL2d2Tan lintan(qfromcur, qcur , par1, tol); Geom2dGcc_MyL2d2Tan lintan(qfromcur, qcur , par1, tol);
if (lintan.IsDone()) { if (lintan.IsDone()) {
@ -168,8 +168,8 @@ static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,co
else { else {
Geom2dAdaptor_Curve acur1(aCur2d1); Geom2dAdaptor_Curve acur1(aCur2d1);
Geom2dAdaptor_Curve acur2(aCur2d2); Geom2dAdaptor_Curve acur2(aCur2d2);
Geom2dGcc_MyQCurve qcur1(acur1, GccEnt_unqualified); Geom2dGcc_QCurve qcur1(acur1, GccEnt_unqualified);
Geom2dGcc_MyQCurve qcur2(acur2, GccEnt_unqualified); Geom2dGcc_QCurve qcur2(acur2, GccEnt_unqualified);
Geom2dGcc_MyL2d2Tan lintan(qcur1, qcur2 , par1, par2, tol); Geom2dGcc_MyL2d2Tan lintan(qcur1, qcur2 , par1, par2, tol);
if (lintan.IsDone()) { if (lintan.IsDone()) {
gp_Lin2d lin = lintan.ThisSolution(); gp_Lin2d lin = lintan.ThisSolution();