1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024639: Parallelization FillDS part of BO

The contents dealing with the parallel computation of Vertex/Face interferences.
This commit is contained in:
pkv
2014-04-08 12:22:16 +04:00
committed by apn
parent ba06f8bbee
commit e30616a780
3 changed files with 583 additions and 479 deletions

View File

@@ -18,24 +18,31 @@
#include <BOPAlgo_PaveFiller.ixx> #include <BOPAlgo_PaveFiller.ixx>
#include <NCollection_IncAllocator.hxx> #include <NCollection_IncAllocator.hxx>
//
#include <GeomAPI_ProjectPointOnSurf.hxx>
//
#include <Bnd_Box.hxx> #include <Bnd_Box.hxx>
//
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepBndLib.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRep_Builder.hxx>
//
#include <IntTools_EdgeFace.hxx> #include <IntTools_EdgeFace.hxx>
#include <IntTools_Range.hxx> #include <IntTools_Range.hxx>
#include <IntTools_SequenceOfCommonPrts.hxx> #include <IntTools_SequenceOfCommonPrts.hxx>
#include <IntTools_CommonPrt.hxx> #include <IntTools_CommonPrt.hxx>
#include <BOPTools_AlgoTools.hxx> //
#include <BOPCol_MapOfInteger.hxx> #include <BOPCol_MapOfInteger.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_TBB.hxx>
//
#include <BOPInt_Context.hxx> #include <BOPInt_Context.hxx>
#include <BOPInt_Tools.hxx>
//
#include <BOPDS_Interf.hxx> #include <BOPDS_Interf.hxx>
#include <BOPDS_Iterator.hxx> #include <BOPDS_Iterator.hxx>
#include <BOPDS_PaveBlock.hxx> #include <BOPDS_PaveBlock.hxx>
@@ -43,17 +50,74 @@
#include <BOPDS_DataMapOfPaveBlockListOfInteger.hxx> #include <BOPDS_DataMapOfPaveBlockListOfInteger.hxx>
#include <BOPDS_CommonBlock.hxx> #include <BOPDS_CommonBlock.hxx>
#include <BOPDS_Pave.hxx> #include <BOPDS_Pave.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPDS_CoupleOfPaveBlocks.hxx> #include <BOPDS_CoupleOfPaveBlocks.hxx>
#include <BRepBndLib.hxx> //
#include <BOPTools_AlgoTools.hxx>
//
#include <BOPAlgo_Tools.hxx> #include <BOPAlgo_Tools.hxx>
#include <BOPInt_Tools.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRep_Builder.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
//=======================================================================
//class : BOPAlgo_EdgeFace
//purpose :
//=======================================================================
class BOPAlgo_EdgeFace : public IntTools_EdgeFace {
public:
BOPAlgo_EdgeFace()
: IntTools_EdgeFace(), myIE(-1), myIF(-1) {
};
//
~BOPAlgo_EdgeFace(){
};
//
void SetIndices(const Standard_Integer nE,
const Standard_Integer nF) {
myIE=nE;
myIF=nF;
}
//
void Indices(Standard_Integer& nE,
Standard_Integer& nF) {
nE=myIE;
nF=myIF;
}
//
void SetNewSR(const IntTools_Range& aR){
myNewSR=aR;
}
//
IntTools_Range& NewSR(){
return myNewSR;
}
//
void SetPaveBlock(const Handle(BOPDS_PaveBlock)& aPB) {
myPB=aPB;
}
//
Handle(BOPDS_PaveBlock)& PaveBlock() {
return myPB;
}
//
protected:
Standard_Integer myIE;
Standard_Integer myIF;
IntTools_Range myNewSR;
Handle(BOPDS_PaveBlock) myPB;
};
//
//=======================================================================
typedef BOPCol_NCVector<BOPAlgo_EdgeFace> BOPAlgo_VectorOfEdgeFace;
//
typedef BOPCol_TBBContextFunctor
<BOPAlgo_EdgeFace,
BOPAlgo_VectorOfEdgeFace,
Handle_BOPInt_Context,
BOPInt_Context> BOPAlgo_EdgeFaceFunctor;
//
typedef BOPCol_TBBContextCnt
<BOPAlgo_EdgeFaceFunctor,
BOPAlgo_VectorOfEdgeFace,
Handle_BOPInt_Context> BOPAlgo_EdgeFaceCnt;
//
//======================================================================= //=======================================================================
//function : PerformEF //function : PerformEF
//purpose : //purpose :
@@ -64,23 +128,26 @@
// //
myErrorStatus=0; myErrorStatus=0;
// //
FillShrunkData(TopAbs_EDGE, TopAbs_FACE);
//
myIterator->Initialize(TopAbs_EDGE, TopAbs_FACE); myIterator->Initialize(TopAbs_EDGE, TopAbs_FACE);
iSize=myIterator->ExpectedLength(); iSize=myIterator->ExpectedLength();
if (!iSize) { if (!iSize) {
return; return;
} }
//---------------------------------------------------------------------- //
Standard_Boolean bJustAdd, bV[2]; Standard_Boolean bJustAdd, bV[2];
Standard_Integer nE, nF, aDiscretize, i, aNbCPrts, iX, nV[2]; Standard_Integer nE, nF, aDiscretize, i, aNbCPrts, iX, nV[2];
Standard_Integer aNbEdgeFace, k;
Standard_Real aTolE, aTolF, aTS1, aTS2, aT1, aT2, aDeflection; Standard_Real aTolE, aTolF, aTS1, aTS2, aT1, aT2, aDeflection;
Handle(NCollection_IncAllocator) aAllocator; Handle(NCollection_IncAllocator) aAllocator;
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
BOPDS_ListIteratorOfListOfPaveBlock aIt; BOPDS_ListIteratorOfListOfPaveBlock aIt;
BOPAlgo_VectorOfEdgeFace aVEdgeFace;
BRep_Builder aBB;
//-----------------------------------------------------scope f //-----------------------------------------------------scope f
// //
BRep_Builder aBB; ////aAllocator=new NCollection_IncAllocator();
//
aAllocator=new NCollection_IncAllocator();
BOPCol_MapOfInteger aMIEFC(100, aAllocator); BOPCol_MapOfInteger aMIEFC(100, aAllocator);
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator); BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator);
@@ -111,8 +178,6 @@
// //
BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF); BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
const BOPDS_IndexedMapOfPaveBlock& aMPBF=aFI.PaveBlocksOn(); const BOPDS_IndexedMapOfPaveBlock& aMPBF=aFI.PaveBlocksOn();
const BOPCol_MapOfInteger& aMIFOn=aFI.VerticesOn();
const BOPCol_MapOfInteger& aMIFIn=aFI.VerticesIn();
// //
aTolE=BRep_Tool::Tolerance(aE); aTolE=BRep_Tool::Tolerance(aE);
aTolF=BRep_Tool::Tolerance(aF); aTolF=BRep_Tool::Tolerance(aF);
@@ -128,11 +193,8 @@
} }
// //
if (!aPB->HasShrunkData()) { if (!aPB->HasShrunkData()) {
FillShrunkData(aPB);
if (myWarningStatus) {
continue; continue;
} }
}
// //
Bnd_Box aBBE; Bnd_Box aBBE;
aPB->ShrunkData(aTS1, aTS2, aBBE); aPB->ShrunkData(aTS1, aTS2, aBBE);
@@ -141,8 +203,10 @@
continue; continue;
} }
// //
// -----------f BOPAlgo_EdgeFace& aEdgeFace=aVEdgeFace.Append1();
IntTools_EdgeFace aEdgeFace; //
aEdgeFace.SetIndices(nE, nF);
aEdgeFace.SetPaveBlock(aPB);
// //
aEdgeFace.SetEdge (aE); aEdgeFace.SetEdge (aE);
aEdgeFace.SetFace (aF); aEdgeFace.SetFace (aF);
@@ -150,26 +214,50 @@
aEdgeFace.SetTolF (aTolF); aEdgeFace.SetTolF (aTolF);
aEdgeFace.SetDiscretize (aDiscretize); aEdgeFace.SetDiscretize (aDiscretize);
aEdgeFace.SetDeflection (aDeflection); aEdgeFace.SetDeflection (aDeflection);
aEdgeFace.SetContext(myContext);
// //
IntTools_Range aSR(aTS1, aTS2); IntTools_Range aSR(aTS1, aTS2);
IntTools_Range anewSR=aSR; IntTools_Range anewSR=aSR;
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, anewSR); BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, anewSR);
aEdgeFace.SetNewSR(anewSR);
// //
aPB->Range(aT1, aT2); aPB->Range(aT1, aT2);
IntTools_Range aPBRange(aT1, aT2); IntTools_Range aPBRange(aT1, aT2);
aSR = aPBRange; aSR = aPBRange;
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange); BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange);
//
aEdgeFace.SetRange (aPBRange); aEdgeFace.SetRange (aPBRange);
// //
aEdgeFace.Perform(); }//for (; aIt.More(); aIt.Next()) {
}//for (; myIterator->More(); myIterator->Next()) {
//
aNbEdgeFace=aVEdgeFace.Extent();
//=================================================================
BOPAlgo_EdgeFaceCnt::Perform(myRunParallel, aVEdgeFace, myContext);
//=================================================================
//
for (k=0; k < aNbEdgeFace; ++k) {
BOPAlgo_EdgeFace& aEdgeFace=aVEdgeFace(k);
if (!aEdgeFace.IsDone()) { if (!aEdgeFace.IsDone()) {
continue; continue;
} }
//~~~
aEdgeFace.Indices(nE, nF);
// //
const TopoDS_Edge& aE=aEdgeFace.Edge();
const TopoDS_Face& aF=aEdgeFace.Face();
//
aTolE=aEdgeFace.TolE();
aTolF=aEdgeFace.TolF();
const IntTools_Range& anewSR=aEdgeFace.NewSR();
Handle(BOPDS_PaveBlock)& aPB=aEdgeFace.PaveBlock();
//
aPB->Range(aT1, aT2);
aPB->Indices(nV[0], nV[1]); aPB->Indices(nV[0], nV[1]);
// //
BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
////const BOPDS_IndexedMapOfPaveBlock& aMPBF=aFI.PaveBlocksOn();
const BOPCol_MapOfInteger& aMIFOn=aFI.VerticesOn();
const BOPCol_MapOfInteger& aMIFIn=aFI.VerticesIn();
//~~~
const IntTools_SequenceOfCommonPrts& aCPrts=aEdgeFace.CommonParts(); const IntTools_SequenceOfCommonPrts& aCPrts=aEdgeFace.CommonParts();
aNbCPrts=aCPrts.Length(); aNbCPrts=aCPrts.Length();
for (i=1; i<=aNbCPrts; ++i) { for (i=1; i<=aNbCPrts; ++i) {
@@ -181,7 +269,7 @@
Standard_Integer j; Standard_Integer j;
Standard_Real aT, aTolToDecide; Standard_Real aT, aTolToDecide;
TopoDS_Vertex aVnew; TopoDS_Vertex aVnew;
//
BOPInt_Tools::VertexParameter(aCPart, aT); BOPInt_Tools::VertexParameter(aCPart, aT);
BOPTools_AlgoTools::MakeNewVertex(aE, aT, aF, aVnew); BOPTools_AlgoTools::MakeNewVertex(aE, aT, aF, aVnew);
// //
@@ -213,7 +301,8 @@
if (bIsOnPave[j]) { if (bIsOnPave[j]) {
bV[j]=CheckFacePaves(nV[j], aMIFOn, aMIFIn); bV[j]=CheckFacePaves(nV[j], aMIFOn, aMIFIn);
if (bV[j]) { if (bV[j]) {
const TopoDS_Vertex& aV = (*(TopoDS_Vertex *)(&myDS->Shape(nV[j]))); const TopoDS_Vertex& aV=
(*(TopoDS_Vertex *)(&myDS->Shape(nV[j])));
BOPTools_AlgoTools::UpdateVertex(aE, aT, aV); BOPTools_AlgoTools::UpdateVertex(aE, aT, aV);
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nV[j]); BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nV[j]);
Bnd_Box& aBoxDS=aSIDS.ChangeBox(); Bnd_Box& aBoxDS=aSIDS.ChangeBox();
@@ -231,7 +320,9 @@
} }
// //
const gp_Pnt& aPnew = BRep_Tool::Pnt(aVnew); const gp_Pnt& aPnew = BRep_Tool::Pnt(aVnew);
if (!myContext->IsValidPointForFace(aPnew, aF, aTolE+aTolF)) { if (!myContext->IsValidPointForFace(aPnew,
aF,
aTolE+aTolF)) {
continue; continue;
} }
// //
@@ -285,9 +376,7 @@
break; break;
}//switch (aType) { }//switch (aType) {
}//for (i=1; i<=aNbCPrts; ++i) { }//for (i=1; i<=aNbCPrts; ++i) {
// -----------t }// for (k=0; k < aNbEdgeEdge; ++k) {
}//for (; aIt.More(); aIt.Next()) {
}//for (; myIterator->More(); myIterator->Next()) {
// //
//========================================= //=========================================
// post treatment // post treatment
@@ -309,9 +398,7 @@
aMIEFC.Clear(); aMIEFC.Clear();
aMVCPB.Clear(); aMVCPB.Clear();
aMPBLI.Clear(); aMPBLI.Clear();
aAllocator.Nullify(); ////aAllocator.Nullify();
//
} }
//======================================================================= //=======================================================================
//function : PerformVertices1 //function : PerformVertices1
@@ -452,7 +539,8 @@
// function: CheckFacePaves // function: CheckFacePaves
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves (const Standard_Integer nVx, Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves
(const Standard_Integer nVx,
const BOPCol_MapOfInteger& aMIFOn, const BOPCol_MapOfInteger& aMIFOn,
const BOPCol_MapOfInteger& aMIFIn) const BOPCol_MapOfInteger& aMIFIn)
{ {
@@ -485,7 +573,8 @@
// function: CheckFacePaves // function: CheckFacePaves
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves (const TopoDS_Vertex& aVnew, Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves
(const TopoDS_Vertex& aVnew,
const BOPCol_MapOfInteger& aMIF) const BOPCol_MapOfInteger& aMIF)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
@@ -510,7 +599,8 @@
//function : ForceInterfVF //function : ForceInterfVF
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean BOPAlgo_PaveFiller::ForceInterfVF(const Standard_Integer nV, Standard_Boolean BOPAlgo_PaveFiller::ForceInterfVF
(const Standard_Integer nV,
const Standard_Integer nF) const Standard_Integer nF)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;

View File

@@ -18,7 +18,6 @@ class EdgeFace from IntTools
---Purpose: The class provides Edge/Face algorithm to determine ---Purpose: The class provides Edge/Face algorithm to determine
--- common parts between edge and face in 3-d space. --- common parts between edge and face in 3-d space.
-- Common parts can be : Vertices or Edges. -- Common parts can be : Vertices or Edges.
---
uses uses
Pnt from gp, Pnt from gp,
@@ -44,82 +43,100 @@ is
--- Empty Constructor --- Empty Constructor
--- ---
SetEdge (me:out; anEdge:Edge from TopoDS); SetEdge (me:out;
anEdge:Edge from TopoDS);
---Purpose: ---Purpose:
--- Initializes algorithm by the edge anEdge --- Initializes algorithm by the edge anEdge
---
SetTolE (me:out; aTolEdge1:Real from Standard); SetTolE (me:out;
aTolEdge1:Real from Standard);
---Purpose: ---Purpose:
--- Initializes algorithm by edge tolerance --- Initializes algorithm by edge tolerance
---
SetFace (me:out; aFace:Face from TopoDS); SetFace(me:out;
aFace:Face from TopoDS);
---Purpose: ---Purpose:
--- Initializes algorithm by the face aFace --- Initializes algorithm by the face aFace
---
SetTolF (me:out; aTolFace:Real from Standard); SetTolF (me:out;
aTolFace:Real from Standard);
---Purpose: ---Purpose:
--- Initializes algorithm by face tolerance --- Initializes algorithm by face tolerance
---
SetDiscretize (me:out; aDiscret:Integer from Standard); Edge (me)
returns Edge from TopoDS;
---C++: return const &
---Purpose:
--- Returns edge
Face(me)
returns Face from TopoDS;
---C++: return const &
---Purpose:
--- Returns face
TolE (me)
returns Real from Standard;
---Purpose:
--- Returns tolerance of the edge
TolF (me)
returns Real from Standard;
---Purpose:
--- Returns tolerance of the face
SetDiscretize (me:out;
aDiscret:Integer from Standard);
---Purpose: ---Purpose:
--- Initializes algorithm by discretization value --- Initializes algorithm by discretization value
---
SetDeflection (me:out; aDeflection:Real from Standard); SetDeflection (me:out;
aDeflection:Real from Standard);
---Purpose: ---Purpose:
--- Initializes algorithm by deflection value --- Initializes algorithm by deflection value
---
SetEpsilonT (me:out; anEpsT:Real from Standard); SetEpsilonT(me:out;
anEpsT:Real from Standard);
---Purpose: ---Purpose:
--- Initializes algorithm by parameter tolerance --- Initializes algorithm by parameter tolerance
---
SetEpsilonNull (me:out; anEpsNull:Real from Standard); SetEpsilonNull (me:out;
anEpsNull:Real from Standard);
---Purpose: ---Purpose:
--- Initializes algorithm by distance tolerance --- Initializes algorithm by distance tolerance
---
SetRange (me:out; aRange:Range from IntTools); SetRange (me:out;
aRange:Range from IntTools);
---Purpose: ---Purpose:
--- Sets boundaries for edge. --- Sets boundaries for edge.
--- The algorithm processes edge inside these boundaries. --- The algorithm processes edge inside these boundaries.
---
SetRange (me:out; aFirst, aLast:Real from Standard); SetRange (me:out;
aFirst, aLast:Real from Standard);
---Purpose: ---Purpose:
--- Sets boundaries for edge. --- Sets boundaries for edge.
--- The algorithm processes edge inside these boundaries. --- The algorithm processes edge inside these boundaries.
---
SetContext (me: in out; SetContext (me: in out;
theContext: Context from BOPInt); theContext: Context from BOPInt);
---Purpose: ---Purpose:
--- Sets the intersecton context --- Sets the intersecton context
---
Context (me) Context (me)
returns Context from BOPInt; returns Context from BOPInt;
---C++:return const & ---C++:return const &
---Purpose: ---Purpose:
--- Gets the intersecton context --- Gets the intersecton context
---
Perform (me:out); Perform (me:out);
---Purpose: ---Purpose:
--- Launches the process --- Launches the process
---
IsDone (me) IsDone (me)
returns Boolean from Standard; returns Boolean from Standard;
---Purpose: ---Purpose:
--- Returns true if computation was done --- Returns true if computation was done
--- successfully, otherwise returns false --- successfully, otherwise returns false
---
ErrorStatus(me) ErrorStatus(me)
returns Integer from Standard; returns Integer from Standard;
@@ -131,105 +148,106 @@ is
--- 6 - discretization failed --- 6 - discretization failed
--- 7 - no projectable ranges found --- 7 - no projectable ranges found
--- 11 - distance computing error --- 11 - distance computing error
---
CommonParts (me) CommonParts (me)
returns SequenceOfCommonPrts from IntTools; returns SequenceOfCommonPrts from IntTools;
---C++: return const& ---C++: return const&
---Purpose: ---Purpose:
--- Returns results --- Returns results
---
Range (me) Range (me)
returns Range from IntTools; returns Range from IntTools;
---C++: return const& ---C++: return const&
---Purpose: ---Purpose:
--- Returns boundaries for edge --- Returns boundaries for edge
---
--
IsEqDistance(myclass; IsEqDistance(myclass;
aP: Pnt from gp; aP: Pnt from gp;
aS: Surface from BRepAdaptor; aS: Surface from BRepAdaptor;
aT: Real from Standard; aT: Real from Standard;
aD:out Real from Standard) aD:out Real from Standard)
returns Boolean from Standard; returns Boolean from Standard;
---Purpose:
---
---
--
----------------------------------------------------- -------------------------------------------------------
-- Block of private methods of the algorithm -- -- Block of protected methods of the algorithm --
----------------------------------------------------- -------------------------------------------------------
CheckData (me:out) is private; CheckData (me:out)
is protected;
Prepare (me:out) is private; Prepare (me:out)
is protected;
IsProjectable (me; t:Real from Standard) IsProjectable (me;
t:Real from Standard)
returns Boolean from Standard returns Boolean from Standard
is private; is protected;
FindProjectableRoot (me:out; FindProjectableRoot (me:out;
t1,t2:Real from Standard; t1,t2:Real from Standard;
f1,f2:Integer from Standard; f1,f2:Integer from Standard;
tRoot:out Real from Standard) tRoot:out Real from Standard)
is private; is protected;
DistanceFunction (me:out;t:Real from Standard) DistanceFunction (me:out;
t:Real from Standard)
returns Real from Standard returns Real from Standard
is private; is protected;
DerivativeFunction (me:out;t:Real from Standard) DerivativeFunction (me:out;
t:Real from Standard)
returns Real from Standard returns Real from Standard
is private; is protected;
PrepareArgsFuncArrays (me:out;t1,t2:Real from Standard) PrepareArgsFuncArrays (me:out;
is private; t1,t2:Real from Standard)
is protected;
AddDerivativePoints (me:out; t,f:CArray1OfReal from IntTools) AddDerivativePoints(me:out;
is private; t,f:CArray1OfReal from IntTools)
is protected;
FindSimpleRoot (me:out; IP:Integer from Standard; FindSimpleRoot (me:out;
IP:Integer from Standard;
ta, tb, fA:Real from Standard) ta, tb, fA:Real from Standard)
returns Real from Standard returns Real from Standard
is private; is protected;
FindGoldRoot (me:out; ta, tb, coeff:Real from Standard) FindGoldRoot (me:out;
ta, tb, coeff:Real from Standard)
returns Real from Standard returns Real from Standard
is private; is protected;
MakeType (me:out; MakeType (me:out;
aCP: out CommonPrt from IntTools) aCP: out CommonPrt from IntTools)
returns Integer from Standard returns Integer from Standard
is private; is protected;
IsIntersection (me:out; ta,tb:Real from Standard) IsIntersection (me:out;
is private; ta,tb:Real from Standard)
is protected;
FindDerivativeRoot (me:out;t,f:CArray1OfReal from IntTools) FindDerivativeRoot(me:out;
is private; t,f:CArray1OfReal from IntTools)
is protected;
--
RemoveIdenticalRoots(me:out) RemoveIdenticalRoots(me:out)
is private; is protected;
CheckTouch (me: out; CheckTouch (me: out;
aCP: CommonPrt from IntTools; aCP: CommonPrt from IntTools;
aTX:out Real from Standard) aTX:out Real from Standard)
returns Boolean from Standard returns Boolean from Standard
is private; is protected;
CheckTouchVertex (me:out; CheckTouchVertex (me:out;
aCP: CommonPrt from IntTools; aCP: CommonPrt from IntTools;
aTX:out Real from Standard) aTX:out Real from Standard)
returns Boolean from Standard returns Boolean from Standard
is private; is protected;
--
fields fields
-- Data -- Data

View File

@@ -58,7 +58,7 @@
#include <Extrema_POnCurv.hxx> #include <Extrema_POnCurv.hxx>
#include <Extrema_POnSurf.hxx> #include <Extrema_POnSurf.hxx>
// modified by NIZHNY-MKK Thu Jul 21 11:35:59 2005
#include <IntCurveSurface_HInter.hxx> #include <IntCurveSurface_HInter.hxx>
#include <GeomAdaptor_HCurve.hxx> #include <GeomAdaptor_HCurve.hxx>
#include <GeomAdaptor_HSurface.hxx> #include <GeomAdaptor_HSurface.hxx>
@@ -121,7 +121,6 @@ const Handle(BOPInt_Context)& IntTools_EdgeFace::Context()const
{ {
myEdge=anEdge; myEdge=anEdge;
} }
//======================================================================= //=======================================================================
//function : SetFace //function : SetFace
//purpose : //purpose :
@@ -130,7 +129,6 @@ const Handle(BOPInt_Context)& IntTools_EdgeFace::Context()const
{ {
myFace=aFace; myFace=aFace;
} }
//======================================================================= //=======================================================================
//function : SetTolE //function : SetTolE
//purpose : //purpose :
@@ -147,7 +145,38 @@ const Handle(BOPInt_Context)& IntTools_EdgeFace::Context()const
{ {
myTolF=aTol; myTolF=aTol;
} }
//=======================================================================
//function : Edge
//purpose :
//=======================================================================
const TopoDS_Edge& IntTools_EdgeFace::Edge()const
{
return myEdge;
}
//=======================================================================
//function : Face
//purpose :
//=======================================================================
const TopoDS_Face& IntTools_EdgeFace::Face()const
{
return myFace;
}
//=======================================================================
//function : TolE
//purpose :
//=======================================================================
Standard_Real IntTools_EdgeFace::TolE()const
{
return myTolE;
}
//=======================================================================
//function : TolF
//purpose :
//=======================================================================
Standard_Real IntTools_EdgeFace::TolF()const
{
return myTolF;
}
//======================================================================= //=======================================================================
//function : SetDiscretize //function : SetDiscretize
//purpose : //purpose :
@@ -282,7 +311,8 @@ void IntTools_EdgeFace::CheckData()
// //
// //
// 3.Prepare myPars // 3.Prepare myPars
pri = IntTools::PrepareArgs(myC, myTmax, myTmin, myDiscret, myDeflection, aPars); pri = IntTools::PrepareArgs(myC, myTmax, myTmin,
myDiscret, myDeflection, aPars);
if (pri) { if (pri) {
myErrorStatus=6; myErrorStatus=6;
return; return;
@@ -370,7 +400,8 @@ void IntTools_EdgeFace::CheckData()
//function : FindProjectableRoot //function : FindProjectableRoot
//purpose : //purpose :
//======================================================================= //=======================================================================
void IntTools_EdgeFace::FindProjectableRoot (const Standard_Real tt1, void IntTools_EdgeFace::FindProjectableRoot
(const Standard_Real tt1,
const Standard_Real tt2, const Standard_Real tt2,
const Standard_Integer ff1, const Standard_Integer ff1,
const Standard_Integer ff2, const Standard_Integer ff2,
@@ -408,7 +439,8 @@ void IntTools_EdgeFace::CheckData()
//function : IsProjectable //function : IsProjectable
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean IntTools_EdgeFace::IsProjectable(const Standard_Real aT) const Standard_Boolean IntTools_EdgeFace::IsProjectable
(const Standard_Real aT) const
{ {
Standard_Boolean bFlag; Standard_Boolean bFlag;
gp_Pnt aPC; gp_Pnt aPC;
@@ -422,7 +454,8 @@ Standard_Boolean IntTools_EdgeFace::IsProjectable(const Standard_Real aT) const
//function : DistanceFunction //function : DistanceFunction
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t) Standard_Real IntTools_EdgeFace::DistanceFunction
(const Standard_Real t)
{ {
Standard_Real aD; Standard_Real aD;
@@ -466,7 +499,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
//function : IsEqDistance //function : IsEqDistance
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean IntTools_EdgeFace::IsEqDistance(const gp_Pnt& aP, Standard_Boolean IntTools_EdgeFace::IsEqDistance
(const gp_Pnt& aP,
const BRepAdaptor_Surface& aBAS, const BRepAdaptor_Surface& aBAS,
const Standard_Real aTol, const Standard_Real aTol,
Standard_Real& aD) Standard_Real& aD)
@@ -568,13 +602,12 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
AddDerivativePoints(anArgs, aFunc); AddDerivativePoints(anArgs, aFunc);
} }
//======================================================================= //=======================================================================
//function : AddDerivativePoints //function : AddDerivativePoints
//purpose : //purpose :
//======================================================================= //=======================================================================
void IntTools_EdgeFace::AddDerivativePoints(const IntTools_CArray1OfReal& t, void IntTools_EdgeFace::AddDerivativePoints
(const IntTools_CArray1OfReal& t,
const IntTools_CArray1OfReal& f) const IntTools_CArray1OfReal& f)
{ {
Standard_Integer i, j, n, k, nn=100; Standard_Integer i, j, n, k, nn=100;
@@ -711,7 +744,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
//function : DerivativeFunction //function : DerivativeFunction
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real IntTools_EdgeFace::DerivativeFunction(const Standard_Real t2) Standard_Real IntTools_EdgeFace::DerivativeFunction
(const Standard_Real t2)
{ {
Standard_Real t1, t3, aD1, aD2, aD3; Standard_Real t1, t3, aD1, aD2, aD3;
Standard_Real dt=1.e-9; Standard_Real dt=1.e-9;
@@ -728,7 +762,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
//function : FindSimpleRoot //function : FindSimpleRoot
//purpose : [private] //purpose : [private]
//======================================================================= //=======================================================================
Standard_Real IntTools_EdgeFace::FindSimpleRoot (const Standard_Integer IP, Standard_Real IntTools_EdgeFace::FindSimpleRoot
(const Standard_Integer IP,
const Standard_Real tA, const Standard_Real tA,
const Standard_Real tB, const Standard_Real tB,
const Standard_Real fA) const Standard_Real fA)
@@ -766,7 +801,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
//function : FindGoldRoot //function : FindGoldRoot
//purpose : [private] //purpose : [private]
//======================================================================= //=======================================================================
Standard_Real IntTools_EdgeFace::FindGoldRoot (const Standard_Real tA, Standard_Real IntTools_EdgeFace::FindGoldRoot
(const Standard_Real tA,
const Standard_Real tB, const Standard_Real tB,
const Standard_Real coeff) const Standard_Real coeff)
{ {
@@ -808,7 +844,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
//function : MakeType //function : MakeType
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer IntTools_EdgeFace::MakeType(IntTools_CommonPrt& aCommonPrt) Standard_Integer IntTools_EdgeFace::MakeType
(IntTools_CommonPrt& aCommonPrt)
{ {
Standard_Real af1, al1; Standard_Real af1, al1;
Standard_Real df1, tm; Standard_Real df1, tm;
@@ -854,52 +891,10 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
aCommonPrt.SetVertexParameter1(tm); aCommonPrt.SetVertexParameter1(tm);
aCommonPrt.SetRange1 (af1, al1); aCommonPrt.SetRange1 (af1, al1);
} }
}
return 0; return 0;
} }
/*
dt=al1-af1;
if (dt<1.e-5) {
gp_Pnt aPF, aPL;
myC.D0(af1, aPF);
myC.D0(al1, aPL);
df1=aPF.Distance(aPL);
if (df1<myCriteria) {
//
tm=.5*(af1+al1);
aCommonPrt.SetType(TopAbs_VERTEX);
aCommonPrt.SetVertexParameter1(tm);
aCommonPrt.SetRange1 (af1, al1);
return 0;
}
}
//
IsIntersection (af1, al1);
//
if (!myParallel) {
aCommonPrt.SetType(TopAbs_VERTEX);
aCommonPrt.SetVertexParameter1(myPar1);
aCommonPrt.SetRange1 (af1, al1);
}
else {
dt=al1-af1;
if (dt<1.e-5) {
df1=DistanceFunction(af1);
df2=DistanceFunction(al1);
tm=(df1 < df2) ? af1 : al1;
aCommonPrt.SetType(TopAbs_VERTEX);
aCommonPrt.SetVertexParameter1(tm);
aCommonPrt.SetRange1 (af1, al1);
}
else {
aCommonPrt.SetType(TopAbs_EDGE);
}
}
return 0;*/
}
//======================================================================= //=======================================================================
//function : IsIntersection //function : IsIntersection
@@ -972,7 +967,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
//function : FindDerivativeRoot //function : FindDerivativeRoot
//purpose : //purpose :
//======================================================================= //=======================================================================
void IntTools_EdgeFace::FindDerivativeRoot(const IntTools_CArray1OfReal& t, void IntTools_EdgeFace::FindDerivativeRoot
(const IntTools_CArray1OfReal& t,
const IntTools_CArray1OfReal& f) const IntTools_CArray1OfReal& f)
{ {
Standard_Integer i, n, k; Standard_Integer i, n, k;
@@ -1081,7 +1077,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
//function : CheckTouch //function : CheckTouch
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean IntTools_EdgeFace::CheckTouch(const IntTools_CommonPrt& aCP, Standard_Boolean IntTools_EdgeFace::CheckTouch
(const IntTools_CommonPrt& aCP,
Standard_Real& aTx) Standard_Real& aTx)
{ {
Standard_Real aTF, aTL, Tol, U1f, U1l, V1f, V1l, af, al,aDist2, aMinDist2; Standard_Real aTF, aTL, Tol, U1f, U1l, V1f, V1l, af, al,aDist2, aMinDist2;
@@ -1205,8 +1202,6 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
return theflag; return theflag;
} }
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : //purpose :
@@ -1365,7 +1360,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
//function : CheckTouch //function : CheckTouch
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean IntTools_EdgeFace::CheckTouchVertex (const IntTools_CommonPrt& aCP, Standard_Boolean IntTools_EdgeFace::CheckTouchVertex
(const IntTools_CommonPrt& aCP,
Standard_Real& aTx) Standard_Real& aTx)
{ {
Standard_Real aTF, aTL, Tol, U1f,U1l,V1f,V1l, af, al,aDist2, aMinDist2, aTm, aDist2New; Standard_Real aTF, aTL, Tol, U1f,U1l,V1f,V1l, af, al,aDist2, aMinDist2, aTm, aDist2New;