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:
@@ -18,24 +18,31 @@
|
||||
#include <BOPAlgo_PaveFiller.ixx>
|
||||
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
|
||||
//
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
//
|
||||
#include <Bnd_Box.hxx>
|
||||
|
||||
//
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
//
|
||||
#include <IntTools_EdgeFace.hxx>
|
||||
#include <IntTools_Range.hxx>
|
||||
#include <IntTools_SequenceOfCommonPrts.hxx>
|
||||
#include <IntTools_CommonPrt.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
|
||||
//
|
||||
#include <BOPCol_MapOfInteger.hxx>
|
||||
|
||||
#include <BOPCol_NCVector.hxx>
|
||||
#include <BOPCol_TBB.hxx>
|
||||
//
|
||||
#include <BOPInt_Context.hxx>
|
||||
|
||||
#include <BOPInt_Tools.hxx>
|
||||
//
|
||||
#include <BOPDS_Interf.hxx>
|
||||
#include <BOPDS_Iterator.hxx>
|
||||
#include <BOPDS_PaveBlock.hxx>
|
||||
@@ -43,17 +50,74 @@
|
||||
#include <BOPDS_DataMapOfPaveBlockListOfInteger.hxx>
|
||||
#include <BOPDS_CommonBlock.hxx>
|
||||
#include <BOPDS_Pave.hxx>
|
||||
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BOPDS_CoupleOfPaveBlocks.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
//
|
||||
#include <BOPTools_AlgoTools.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
|
||||
//purpose :
|
||||
@@ -64,23 +128,26 @@
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
FillShrunkData(TopAbs_EDGE, TopAbs_FACE);
|
||||
//
|
||||
myIterator->Initialize(TopAbs_EDGE, TopAbs_FACE);
|
||||
iSize=myIterator->ExpectedLength();
|
||||
if (!iSize) {
|
||||
return;
|
||||
}
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
Standard_Boolean bJustAdd, bV[2];
|
||||
Standard_Integer nE, nF, aDiscretize, i, aNbCPrts, iX, nV[2];
|
||||
Standard_Integer aNbEdgeFace, k;
|
||||
Standard_Real aTolE, aTolF, aTS1, aTS2, aT1, aT2, aDeflection;
|
||||
Handle(NCollection_IncAllocator) aAllocator;
|
||||
TopAbs_ShapeEnum aType;
|
||||
BOPDS_ListIteratorOfListOfPaveBlock aIt;
|
||||
BOPAlgo_VectorOfEdgeFace aVEdgeFace;
|
||||
BRep_Builder aBB;
|
||||
//-----------------------------------------------------scope f
|
||||
//
|
||||
BRep_Builder aBB;
|
||||
//
|
||||
aAllocator=new NCollection_IncAllocator();
|
||||
////aAllocator=new NCollection_IncAllocator();
|
||||
|
||||
BOPCol_MapOfInteger aMIEFC(100, aAllocator);
|
||||
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator);
|
||||
@@ -111,8 +178,6 @@
|
||||
//
|
||||
BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
|
||||
const BOPDS_IndexedMapOfPaveBlock& aMPBF=aFI.PaveBlocksOn();
|
||||
const BOPCol_MapOfInteger& aMIFOn=aFI.VerticesOn();
|
||||
const BOPCol_MapOfInteger& aMIFIn=aFI.VerticesIn();
|
||||
//
|
||||
aTolE=BRep_Tool::Tolerance(aE);
|
||||
aTolF=BRep_Tool::Tolerance(aF);
|
||||
@@ -128,11 +193,8 @@
|
||||
}
|
||||
//
|
||||
if (!aPB->HasShrunkData()) {
|
||||
FillShrunkData(aPB);
|
||||
if (myWarningStatus) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//
|
||||
Bnd_Box aBBE;
|
||||
aPB->ShrunkData(aTS1, aTS2, aBBE);
|
||||
@@ -141,8 +203,10 @@
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// -----------f
|
||||
IntTools_EdgeFace aEdgeFace;
|
||||
BOPAlgo_EdgeFace& aEdgeFace=aVEdgeFace.Append1();
|
||||
//
|
||||
aEdgeFace.SetIndices(nE, nF);
|
||||
aEdgeFace.SetPaveBlock(aPB);
|
||||
//
|
||||
aEdgeFace.SetEdge (aE);
|
||||
aEdgeFace.SetFace (aF);
|
||||
@@ -150,26 +214,50 @@
|
||||
aEdgeFace.SetTolF (aTolF);
|
||||
aEdgeFace.SetDiscretize (aDiscretize);
|
||||
aEdgeFace.SetDeflection (aDeflection);
|
||||
aEdgeFace.SetContext(myContext);
|
||||
//
|
||||
IntTools_Range aSR(aTS1, aTS2);
|
||||
IntTools_Range anewSR=aSR;
|
||||
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, anewSR);
|
||||
aEdgeFace.SetNewSR(anewSR);
|
||||
//
|
||||
aPB->Range(aT1, aT2);
|
||||
IntTools_Range aPBRange(aT1, aT2);
|
||||
aSR = aPBRange;
|
||||
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, 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()) {
|
||||
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]);
|
||||
//
|
||||
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();
|
||||
aNbCPrts=aCPrts.Length();
|
||||
for (i=1; i<=aNbCPrts; ++i) {
|
||||
@@ -181,7 +269,7 @@
|
||||
Standard_Integer j;
|
||||
Standard_Real aT, aTolToDecide;
|
||||
TopoDS_Vertex aVnew;
|
||||
|
||||
//
|
||||
BOPInt_Tools::VertexParameter(aCPart, aT);
|
||||
BOPTools_AlgoTools::MakeNewVertex(aE, aT, aF, aVnew);
|
||||
//
|
||||
@@ -213,7 +301,8 @@
|
||||
if (bIsOnPave[j]) {
|
||||
bV[j]=CheckFacePaves(nV[j], aMIFOn, aMIFIn);
|
||||
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);
|
||||
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nV[j]);
|
||||
Bnd_Box& aBoxDS=aSIDS.ChangeBox();
|
||||
@@ -231,7 +320,9 @@
|
||||
}
|
||||
//
|
||||
const gp_Pnt& aPnew = BRep_Tool::Pnt(aVnew);
|
||||
if (!myContext->IsValidPointForFace(aPnew, aF, aTolE+aTolF)) {
|
||||
if (!myContext->IsValidPointForFace(aPnew,
|
||||
aF,
|
||||
aTolE+aTolF)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
@@ -285,9 +376,7 @@
|
||||
break;
|
||||
}//switch (aType) {
|
||||
}//for (i=1; i<=aNbCPrts; ++i) {
|
||||
// -----------t
|
||||
}//for (; aIt.More(); aIt.Next()) {
|
||||
}//for (; myIterator->More(); myIterator->Next()) {
|
||||
}// for (k=0; k < aNbEdgeEdge; ++k) {
|
||||
//
|
||||
//=========================================
|
||||
// post treatment
|
||||
@@ -309,9 +398,7 @@
|
||||
aMIEFC.Clear();
|
||||
aMVCPB.Clear();
|
||||
aMPBLI.Clear();
|
||||
aAllocator.Nullify();
|
||||
//
|
||||
|
||||
////aAllocator.Nullify();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PerformVertices1
|
||||
@@ -452,7 +539,8 @@
|
||||
// function: CheckFacePaves
|
||||
// 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& aMIFIn)
|
||||
{
|
||||
@@ -485,7 +573,8 @@
|
||||
// function: CheckFacePaves
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves (const TopoDS_Vertex& aVnew,
|
||||
Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves
|
||||
(const TopoDS_Vertex& aVnew,
|
||||
const BOPCol_MapOfInteger& aMIF)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
@@ -510,7 +599,8 @@
|
||||
//function : ForceInterfVF
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPAlgo_PaveFiller::ForceInterfVF(const Standard_Integer nV,
|
||||
Standard_Boolean BOPAlgo_PaveFiller::ForceInterfVF
|
||||
(const Standard_Integer nV,
|
||||
const Standard_Integer nF)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
|
@@ -18,7 +18,6 @@ class EdgeFace from IntTools
|
||||
---Purpose: The class provides Edge/Face algorithm to determine
|
||||
--- common parts between edge and face in 3-d space.
|
||||
-- Common parts can be : Vertices or Edges.
|
||||
---
|
||||
|
||||
uses
|
||||
Pnt from gp,
|
||||
@@ -44,82 +43,100 @@ is
|
||||
--- Empty Constructor
|
||||
---
|
||||
|
||||
SetEdge (me:out; anEdge:Edge from TopoDS);
|
||||
SetEdge (me:out;
|
||||
anEdge:Edge from TopoDS);
|
||||
---Purpose:
|
||||
--- Initializes algorithm by the edge anEdge
|
||||
---
|
||||
|
||||
SetTolE (me:out; aTolEdge1:Real from Standard);
|
||||
SetTolE (me:out;
|
||||
aTolEdge1:Real from Standard);
|
||||
---Purpose:
|
||||
--- Initializes algorithm by edge tolerance
|
||||
---
|
||||
|
||||
SetFace (me:out; aFace:Face from TopoDS);
|
||||
SetFace(me:out;
|
||||
aFace:Face from TopoDS);
|
||||
---Purpose:
|
||||
--- Initializes algorithm by the face aFace
|
||||
---
|
||||
|
||||
SetTolF (me:out; aTolFace:Real from Standard);
|
||||
SetTolF (me:out;
|
||||
aTolFace:Real from Standard);
|
||||
---Purpose:
|
||||
--- 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:
|
||||
--- Initializes algorithm by discretization value
|
||||
---
|
||||
|
||||
SetDeflection (me:out; aDeflection:Real from Standard);
|
||||
SetDeflection (me:out;
|
||||
aDeflection:Real from Standard);
|
||||
---Purpose:
|
||||
--- Initializes algorithm by deflection value
|
||||
---
|
||||
|
||||
SetEpsilonT (me:out; anEpsT:Real from Standard);
|
||||
SetEpsilonT(me:out;
|
||||
anEpsT:Real from Standard);
|
||||
---Purpose:
|
||||
--- Initializes algorithm by parameter tolerance
|
||||
---
|
||||
|
||||
SetEpsilonNull (me:out; anEpsNull:Real from Standard);
|
||||
SetEpsilonNull (me:out;
|
||||
anEpsNull:Real from Standard);
|
||||
---Purpose:
|
||||
--- Initializes algorithm by distance tolerance
|
||||
---
|
||||
|
||||
SetRange (me:out; aRange:Range from IntTools);
|
||||
SetRange (me:out;
|
||||
aRange:Range from IntTools);
|
||||
---Purpose:
|
||||
--- Sets boundaries for edge.
|
||||
--- The algorithm processes edge inside these boundaries.
|
||||
---
|
||||
|
||||
SetRange (me:out; aFirst, aLast:Real from Standard);
|
||||
SetRange (me:out;
|
||||
aFirst, aLast:Real from Standard);
|
||||
---Purpose:
|
||||
--- Sets boundaries for edge.
|
||||
--- The algorithm processes edge inside these boundaries.
|
||||
---
|
||||
|
||||
SetContext (me: in out;
|
||||
theContext: Context from BOPInt);
|
||||
---Purpose:
|
||||
--- Sets the intersecton context
|
||||
---
|
||||
|
||||
Context (me)
|
||||
returns Context from BOPInt;
|
||||
---C++:return const &
|
||||
---Purpose:
|
||||
--- Gets the intersecton context
|
||||
---
|
||||
|
||||
Perform (me:out);
|
||||
---Purpose:
|
||||
--- Launches the process
|
||||
---
|
||||
|
||||
IsDone (me)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Returns true if computation was done
|
||||
--- successfully, otherwise returns false
|
||||
---
|
||||
|
||||
ErrorStatus(me)
|
||||
returns Integer from Standard;
|
||||
@@ -131,105 +148,106 @@ is
|
||||
--- 6 - discretization failed
|
||||
--- 7 - no projectable ranges found
|
||||
--- 11 - distance computing error
|
||||
---
|
||||
|
||||
CommonParts (me)
|
||||
returns SequenceOfCommonPrts from IntTools;
|
||||
---C++: return const&
|
||||
---Purpose:
|
||||
--- Returns results
|
||||
---
|
||||
|
||||
Range (me)
|
||||
returns Range from IntTools;
|
||||
---C++: return const&
|
||||
---Purpose:
|
||||
--- Returns boundaries for edge
|
||||
---
|
||||
|
||||
--
|
||||
IsEqDistance(myclass;
|
||||
aP: Pnt from gp;
|
||||
aS: Surface from BRepAdaptor;
|
||||
aT: Real from Standard;
|
||||
aD:out Real 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
|
||||
is private;
|
||||
is protected;
|
||||
|
||||
FindProjectableRoot (me:out;
|
||||
t1,t2:Real from Standard;
|
||||
f1,f2:Integer 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
|
||||
is private;
|
||||
is protected;
|
||||
|
||||
DerivativeFunction (me:out;t:Real from Standard)
|
||||
DerivativeFunction (me:out;
|
||||
t:Real from Standard)
|
||||
returns Real from Standard
|
||||
is private;
|
||||
is protected;
|
||||
|
||||
PrepareArgsFuncArrays (me:out;t1,t2:Real from Standard)
|
||||
is private;
|
||||
PrepareArgsFuncArrays (me:out;
|
||||
t1,t2:Real from Standard)
|
||||
is protected;
|
||||
|
||||
|
||||
AddDerivativePoints (me:out; t,f:CArray1OfReal from IntTools)
|
||||
is private;
|
||||
AddDerivativePoints(me:out;
|
||||
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)
|
||||
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
|
||||
is private;
|
||||
is protected;
|
||||
|
||||
MakeType (me:out;
|
||||
aCP: out CommonPrt from IntTools)
|
||||
returns Integer from Standard
|
||||
is private;
|
||||
is protected;
|
||||
|
||||
|
||||
IsIntersection (me:out; ta,tb:Real from Standard)
|
||||
is private;
|
||||
IsIntersection (me:out;
|
||||
ta,tb:Real from Standard)
|
||||
is protected;
|
||||
|
||||
FindDerivativeRoot (me:out;t,f:CArray1OfReal from IntTools)
|
||||
is private;
|
||||
FindDerivativeRoot(me:out;
|
||||
t,f:CArray1OfReal from IntTools)
|
||||
is protected;
|
||||
|
||||
--
|
||||
RemoveIdenticalRoots(me:out)
|
||||
is private;
|
||||
is protected;
|
||||
|
||||
CheckTouch (me: out;
|
||||
aCP: CommonPrt from IntTools;
|
||||
aTX:out Real from Standard)
|
||||
returns Boolean from Standard
|
||||
is private;
|
||||
is protected;
|
||||
|
||||
CheckTouchVertex (me:out;
|
||||
aCP: CommonPrt from IntTools;
|
||||
aTX:out Real from Standard)
|
||||
returns Boolean from Standard
|
||||
is private;
|
||||
--
|
||||
is protected;
|
||||
|
||||
fields
|
||||
-- Data
|
||||
|
@@ -58,7 +58,7 @@
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
|
||||
// modified by NIZHNY-MKK Thu Jul 21 11:35:59 2005
|
||||
|
||||
#include <IntCurveSurface_HInter.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
@@ -121,7 +121,6 @@ const Handle(BOPInt_Context)& IntTools_EdgeFace::Context()const
|
||||
{
|
||||
myEdge=anEdge;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetFace
|
||||
//purpose :
|
||||
@@ -130,7 +129,6 @@ const Handle(BOPInt_Context)& IntTools_EdgeFace::Context()const
|
||||
{
|
||||
myFace=aFace;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTolE
|
||||
//purpose :
|
||||
@@ -147,7 +145,38 @@ const Handle(BOPInt_Context)& IntTools_EdgeFace::Context()const
|
||||
{
|
||||
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
|
||||
//purpose :
|
||||
@@ -282,7 +311,8 @@ void IntTools_EdgeFace::CheckData()
|
||||
//
|
||||
//
|
||||
// 3.Prepare myPars
|
||||
pri = IntTools::PrepareArgs(myC, myTmax, myTmin, myDiscret, myDeflection, aPars);
|
||||
pri = IntTools::PrepareArgs(myC, myTmax, myTmin,
|
||||
myDiscret, myDeflection, aPars);
|
||||
if (pri) {
|
||||
myErrorStatus=6;
|
||||
return;
|
||||
@@ -370,7 +400,8 @@ void IntTools_EdgeFace::CheckData()
|
||||
//function : FindProjectableRoot
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void IntTools_EdgeFace::FindProjectableRoot (const Standard_Real tt1,
|
||||
void IntTools_EdgeFace::FindProjectableRoot
|
||||
(const Standard_Real tt1,
|
||||
const Standard_Real tt2,
|
||||
const Standard_Integer ff1,
|
||||
const Standard_Integer ff2,
|
||||
@@ -408,7 +439,8 @@ void IntTools_EdgeFace::CheckData()
|
||||
//function : IsProjectable
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean IntTools_EdgeFace::IsProjectable(const Standard_Real aT) const
|
||||
Standard_Boolean IntTools_EdgeFace::IsProjectable
|
||||
(const Standard_Real aT) const
|
||||
{
|
||||
Standard_Boolean bFlag;
|
||||
gp_Pnt aPC;
|
||||
@@ -422,7 +454,8 @@ Standard_Boolean IntTools_EdgeFace::IsProjectable(const Standard_Real aT) const
|
||||
//function : DistanceFunction
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
Standard_Real IntTools_EdgeFace::DistanceFunction
|
||||
(const Standard_Real t)
|
||||
{
|
||||
Standard_Real aD;
|
||||
|
||||
@@ -466,7 +499,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
//function : IsEqDistance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean IntTools_EdgeFace::IsEqDistance(const gp_Pnt& aP,
|
||||
Standard_Boolean IntTools_EdgeFace::IsEqDistance
|
||||
(const gp_Pnt& aP,
|
||||
const BRepAdaptor_Surface& aBAS,
|
||||
const Standard_Real aTol,
|
||||
Standard_Real& aD)
|
||||
@@ -568,13 +602,12 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
AddDerivativePoints(anArgs, aFunc);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : AddDerivativePoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void IntTools_EdgeFace::AddDerivativePoints(const IntTools_CArray1OfReal& t,
|
||||
void IntTools_EdgeFace::AddDerivativePoints
|
||||
(const IntTools_CArray1OfReal& t,
|
||||
const IntTools_CArray1OfReal& f)
|
||||
{
|
||||
Standard_Integer i, j, n, k, nn=100;
|
||||
@@ -711,7 +744,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
//function : DerivativeFunction
|
||||
//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 dt=1.e-9;
|
||||
@@ -728,7 +762,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
//function : FindSimpleRoot
|
||||
//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 tB,
|
||||
const Standard_Real fA)
|
||||
@@ -766,7 +801,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
//function : FindGoldRoot
|
||||
//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 coeff)
|
||||
{
|
||||
@@ -808,7 +844,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
//function : MakeType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer IntTools_EdgeFace::MakeType(IntTools_CommonPrt& aCommonPrt)
|
||||
Standard_Integer IntTools_EdgeFace::MakeType
|
||||
(IntTools_CommonPrt& aCommonPrt)
|
||||
{
|
||||
Standard_Real af1, al1;
|
||||
Standard_Real df1, tm;
|
||||
@@ -854,52 +891,10 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
aCommonPrt.SetVertexParameter1(tm);
|
||||
aCommonPrt.SetRange1 (af1, al1);
|
||||
}
|
||||
}
|
||||
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
|
||||
@@ -972,7 +967,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
//function : FindDerivativeRoot
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void IntTools_EdgeFace::FindDerivativeRoot(const IntTools_CArray1OfReal& t,
|
||||
void IntTools_EdgeFace::FindDerivativeRoot
|
||||
(const IntTools_CArray1OfReal& t,
|
||||
const IntTools_CArray1OfReal& f)
|
||||
{
|
||||
Standard_Integer i, n, k;
|
||||
@@ -1081,7 +1077,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
//function : CheckTouch
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean IntTools_EdgeFace::CheckTouch(const IntTools_CommonPrt& aCP,
|
||||
Standard_Boolean IntTools_EdgeFace::CheckTouch
|
||||
(const IntTools_CommonPrt& aCP,
|
||||
Standard_Real& aTx)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
@@ -1365,7 +1360,8 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
//function : CheckTouch
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean IntTools_EdgeFace::CheckTouchVertex (const IntTools_CommonPrt& aCP,
|
||||
Standard_Boolean IntTools_EdgeFace::CheckTouchVertex
|
||||
(const IntTools_CommonPrt& aCP,
|
||||
Standard_Real& aTx)
|
||||
{
|
||||
Standard_Real aTF, aTL, Tol, U1f,U1l,V1f,V1l, af, al,aDist2, aMinDist2, aTm, aDist2New;
|
||||
|
Reference in New Issue
Block a user