1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0022967: Boolean operations between two cylinders with orthogonal axis generate a shape with big vertex tolerance

This commit is contained in:
PKV
2012-02-10 13:13:27 +00:00
committed by bugmaster
parent 1d37eeb6c1
commit 4f189102e9
32 changed files with 682 additions and 530 deletions

View File

@@ -60,6 +60,7 @@
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <BOPTColStd_Failure.hxx>
#include <IntTools_Context.hxx>
//=======================================================================
// function: BOPTools_Checker::BOPTools_Checker
@@ -149,6 +150,10 @@ void BOPTools_Checker::Perform()
{
myCheckResults.Clear();
try {
//
if (myContext.IsNull()) {
myContext=new IntTools_Context;
}
//
// 0. Prepare the IteratorOfCoupleOfShape
myDSIt.SetDataStructure(myDS);
@@ -284,7 +289,7 @@ void BOPTools_Checker::PerformVE()
continue;
}
//
aFlag=myContext.ComputeVE (aV1, aE2, aT);
aFlag=myContext->ComputeVE (aV1, aE2, aT);
//
if (!aFlag) {
char buf[512];
@@ -345,7 +350,7 @@ void BOPTools_Checker::PerformVF()
continue;
}
//
aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
aFlag=myContext->ComputeVS (aV1, aF2, aU, aV);
//
if (!aFlag) {
char buf[512];
@@ -857,7 +862,7 @@ void BOPTools_Checker::PerformEF()
aC.Bounds(aT1, aT2, aP1, aP2);
//
bValid=myContext.IsValidBlockForFaces(aT1, aT2, aC, aF1, aF2, 1.e-3);
bValid=myContext->IsValidBlockForFaces(aT1, aT2, aC, aF1, aF2, 1.e-3);
//
if (bValid) {
char buf[512];

View File

@@ -293,9 +293,9 @@
if (aTypeReference==TopAbs_SOLID) {
// ... \ Solid processing
IntTools_Context& aContext=myFiller->ChangeContext();
const Handle(IntTools_Context)& aContext=myFiller->Context();
const TopoDS_Solid& aReferenceSolid=TopoDS::Solid(aReference);
BRepClass3d_SolidClassifier& SC=aContext.SolidClassifier(aReferenceSolid);
BRepClass3d_SolidClassifier& SC=aContext->SolidClassifier(aReferenceSolid);
//
SC.Perform(aPxNear, aTol);
//
@@ -385,8 +385,8 @@
Standard_Boolean bIsValidPoint;
TopAbs_State aState=TopAbs_OUT;
//
IntTools_Context& aContext=myFiller->ChangeContext();
bIsValidPoint=aContext.IsValidPointForFace(aPxNear, aFaceReference, 1.e-3);
const Handle(IntTools_Context)& aContext=myFiller->Context();
bIsValidPoint=aContext->IsValidPointForFace(aPxNear, aFaceReference, 1.e-3);
//
if (bIsValidPoint) {
aState=TopAbs_IN;

View File

@@ -115,16 +115,21 @@ is
---
--- Selectors
---
---
---
SetContext(me:out;
aContext: Context from IntTools);
---Purpose:
--- Sets the intersecton context
---
Context(me)
returns Context from IntTools;
---C++:return const &
---Purpose:
--- Selector
---
ChangeContext(me:out)
returns Context from IntTools;
---C++:return &
-- ChangeContext(me:out)
-- returns Context from IntTools;
-- C++:return &
---Purpose:
--- Selector
---

View File

@@ -151,15 +151,23 @@
{
return mySectionAttribute;
}
//=======================================================================
// function: SetContext
// purpose:
//=======================================================================
void BOPTools_PaveFiller::SetContext(const Handle(IntTools_Context)& aContext)
{
myContext=aContext;
}
//=======================================================================
// function: Context
// purpose:
//=======================================================================
const IntTools_Context& BOPTools_PaveFiller::Context() const
const Handle(IntTools_Context)& BOPTools_PaveFiller::Context() const
{
return myContext;
}
/*
//=======================================================================
// function: ChangeContext
// purpose:
@@ -168,7 +176,7 @@
{
return myContext;
}
*/
//=======================================================================
// function: Perform
// purpose:
@@ -176,6 +184,10 @@
void BOPTools_PaveFiller::Perform()
{
try {
//
if (myContext.IsNull()) {
myContext=new IntTools_Context;
}
//
// 0. Prepare the IteratorOfCoupleOfShape
myDSIt.SetDataStructure(myDS);
@@ -247,6 +259,11 @@
const TColStd_SetOfInteger& aToolSubSet)
{
try {
//
if (myContext.IsNull()) {
myContext=new IntTools_Context;
}
//
//
// 0. Prepare the IteratorOfCoupleOfShape
myDSIt.SetDataStructure(myDS);
@@ -319,6 +336,11 @@
void BOPTools_PaveFiller::ToCompletePerform()
{
try {
//
if (myContext.IsNull()) {
myContext=new IntTools_Context;
}
//
PutPavesOnCurves();
MakeSplitEdges ();
@@ -392,7 +414,7 @@
continue;
}
//
aFlag=myContext.ComputeVE (aV1, aE2, aT);
aFlag=myContext->ComputeVE (aV1, aE2, aT);
//
if (!aFlag) {
//
@@ -471,7 +493,7 @@
const TopoDS_Vertex& aV1=TopoDS::Vertex(aS1);
const TopoDS_Face& aF2=TopoDS::Face (aS2);
//
aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
aFlag=myContext->ComputeVS (aV1, aF2, aU, aV);
//
if (!aFlag) {
//

View File

@@ -162,7 +162,7 @@
aEF.SetDiscretize (aDiscretize);
aEF.SetDeflection (aDeflection);
//
aEF.SetContext((IntTools_PContext)&myContext);
aEF.SetContext(myContext);
//
BRepAdaptor_Curve aCurve(aE);
@@ -350,7 +350,7 @@
Standard_Real aTNew;
//
iFlag=myContext.ComputeVE(aVF, aE, aTNew);
iFlag=myContext->ComputeVE(aVF, aE, aTNew);
//
aT=aTNew;
aNewShape=nVF;

View File

@@ -156,7 +156,7 @@ static Standard_Boolean CheckNewVertexAndUpdateData(const TopoDS_Vertex&
const Standard_Real theTolerance,
const BOPTools_PInterferencePool& theIntrPool,
const BooleanOperations_PShapesDataStructure& theDS,
IntTools_Context* theContext,
const Handle(IntTools_Context)& theContext,
const BOPTools_PaveSet& theEdgePaveSet,
const Standard_Boolean bAddNewVertex,
const Standard_Boolean bAddOldVertex,
@@ -218,9 +218,7 @@ static
aFFs.SetBlockLength(aNbFFs);
}
//
//modified by NIZNHY-PKV Thu Oct 20 07:09:57 2011f
bToSplit=Standard_False;
//modified by NIZNHY-PKV Thu Oct 20 07:09:59 2011t
for (; myDSIt.More(); myDSIt.Next()) {
Standard_Boolean justaddinterference = Standard_True;
@@ -272,8 +270,8 @@ static
TopoDS_Face aF2=TopoDS::Face(myDS->GetShape(nF2));
//
IntSurf_ListOfPntOn2S aListOfPnts;
GeomAPI_ProjectPointOnSurf& aProj1 = myContext.ProjPS(aF1);
GeomAPI_ProjectPointOnSurf& aProj2 = myContext.ProjPS(aF2);
GeomAPI_ProjectPointOnSurf& aProj1 = myContext->ProjPS(aF1);
GeomAPI_ProjectPointOnSurf& aProj2 = myContext->ProjPS(aF2);
BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
TColStd_MapOfInteger aMapEdgeIndex1, aMapEdgeIndex2;
@@ -383,6 +381,9 @@ static
anApproxTol=1.e-7;
IntTools_FaceFace aFF;
//
aFF.SetContext(myContext);
//
aFF.SetParameters (bToApproxC3d,
bToApproxC2dOnS1,
bToApproxC2dOnS2,
@@ -402,10 +403,7 @@ static
if (aTolR3D < 1.e-7){
aTolR3D=1.e-7;
}
//modified by NIZNHY-PKV Thu Oct 20 07:10:38 2011f
aFF.PrepareLines3D(bToSplit);
//aFF.PrepareLines3D();
//modified by NIZNHY-PKV Thu Oct 20 07:10:41 2011t
//
anIndexIn=0;
Standard_Integer aNbCurves, aNbPoints;
@@ -561,7 +559,7 @@ static
// Checking of validity in 2D
//
Standard_Real aTolerance = (aTolR3D < 1.e-3) ? 1.e-3 : aTolR3D;
bValid=myContext.IsValidBlockForFaces(aT1, aT2, aC, aF1, aF2, aTolerance);
bValid=myContext->IsValidBlockForFaces(aT1, aT2, aC, aF1, aF2, aTolerance);
//
if (!bValid) {
continue;
@@ -691,7 +689,7 @@ static
Standard_Boolean bVF;
Standard_Integer aNewShape;
//
bVF=myContext.IsValidPointForFaces (aPAlone, aF1, aF2, 1.e-3);
bVF=myContext->IsValidPointForFaces (aPAlone, aF1, aF2, 1.e-3);
//
if (bVF) {
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
@@ -772,7 +770,7 @@ static
// VE
if (!iV) {
iVE=myContext.ComputeVE (aV11, aE2, aTE);
iVE=myContext->ComputeVE (aV11, aE2, aTE);
if (!iVE) {
iCount++;
if (iCount>iCountExt) {
@@ -803,7 +801,7 @@ static
// VE
if (!iV) {
//
iVE=myContext.ComputeVE (aV12, aE2, aTE);
iVE=myContext->ComputeVE (aV12, aE2, aTE);
//
if (!iVE) {
iCount++;
@@ -850,7 +848,7 @@ static
nE2=aPBR.Edge();
const TopoDS_Edge& aE2=TopoDS::Edge(myDS->GetShape(nE2));
// VE
iVM=myContext.ComputeVE(aVM, aE2, aTmp);
iVM=myContext->ComputeVE(aVM, aE2, aTmp);
//
return iVM;
}
@@ -887,13 +885,13 @@ static
TopoDS_Face aF1=TopoDS::Face(myDS->GetShape(nF1));
TopoDS_Face aF2=TopoDS::Face(myDS->GetShape(nF2));
//
bVF=myContext.IsValidPointForFaces (aP1, aF1, aF2, aTolR3D);
bVF=myContext->IsValidPointForFaces (aP1, aF1, aF2, aTolR3D);
//
if (bVF) {
PutBoundPaveOnCurve (aP1, aT1, aBC, aFFi);
}
//
bVF=myContext.IsValidPointForFaces (aP2, aF1, aF2, aTolR3D);
bVF=myContext->IsValidPointForFaces (aP2, aF1, aF2, aTolR3D);
//
if (bVF) {
PutBoundPaveOnCurve (aP2, aT2, aBC, aFFi);
@@ -992,13 +990,13 @@ static
TopoDS_Face aF1=TopoDS::Face(myDS->GetShape(nF1));
TopoDS_Face aF2=TopoDS::Face(myDS->GetShape(nF2));
//
bVF=myContext.IsValidPointForFaces (aP1, aF1, aF2, aTolR3D);
bVF=myContext->IsValidPointForFaces (aP1, aF1, aF2, aTolR3D);
//
if (bVF) {
PutBoundPaveOnCurveSpec (aP1, aT1, aBC, aFFi);
}
//
bVF=myContext.IsValidPointForFaces (aP2, aF1, aF2, aTolR3D);
bVF=myContext->IsValidPointForFaces (aP2, aF1, aF2, aTolR3D);
//
if (bVF) {
PutBoundPaveOnCurveSpec (aP2, aT2, aBC, aFFi);
@@ -1068,7 +1066,7 @@ static
if(!aMap.Add(anE)) continue;
anErrStat =
myContext.ComputeVE(aNewVertex, TopoDS::Edge(anE), aPar);
myContext->ComputeVE(aNewVertex, TopoDS::Edge(anE), aPar);
if(anErrStat) continue;
//
Standard_Real aT1, aT2;
@@ -1080,7 +1078,7 @@ static
TopoDS_Vertex aNewVertex1;
BOPTools_Tools::MakeNewVertex(aP1, aTolV, aNewVertex1);
anErrStat =
myContext.ComputeVE(aNewVertex1, TopoDS::Edge(anE), aT1);
myContext->ComputeVE(aNewVertex1, TopoDS::Edge(anE), aT1);
if(!anErrStat) continue; //curve and edge seem to be coincide
aWhat = nV;
@@ -1116,7 +1114,7 @@ static
if(!aMap.Add(anE)) continue;
anErrStat =
myContext.ComputeVE(aNewVertex, TopoDS::Edge(anE), aPar);
myContext->ComputeVE(aNewVertex, TopoDS::Edge(anE), aPar);
if(anErrStat) continue;
//
Standard_Real aT1, aT2;
@@ -1128,7 +1126,7 @@ static
TopoDS_Vertex aNewVertex1;
BOPTools_Tools::MakeNewVertex(aP1, aTolV, aNewVertex1);
anErrStat =
myContext.ComputeVE(aNewVertex1, TopoDS::Edge(anE), aT1);
myContext->ComputeVE(aNewVertex1, TopoDS::Edge(anE), aT1);
if(!anErrStat) continue; //curve and edge seem to be coincide
aWhat = nV;
@@ -1355,7 +1353,7 @@ static
//
aTolVExt=BRep_Tool::Tolerance(aV);
ExtendedTolerance(nV, aTolVExt);
bIsVertexOnLine=myContext.IsVertexOnLine(aV, aTolVExt, aC, aTolR3D, aT);
bIsVertexOnLine=myContext->IsVertexOnLine(aV, aTolVExt, aC, aTolR3D, aT);
//
if (bIsVertexOnLine) {
BOPTools_Pave aPaveNew(nV, aT, BooleanOperations_SurfaceSurface);
@@ -1553,13 +1551,11 @@ static
}
}
//
//modified by NIZNHY-PKV Thu Oct 20 07:14:32 2011f
// Put closing pave if needded
for (j=1; j<=aNbCurves; ++j) {
BOPTools_Curve& aBC=aSCvs(j);
PutClosingPaveOnCurve (aBC, aFFi);
}
//modified by NIZNHY-PKV Thu Oct 20 07:14:34 2011t
//
// xxx
for (j=1; j<=aNbCurves; j++) {
@@ -1942,21 +1938,19 @@ void ProcessAloneStickVertices(const Standard_Integer nF1,
UnUsedMap(aSCvs, aPSF, aMapUnUsed);
aNbVtx=aMapUnUsed.Extent();
if (aNbVtx) {
IntTools_Context& aCtx=aPF.ChangeContext();
const Handle(IntTools_Context)& aCtx=aPF.Context();
//
aNbSCvs=aSCvs.Length();
if (aNbSCvs==1) {
BOPTools_Curve& aBC=aSCvs(1);
const IntTools_Curve& aIC=aBC.Curve();
Handle (Geom_Curve) aC3D= aIC.Curve();
//modified by NIZNHY-PKV Wed Nov 02 13:33:42 2011f
//
bIsClosed=IntTools_Tools::IsClosed(aC3D);
if (bIsClosed) {
return;
}
//modified by NIZNHY-PKV Wed Nov 02 13:33:44 2011t
GeomAPI_ProjectPointOnCurve& aProjPT=aCtx.ProjPT(aC3D);
GeomAPI_ProjectPointOnCurve& aProjPT=aCtx->ProjPT(aC3D);
//
for (jx=1; jx<=aNbVtx; ++jx) {
nV=aMapUnUsed(jx);
@@ -2384,8 +2378,8 @@ Standard_Boolean IsPairFound(const Standard_Integer nF1,
TopoDS_Face anOtherFace = TopoDS::Face(atmpShape);
gp_Pnt aP3d = aCurve->Value(t2);
if(myContext.IsPointInOnFace(TopoDS::Face(aFace), aP2dOnFace) &&
myContext.IsValidPointForFace(aP3d, anOtherFace, BRep_Tool::Tolerance(anEdge))) {
if(myContext->IsPointInOnFace(TopoDS::Face(aFace), aP2dOnFace) &&
myContext->IsValidPointForFace(aP3d, anOtherFace, BRep_Tool::Tolerance(anEdge))) {
BOPTools_Pave aPave1;
aPave1.SetParam(t1);
aPave1.SetIndex(-1);
@@ -2441,7 +2435,7 @@ Standard_Boolean IsPairFound(const Standard_Integer nF1,
TopoDS_Shape aOppFace = myDS->Shape(nFOpposite);
if(!bHasCBOnFace && !bFaceCBFound &&
myContext.IsValidPointForFace(aPMid, TopoDS::Face(aOppFace),
myContext->IsValidPointForFace(aPMid, TopoDS::Face(aOppFace),
BRep_Tool::Tolerance(anEdge) +
BRep_Tool::Tolerance(TopoDS::Face(aOppFace)))) {
bFaceCBFound = Standard_True;
@@ -2457,7 +2451,7 @@ Standard_Boolean IsPairFound(const Standard_Integer nF1,
TopoDS_Shape aTmpEdge = anExpE.Current();
Standard_Real aParameter = 0.;
if(myContext.ComputeVE(aVMid, TopoDS::Edge(aTmpEdge), aParameter) == 0) {
if(myContext->ComputeVE(aVMid, TopoDS::Edge(aTmpEdge), aParameter) == 0) {
bEdgeCBFound = Standard_True;
break;
}
@@ -2516,7 +2510,7 @@ Standard_Boolean IsPairFound(const Standard_Integer nF1,
Standard_Boolean bAddNewVertextmp = bAddNewVertex, bAddOldVertextmp = bAddOldVertex;
if(!CheckNewVertexAndUpdateData(aNewVertex, aPaveOnEdge.Param(), anEdge, aPaveOnCurve.Param(),
nF1, nF2, theTolerance, myIntrPool, myDS, &myContext, aPS,
nF1, nF2, theTolerance, myIntrPool, myDS, myContext, aPS,
bAddNewVertextmp, bAddOldVertextmp, theBC, aPaveToPut,
bAddNewVertex, bAddOldVertex)) {
bAddNewVertex = Standard_False;
@@ -2653,7 +2647,7 @@ Standard_Boolean IsPairFound(const Standard_Integer nF1,
TopoDS_Edge anOppEdge = TopoDS::Edge(myDS->Shape(anOppIndex));
Standard_Real aOppParameter = 0.;
if(myContext.ComputeVE(aNewVertex, anOppEdge, aOppParameter) == 0) {
if(myContext->ComputeVE(aNewVertex, anOppEdge, aOppParameter) == 0) {
if((aOppParameter > aRange.First()) && (aOppParameter < aRange.Last())) {
// put pave on same domain edge. begin
@@ -2766,7 +2760,7 @@ Standard_Boolean IsPairFound(const Standard_Integer nF1,
BRep_Builder aBB;
aBB.MakeVertex(aTestpVertex, aMidPnt, BRep_Tool::Tolerance(anEdge));
if(myContext.ComputeVE(aTestpVertex, aOppEdge, aProjPar) == 0) {
if(myContext->ComputeVE(aTestpVertex, aOppEdge, aProjPar) == 0) {
if(aProjPar > aCurRange2.First() && aProjPar < aCurRange2.Last()) {
if(!bReverse)
aNewCB.SetPaveBlock2(aPBCurrent2);
@@ -2834,7 +2828,7 @@ Standard_Boolean CheckNewVertexAndUpdateData(const TopoDS_Vertex& t
const Standard_Real theTolerance,
const BOPTools_PInterferencePool& theIntrPool,
const BooleanOperations_PShapesDataStructure& theDS,
IntTools_Context* theContext,
const Handle(IntTools_Context)& theContext,
const BOPTools_PaveSet& theEdgePaveSet,
const Standard_Boolean bAddNewVertex,
const Standard_Boolean bAddOldVertex,
@@ -2884,7 +2878,7 @@ Standard_Boolean CheckNewVertexAndUpdateData(const TopoDS_Vertex& t
Standard_Boolean bUpdateVertex = Standard_True;
if(ptest1.Distance(ptest2) > (BRep_Tool::Tolerance(aVertex) + BRep_Tool::Tolerance(theEdge))) {
IntTools_ShrunkRange aSR (theEdge, aV1, aV2, aRange, *theContext);
IntTools_ShrunkRange aSR (theEdge, aV1, aV2, aRange, theContext);
bUpdateVertex = !aSR.IsDone() || (aSR.ErrorStatus() != 0);
}
@@ -3135,21 +3129,11 @@ Standard_Boolean RejectPaveBlock(const IntTools_Curve& theC,
aC->D0(p1,pntf);
aC->D0(p2,pntl);
//
//modified by NIZNHY-PKV Thu Oct 20 09:13:45 2011f
//
aRT2=theRT*theRT;
d3d2 = pntf.SquareDistance(pntl);
if(d3d2 > aRT2) {
theRT=sqrt(d3d2);
}
//
/*
Standard_Real d3d = pntf.Distance(pntl);
if(d3d > theRT) {
theRT = d3d;
}
*/
//modified by NIZNHY-PKV Thu Oct 20 09:15:20 2011t
}
return Standard_True;
}
@@ -3306,7 +3290,7 @@ void CorrectTolR3D(BOPTools_PaveFiller& aPF,
TopoDS_Face aF[2];
//
BooleanOperations_PShapesDataStructure myDS=aPF.DS();
IntTools_Context& myContext=aPF.ChangeContext();
const Handle(IntTools_Context)& myContext=aPF.Context();
//
aTolTresh=0.0005;
aAmin=0.012;// 0.7-7 deg
@@ -3347,7 +3331,7 @@ void CorrectTolR3D(BOPTools_PaveFiller& aPF,
aC3D->D0(aT, aP);
//
for (i=0; i<2; ++i) {
GeomAPI_ProjectPointOnSurf& aPPS=myContext.ProjPS(aF[i]);
GeomAPI_ProjectPointOnSurf& aPPS=myContext->ProjPS(aF[i]);
aPPS.Perform(aP);
aPPS.LowerDistanceParameters(aU, aV);
BOPTools_Tools3D::GetNormalToSurface(aS[i], aU, aV, aDN[i]);
@@ -3379,7 +3363,6 @@ void CorrectTolR3D(BOPTools_PaveFiller& aPF,
aTolR3D=aTolR;
}
}
//modified by NIZNHY-PKV Thu Oct 20 07:18:39 2011f
//=======================================================================
// function: PutClosingPaveOnCurve
// purpose:
@@ -3441,4 +3424,3 @@ void BOPTools_PaveFiller::PutClosingPaveOnCurve(BOPTools_Curve& aBC,
}
}
}
//modified by NIZNHY-PKV Thu Oct 20 07:18:42 2011t

View File

@@ -204,12 +204,12 @@
gp_Pnt aP3d = aSurf->Value(aParU, aParV);
const TopoDS_Solid &aRefSolid = TopoDS::Solid(aRef);
IntTools_Context &aContext = myFiller->ChangeContext();
BRepClass3d_SolidClassifier &aSC =
aContext.SolidClassifier(aRefSolid);
//
const Handle(IntTools_Context)& aContext = myFiller->Context();
BRepClass3d_SolidClassifier &aSC =
aContext->SolidClassifier(aRefSolid);
//
aSC.Perform(aP3d, 1e-7);
//
//
aSt = aSC.State();
}
}
@@ -264,8 +264,8 @@
}
//
const TopoDS_Solid& aRefSolid=TopoDS::Solid(Ref);
IntTools_Context& aContext=myFiller->ChangeContext();
BRepClass3d_SolidClassifier& aSC=aContext.SolidClassifier(aRefSolid);
const Handle(IntTools_Context)& aContext=myFiller->Context();
BRepClass3d_SolidClassifier& aSC=aContext->SolidClassifier(aRefSolid);
//
aSC.Perform(aP3d, 1e-7);
//

View File

@@ -130,7 +130,7 @@ is
IsBlockInOnFace(myclass;
aPB : PaveBlock from BOPTools;
aF : Face from TopoDS;
aContext:out Context from IntTools)
aContext: Context from IntTools)
returns Boolean from Standard;
---Purpose:
--- Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e

View File

@@ -52,7 +52,7 @@ static
//=======================================================================
Standard_Boolean BOPTools_Tools::IsBlockInOnFace (const BOPTools_PaveBlock& aPB1,
const TopoDS_Face& aF,
IntTools_Context& aContext)
const Handle(IntTools_Context)& aContext)
{
Standard_Boolean bFlag;
Standard_Real f1, l1, ULD, VLD;
@@ -74,7 +74,7 @@ static
// Treatment P11
BOPTools_Tools::PointOnEdge(aE1, f1, aP11);
//
GeomAPI_ProjectPointOnSurf& aProjector=aContext.ProjPS(aF);
GeomAPI_ProjectPointOnSurf& aProjector=aContext->ProjPS(aF);
aProjector.Perform(aP11);
//
bFlag=aProjector.IsDone();
@@ -85,7 +85,7 @@ static
aProjector.LowerDistanceParameters(ULD, VLD);
aP2D.SetCoord(ULD, VLD);
//
bFlag=aContext.IsPointInOnFace (aF, aP2D);
bFlag=aContext->IsPointInOnFace (aF, aP2D);
//
if (!bFlag) {
return bFlag;
@@ -104,7 +104,7 @@ static
aProjector.LowerDistanceParameters(ULD, VLD);
aP2D.SetCoord(ULD, VLD);
//
bFlag=aContext.IsPointInOnFace (aF, aP2D);
bFlag=aContext->IsPointInOnFace (aF, aP2D);
//
if (!bFlag) {
return bFlag;
@@ -133,7 +133,7 @@ static
aProjector.LowerDistanceParameters(ULD, VLD);
aP2D.SetCoord(ULD, VLD);
//
bFlag=aContext.IsPointInOnFace (aF, aP2D);
bFlag=aContext->IsPointInOnFace (aF, aP2D);
//
if (!bFlag) {
return bFlag;

View File

@@ -55,13 +55,13 @@ is
RemoveSims (myclass;
aF: Face from TopoDS;
aContext:out Context from IntTools);
aContext: Context from IntTools);
---Purpose:
-- Remove seam edges from face <aF>
--
RemoveSims (myclass;
aS: Shape from TopoDS;
aContext:out Context from IntTools);
aContext: Context from IntTools);
---Purpose:
-- Remove seam edges from all faces of shape <aS>
--
@@ -78,7 +78,7 @@ is
IsSplitToReverse1 (myclass;
aE1: Edge from TopoDS;
aE2: Edge from TopoDS;
aContext:out Context from IntTools)
aContext: Context from IntTools)
returns Boolean from Standard;
---Purpose:
-- Returns TRUE if direction of the edge <aE1> is not
@@ -225,7 +225,7 @@ is
aE1 : Edge from TopoDS;
aF1 : Face from TopoDS;
aST1:out State from TopAbs;
aContext:out Context from IntTools);
aContext: Context from IntTools);
---Purpose:
--- Internal usage
---
@@ -308,7 +308,7 @@ is
aP2: Pnt from gp;
aF: Face from TopoDS;
aPx:out Pnt from gp;
aContext:out Context from IntTools);
aContext: Context from IntTools);
---Purpose:
--- For 3D-point <aP1> find projection point <aPx> on the face <aF>.
--- If the distance (<aP1>, <aPx>) > TolF =>
@@ -321,7 +321,7 @@ is
aF1 : Face from TopoDS;
aF2 : Face from TopoDS;
aST:out State from TopAbs;
aContext:out Context from IntTools);
aContext: Context from IntTools);
---Purpose:
--- Compute 3D-state for the point on the split edge <aSp>
--- (with base edge <aE1> and the face <aF1>) comparing with
@@ -408,7 +408,7 @@ is
aEF1 :Edge from TopoDS;
aF1 :Face from TopoDS;
aF2 :Face from TopoDS;
aContext:out Context from IntTools)
aContext: Context from IntTools)
returns State from TopAbs;
---Purpose:
--- Used in touch case
@@ -419,12 +419,12 @@ is
---
CheckSameDomainFaceInside(myclass; theFace1: Face from TopoDS;
theFace2: Face from TopoDS;
theContext: in out Context from IntTools)
theContext: Context from IntTools)
returns Boolean from Standard;
ComputeFaceState(myclass; theFace: Face from TopoDS;
theRef : Solid from TopoDS;
theContext: in out Context from IntTools;
theContext: Context from IntTools;
theState: out State from TopAbs)
returns Boolean from Standard;
@@ -437,7 +437,7 @@ is
aTolTangent:Real from Standard;
aTolRadius :Real from Standard;
aState :out State from TopAbs;
aContext:out Context from IntTools)
aContext: Context from IntTools)
returns Boolean from Standard;
TreatedAsAnalytic (myclass; aFx :Face from TopoDS;
@@ -446,7 +446,7 @@ is
aTolTangent:Real from Standard;
aTolRadius :Real from Standard;
aState :out State from TopAbs;
aContext:out Context from IntTools)
aContext: Context from IntTools)
returns Boolean from Standard;
HasAnalyticSurfaceType (myclass; aF: Face from TopoDS)

View File

@@ -72,7 +72,7 @@ static Standard_Boolean CheckKeepArguments(const TopoDS_Face& F1,
//purpose :
//=======================================================================
void BOPTools_Tools3D::RemoveSims (const TopoDS_Shape& aS,
IntTools_Context& aContext)
const Handle(IntTools_Context)& aContext)
{
TopExp_Explorer anExp(aS, TopAbs_FACE);
for (; anExp.More(); anExp.Next()) {
@@ -87,7 +87,7 @@ static Standard_Boolean CheckKeepArguments(const TopoDS_Face& F1,
//purpose :
//=======================================================================
void BOPTools_Tools3D::RemoveSims (const TopoDS_Face& aFF,
IntTools_Context& aContext)
const Handle(IntTools_Context)& aContext)
{
Standard_Boolean anIsClosed, anIsPointInFace1, anIsPointInFace2;
Standard_Real aT1, aT2, aT, aX, aY, dt=1.e-7, aTol;
@@ -139,12 +139,12 @@ static Standard_Boolean CheckKeepArguments(const TopoDS_Face& F1,
aP2Dx.SetX(aP2D.X()+dt*aV2Dx.X());
aP2Dx.SetY(aP2D.Y()+dt*aV2Dx.Y());
//
anIsPointInFace1=aContext.IsPointInFace(aF, aP2Dx);
anIsPointInFace1=aContext->IsPointInFace(aF, aP2Dx);
//
aP2Dx.SetX(aP2D.X()-dt*aV2Dx.X());
aP2Dx.SetY(aP2D.Y()-dt*aV2Dx.Y());
//
anIsPointInFace2=aContext.IsPointInFace(aF, aP2Dx);
anIsPointInFace2=aContext->IsPointInFace(aF, aP2Dx);
//
if (anIsPointInFace1 && anIsPointInFace2) {
@@ -475,7 +475,7 @@ Standard_Boolean BOPTools_Tools3D::DoSplitSEAMOnFace(const TopoDS_Edge& theSplit
//=======================================================================
Standard_Boolean BOPTools_Tools3D::IsSplitToReverse1 (const TopoDS_Edge& aEF1,
const TopoDS_Edge& aEF2,
IntTools_Context& aContext)
const Handle(IntTools_Context)& aContext)
{
Standard_Boolean aFlag;
Standard_Real aT1, aT2, aScPr, a, b;
@@ -494,7 +494,7 @@ Standard_Boolean BOPTools_Tools3D::DoSplitSEAMOnFace(const TopoDS_Edge& theSplit
gp_Dir aDT1(aV1);
//
aFlag=aContext.ProjectPointOnEdge(aP, aEF2, aT2);
aFlag=aContext->ProjectPointOnEdge(aP, aEF2, aT2);
//
aFlag=BOPTools_Tools2D::EdgeTangent(aEF2, aT2, aV2);
if(!aFlag) {
@@ -940,7 +940,7 @@ static void GetApproxNormalToFaceOnEdgeEx(const TopoDS_Edge& aE,
const TopoDS_Edge& anE1,
const TopoDS_Face& aF1,
TopAbs_State& aStPF1,
IntTools_Context& aContext)
const Handle(IntTools_Context)& aContext)
{
Standard_Boolean bIsAdjExists;
@@ -1008,14 +1008,14 @@ static void GetApproxNormalToFaceOnEdgeEx(const TopoDS_Edge& aE,
BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aSpxSimm, aFx1, aT, aPx2, aDNFx2);
}
aContext.ProjectPointOnEdge(aPx, anE1, aT1);
aContext->ProjectPointOnEdge(aPx, anE1, aT1);
PointNearE (anE1, aF1, aT1, aPF1, aMoreShift);
}
else {// if (bIsAdjExists)
BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aSpxSimm, aFx2, aT, aPx2, aDNFx2);
//
aContext.ProjectPointOnEdge(aPx, anE1, aT1);
aContext->ProjectPointOnEdge(aPx, anE1, aT1);
PointNearE (anE1, aF1, aT1, aPF1, aMoreShift);
}

View File

@@ -196,7 +196,7 @@
const gp_Pnt& aP2,
const TopoDS_Face& aF,
gp_Pnt& aPF,
IntTools_Context& aContext)
const Handle(IntTools_Context)& aContext)
{
Standard_Boolean bFlag;
Standard_Real aD, aTolF, U, V;
@@ -205,7 +205,7 @@
aTolF=BRep_Tool::Tolerance(aF);
//
GeomAPI_ProjectPointOnSurf& aProjector=aContext.ProjPS(aF);
GeomAPI_ProjectPointOnSurf& aProjector=aContext->ProjPS(aF);
//
aProjector.Perform(aP1);
//
@@ -245,7 +245,7 @@
const TopoDS_Face& aF1,
const TopoDS_Face& aF2,
TopAbs_State& aStPF,
IntTools_Context& aContext)
const Handle(IntTools_Context)& aContext)
{
Standard_Real aT1, aT2, aT, aTolF2, aDt2D;
gp_Pnt2d aPx2DNear;
@@ -284,7 +284,7 @@
//
//-- EJG
Standard_Boolean isIn = aContext.IsPointInFace(aF1,aPx2DNear);
Standard_Boolean isIn = aContext->IsPointInFace(aF1,aPx2DNear);
if( !isIn ) {
Standard_Real aEF1Tol = BRep_Tool::Tolerance(aEF1);
Standard_Real aF1Tol = BRep_Tool::Tolerance(aF1);
@@ -311,7 +311,7 @@
Standard_Boolean bFlag;
Standard_Real aD, U, V;
//
GeomAPI_ProjectPointOnSurf& aProjector=aContext.ProjPS(aF2);
GeomAPI_ProjectPointOnSurf& aProjector=aContext->ProjPS(aF2);
//
Handle(Geom_Surface) aS2=BRep_Tool::Surface(aF2);
//
@@ -784,7 +784,7 @@ void Add(const TopoDS_Shape& aS,
const TopoDS_Edge& aEF1,
const TopoDS_Face& aF1,
const TopoDS_Face& aF2,
IntTools_Context& aContext)
const Handle(IntTools_Context)& aContext)
{
gp_Dir aDBF1, aDNF2;
TopAbs_State aStPF;
@@ -836,7 +836,7 @@ void Add(const TopoDS_Shape& aS,
// ===========================================================================================
Standard_Boolean BOPTools_Tools3D::ComputeFaceState(const TopoDS_Face& theFace,
const TopoDS_Solid& theRef,
IntTools_Context& theContext,
const Handle(IntTools_Context)& theContext,
TopAbs_State& theState)
{
TopAbs_State aState = TopAbs_ON;
@@ -852,7 +852,7 @@ Standard_Boolean BOPTools_Tools3D::ComputeFaceState(const TopoDS_Face& theFace,
Standard_Real U = umin + adeltau;
Standard_Boolean bFoundValidPoint = Standard_False;
Standard_Boolean bFoundInFacePoint = Standard_False;
BRepClass3d_SolidClassifier& aSolidClassifier = theContext.SolidClassifier(theRef);
BRepClass3d_SolidClassifier& aSolidClassifier = theContext->SolidClassifier(theRef);
Standard_Integer i = 0, j = 0;
for(i = 1; !bFoundValidPoint && (i <= nbpoints); i++, U+=adeltau) {
@@ -861,7 +861,7 @@ Standard_Boolean BOPTools_Tools3D::ComputeFaceState(const TopoDS_Face& theFace,
for(j = 1; !bFoundValidPoint && (j <= nbpoints); j++, V+=adeltav) {
gp_Pnt2d aPoint(U,V);
if(theContext.IsPointInFace(theFace, aPoint)) {
if(theContext->IsPointInFace(theFace, aPoint)) {
bFoundInFacePoint = Standard_True;
gp_Pnt aP3d = aSurface->Value(U, V);
@@ -896,7 +896,7 @@ Standard_Boolean BOPTools_Tools3D::ComputeFaceState(const TopoDS_Face& theFace,
for(j = 1; !bFoundValidPoint && (j <= nbpoints); j++, V+=adeltav) {
gp_Pnt2d aPoint(U,V);
if(theContext.IsPointInOnFace(theFace, aPoint)) {
if(theContext->IsPointInOnFace(theFace, aPoint)) {
bFoundInFacePoint = Standard_True;
gp_Pnt aP3d = aSurface->Value(U, V);
@@ -909,7 +909,7 @@ Standard_Boolean BOPTools_Tools3D::ComputeFaceState(const TopoDS_Face& theFace,
TopoDS_Face aFace2 = aSolidClassifier.Face();
if(!aFace2.IsNull()) {
GeomAPI_ProjectPointOnSurf& aProjector = theContext.ProjPS(aFace2);
GeomAPI_ProjectPointOnSurf& aProjector = theContext->ProjPS(aFace2);
aProjector.Perform(aP3d);
if(aProjector.IsDone()) {
@@ -918,7 +918,7 @@ Standard_Boolean BOPTools_Tools3D::ComputeFaceState(const TopoDS_Face& theFace,
gp_Pnt2d aPoint2(U2, V2);
if(aProjector.LowerDistance() < aTolerance) {
if(theContext.IsPointInFace(aFace2, aPoint2))
if(theContext->IsPointInFace(aFace2, aPoint2))
aState = TopAbs_ON;
}
}
@@ -950,7 +950,7 @@ Standard_Boolean BOPTools_Tools3D::ComputeFaceState(const TopoDS_Face& theFace,
// ===========================================================================================
Standard_Boolean BOPTools_Tools3D::CheckSameDomainFaceInside(const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
IntTools_Context& theContext)
const Handle(IntTools_Context)& theContext)
{
Standard_Boolean bFoundON, bPointInFace;
Standard_Integer nbpoints, i, j;
@@ -976,14 +976,14 @@ Standard_Boolean BOPTools_Tools3D::CheckSameDomainFaceInside(const TopoDS_Face&
adeltav=(vmax - vmin) / (nbpoints + 1);
bFoundON = Standard_False;
//
GeomAPI_ProjectPointOnSurf& aProjector = theContext.ProjPS(theFace2);
GeomAPI_ProjectPointOnSurf& aProjector = theContext->ProjPS(theFace2);
//
for(i=1; i<=nbpoints; ++i){
U=umin+i*adeltau;
for(j=1; j<=nbpoints; ++j) {
V=vmin+j*adeltav;
aP2D.SetCoord(U,V);
bPointInFace=theContext.IsPointInFace(theFace1, aP2D);
bPointInFace=theContext->IsPointInFace(theFace1, aP2D);
if(bPointInFace) {
aP3D=aS1->Value(U, V);
aProjector.Perform(aP3D);
@@ -996,7 +996,7 @@ Standard_Boolean BOPTools_Tools3D::CheckSameDomainFaceInside(const TopoDS_Face&
return Standard_False;
}
//
bPointInFace=theContext.IsPointInFace(theFace2, aP2D);
bPointInFace=theContext->IsPointInFace(theFace2, aP2D);
if (bPointInFace) {
bFoundON = Standard_True;
}

View File

@@ -44,7 +44,7 @@ static
const Standard_Real aTolTangent,
const Standard_Real aTolR,
TopAbs_State& aSt,
IntTools_Context& )
const Handle(IntTools_Context)& )
{
Standard_Boolean bFlag, bIsAnalytic, bIsDirsCoinside;
Standard_Real aT1, aTb, aTe;
@@ -92,7 +92,7 @@ static
const Standard_Real aTolTangent,
const Standard_Real aTolR,
TopAbs_State& aSt,
IntTools_Context& aContext)
const Handle(IntTools_Context)& aContext)
{
Standard_Boolean bFlag, bIsAnalytic, bIsDirsCoinside;
Standard_Real aT1;
@@ -110,7 +110,7 @@ static
}
//
BOPTools_Tools3D::GetNormalToFaceOnEdge(anEx, aFx, aTx, aDNSx);
aContext.ProjectPointOnEdge(aPx, anE1, aT1);
aContext->ProjectPointOnEdge(aPx, anE1, aT1);
BOPTools_Tools3D::GetNormalToFaceOnEdge(anE1, aF1, aT1, aDNS1);
//
bIsDirsCoinside=IntTools_Tools::IsDirsCoinside(aDNSx, aDNS1, aTolTangent);