---Purpose:
uses
- Pnt from gp,
+ Pnt from gp,
+ ShapeEnum from TopAbs,
Vertex from TopoDS,
Face from TopoDS,
Edge from TopoDS,
FillShrunkData(me:out;
thePB:out PaveBlock from BOPDS)
is protected;
-
+
+ FillShrunkData(me:out;
+ theType1: ShapeEnum from TopAbs;
+ theType2: ShapeEnum from TopAbs)
+ is protected;
+
PerformVerticesEE(me:out;
theMVCPB:out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
theAllocator:out BaseAllocator from BOPCol)
#include <TopoDS_Edge.hxx>
#include <BRep_Tool.hxx>
+#include <BOPCol_NCVector.hxx>
+#include <BOPCol_TBB.hxx>
+
#include <BOPInt_Context.hxx>
#include <BOPDS_Iterator.hxx>
#include <BRepBndLib.hxx>
#include <BRep_Builder.hxx>
-
+//=======================================================================
+//class : BOPAlgo_VertexEdgeEdge
+//purpose :
+//=======================================================================
+class BOPAlgo_VertexEdge {
+ public:
+ BOPAlgo_VertexEdge()
+ : myIV(-1), myIE(-1), myIVx(-1), myFlag(-1), myT(-1.) {
+ };
+ //
+ ~BOPAlgo_VertexEdge(){
+ };
+ //
+ void SetIndices(const Standard_Integer nV,
+ const Standard_Integer nE,
+ const Standard_Integer nVx) {
+ myIV=nV;
+ myIE=nE;
+ myIVx=nVx;
+ }
+ //
+ void Indices(Standard_Integer& nV,
+ Standard_Integer& nE,
+ Standard_Integer& nVx) const {
+ nV=myIV;
+ nE=myIE;
+ nVx=myIVx;
+ }
+ //
+ void SetVertex(const TopoDS_Vertex& aV) {
+ myV=aV;
+ }
+ //
+ const TopoDS_Vertex& Vertex()const {
+ return myV;
+ }
+ //
+ void SetEdge(const TopoDS_Edge& aE) {
+ myE=aE;
+ }
+ //
+ const TopoDS_Edge& Edge()const {
+ return myE;
+ }
+ //
+ Standard_Integer Flag()const {
+ return myFlag;
+ }
+ //
+ Standard_Real Parameter()const {
+ return myT;
+ }
+ //
+ void SetContext(const Handle(BOPInt_Context)& aContext) {
+ myContext=aContext;
+ }
+ //
+ const Handle(BOPInt_Context)& Context()const {
+ return myContext;
+ }
+ //
+ void Perform() {
+ myFlag=myContext->ComputeVE (myV, myE, myT);
+ };
+ //
+ protected:
+ Standard_Integer myIV;
+ Standard_Integer myIE;
+ Standard_Integer myIVx;
+ Standard_Integer myFlag;
+ Standard_Real myT;
+ TopoDS_Vertex myV;
+ TopoDS_Edge myE;
+ Handle(BOPInt_Context) myContext;
+};
+//=======================================================================
+typedef BOPCol_NCVector
+ <BOPAlgo_VertexEdge> BOPAlgo_VectorOfVertexEdge;
+//
+typedef BOPCol_TBBContextFunctor
+ <BOPAlgo_VertexEdge,
+ BOPAlgo_VectorOfVertexEdge,
+ Handle_BOPInt_Context,
+ BOPInt_Context> BOPAlgo_VertexEdgeFunctor;
+//
+typedef BOPCol_TBBContextCnt
+ <BOPAlgo_VertexEdgeFunctor,
+ BOPAlgo_VectorOfVertexEdge,
+ Handle_BOPInt_Context> BOPAlgo_VertexEdgeCnt;
+//
//=======================================================================
// function: PerformVE
// purpose:
//=======================================================================
- void BOPAlgo_PaveFiller::PerformVE()
+void BOPAlgo_PaveFiller::PerformVE()
{
Standard_Boolean bJustAdd;
- Standard_Integer iSize, nV, nE, nVSD, iFlag, nVx, i;
+ Standard_Integer iSize, nV, nE, nVSD, iFlag, nVx, i, k, aNbVE;;
Standard_Real aT, aTolE, aTolV;
BOPDS_Pave aPave;
BOPDS_PassKey aPK;
BOPDS_MapOfPassKey aMPK;
BRep_Builder aBB;
+ BOPAlgo_VectorOfVertexEdge aVVE;
//
myErrorStatus=0;
//
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape()));
const TopoDS_Vertex& aV=(*(TopoDS_Vertex *)(&myDS->Shape(nVx)));
//
- iFlag=myContext->ComputeVE (aV, aE, aT);
+ BOPAlgo_VertexEdge& aVESolver=aVVE.Append1();
+ //
+ aVESolver.SetIndices(nV, nE, nVx);
+ aVESolver.SetVertex(aV);
+ aVESolver.SetEdge(aE);
+ //
+ }// myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE);
+ //
+ aNbVE=aVVE.Extent();
+ //=============================================================
+ BOPAlgo_VertexEdgeCnt::Perform(myRunParallel, aVVE, myContext);
+ //=============================================================
+ //
+ for (k=0; k < aNbVE; ++k) {
+ const BOPAlgo_VertexEdge& aVESolver=aVVE(k);
+ iFlag=aVESolver.Flag();
if (!iFlag) {
+ aVESolver.Indices(nV, nE, nVx);
+ aT=aVESolver.Parameter();
+ const TopoDS_Vertex& aV=aVESolver.Vertex();
+ const TopoDS_Edge& aE=aVESolver.Edge();
// 1
i=aVEs.Append()-1;
BOPDS_InterfVE& aVE=aVEs(i);
BRepBndLib::Add(aV, aBoxDS);
}
}
- }//for (; myIterator->More(); myIterator->Next()) {
+ }//for (k=0; k < aNbVE; ++k) {
}
Handle(BOPDS_PaveBlock) myPB2;
};
//
-typedef BOPCol_NCVector<BOPAlgo_EdgeEdge> BOPAlgo_VectorOfEdgeEdge;
+//=======================================================================
+typedef BOPCol_NCVector
+ <BOPAlgo_EdgeEdge> BOPAlgo_VectorOfEdgeEdge;
//
+typedef BOPCol_TBBFunctor
+ <BOPAlgo_EdgeEdge,
+ BOPAlgo_VectorOfEdgeEdge> BOPAlgo_EdgeEdgeFunctor;
+//
+typedef BOPCol_TBBCnt
+ <BOPAlgo_EdgeEdgeFunctor,
+ BOPAlgo_VectorOfEdgeEdge> BOPAlgo_EdgeEdgeCnt;
//
-//=======================================================================
-//class : BOPAlgo_EdgeEdgeFunctor
-//purpose :
-//=======================================================================
-class BOPAlgo_EdgeEdgeFunctor {
- protected:
- BOPAlgo_VectorOfEdgeEdge* myPVEE;
- //
- public:
- //
- BOPAlgo_EdgeEdgeFunctor(BOPAlgo_VectorOfEdgeEdge& aVEE)
- : myPVEE(&aVEE) {
- }
- //
- void operator()( const flexible_range<Standard_Integer>& aBR ) const{
- Standard_Integer i, iBeg, iEnd;
- //
- BOPAlgo_VectorOfEdgeEdge& aVEE=*myPVEE;
- //
- iBeg=aBR.begin();
- iEnd=aBR.end();
- for(i=iBeg; i!=iEnd; ++i) {
- BOPAlgo_EdgeEdge& aEE=aVEE(i);
- //
- aEE.Perform();
- }
- }
-};
-//=======================================================================
-//class : BOPAlgo_EdgeEdgeCnt
-//purpose :
-//=======================================================================
-class BOPAlgo_EdgeEdgeCnt {
- public:
- //-------------------------------
- // Perform
- Standard_EXPORT
- static void Perform(const Standard_Boolean bRunParallel,
- BOPAlgo_VectorOfEdgeEdge& aVEdgeEdge) {
- //
- BOPAlgo_EdgeEdgeFunctor aEEF(aVEdgeEdge);
- Standard_Integer aNbEE=aVEdgeEdge.Extent();
- //
- if (bRunParallel) {
- flexible_for(flexible_range<Standard_Integer>(0,aNbEE), aEEF);
- }
- else {
- aEEF.operator()(flexible_range<Standard_Integer>(0,aNbEE));
- }
- }
-};
//=======================================================================
// function: PerformEE
// purpose:
//
myErrorStatus=0;
//
+ FillShrunkData(TopAbs_EDGE, TopAbs_EDGE);
+ //
myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE);
iSize=myIterator->ExpectedLength();
if (!iSize) {
//
Handle(BOPDS_PaveBlock)& aPB1=aIt1.ChangeValue();
if (!aPB1->HasShrunkData()) {
- FillShrunkData(aPB1);
- if (myWarningStatus) {
- continue;
- }
+ continue;
}
aPB1->ShrunkData(aTS11, aTS12, aBB1);
//
//
Handle(BOPDS_PaveBlock)& aPB2=aIt2.ChangeValue();
if (!aPB2->HasShrunkData()) {
- FillShrunkData(aPB2);
- if (myWarningStatus) {
- continue;
- }
+ continue;
}
aPB2->ShrunkData(aTS21, aTS22, aBB2);
//
nE=thePB->OriginalEdge();
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
//
- aSR.SetData(aE, aT1, aT2, aV1, aV2, myContext);
+ aSR.SetContext(myContext);
+ aSR.SetData(aE, aT1, aT2, aV1, aV2);
//
aSR.Perform();
iErr=aSR.ErrorStatus();
#include <Geom_Surface.hxx>
#include <Geom2d_Curve.hxx>
+#include <BOPCol_NCVector.hxx>
+#include <BOPCol_TBB.hxx>
+
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools2D.hxx>
#include <BOPDS_MapOfPaveBlock.hxx>
#include <BOPDS_Curve.hxx>
+
static void UpdateVertices(const TopoDS_Edge& aE,
const TopoDS_Face& aF);
+//=======================================================================
+//class : BOPAlgo_SplitEdge
+//purpose :
+//=======================================================================
+class BOPAlgo_SplitEdge {
+ public:
+ BOPAlgo_SplitEdge() {
+ myT1=0.;
+ myT2=0.;
+ }
+ //
+ ~BOPAlgo_SplitEdge() {
+ }
+ //
+ void SetData(const TopoDS_Edge& aE,
+ const TopoDS_Vertex& aV1,
+ const Standard_Real aT1,
+ const TopoDS_Vertex& aV2,
+ const Standard_Real aT2) {
+ myE=aE;
+ myV1=aV1;
+ myT1=aT1;
+ myV2=aV2;
+ myT2=aT2;
+ myESp=aE;
+ }
+ //
+ void SetPaveBlock(const Handle(BOPDS_PaveBlock)& aPB) {
+ myPB=aPB;
+ }
+ //
+ Handle(BOPDS_PaveBlock)& PaveBlock() {
+ return myPB;
+ }
+ //
+ void SetCommonBlock(const Handle(BOPDS_CommonBlock)& aCB) {
+ myCB=aCB;
+ }
+ //
+ Handle(BOPDS_CommonBlock)& CommonBlock() {
+ return myCB;
+ }
+ //
+ const TopoDS_Edge& SplitEdge() const {
+ return myESp;
+ }
+ //
+ const Bnd_Box Box() {
+ return myBox;
+ }
+ //
+ void Perform () {
+ BOPTools_AlgoTools::MakeSplitEdge(myE,
+ myV1, myT1,
+ myV2, myT2,
+ myESp);
+ BRepBndLib::Add(myESp, myBox);
+ }
+ //
+ protected:
+ // ->
+ TopoDS_Edge myE;
+ TopoDS_Vertex myV1;
+ Standard_Real myT1;
+ TopoDS_Vertex myV2;
+ Standard_Real myT2;
+ // <->
+ Handle(BOPDS_PaveBlock) myPB;
+ Handle(BOPDS_CommonBlock) myCB;
+ // <-
+ TopoDS_Edge myESp;
+ Bnd_Box myBox;
+};
+//
+//=======================================================================
+typedef BOPCol_NCVector
+ <BOPAlgo_SplitEdge> BOPAlgo_VectorOfSplitEdge;
+//
+typedef BOPCol_TBBFunctor
+ <BOPAlgo_SplitEdge,
+ BOPAlgo_VectorOfSplitEdge> BOPAlgo_SplitEdgeFunctor;
+//
+typedef BOPCol_TBBCnt
+ <BOPAlgo_SplitEdgeFunctor,
+ BOPAlgo_VectorOfSplitEdge> BOPAlgo_SplitEdgeCnt;
+//
//=======================================================================
// function: MakeSplitEdges
// purpose:
//=======================================================================
- void BOPAlgo_PaveFiller::MakeSplitEdges()
+void BOPAlgo_PaveFiller::MakeSplitEdges()
{
Standard_Integer aNbPBP;
//
}
//
Standard_Boolean bCB, bV1, bV2;
- Standard_Integer i, nE, nV1, nV2, nSp, aNbPB;
+ Standard_Integer i, nE, nV1, nV2, nSp, aNbPB, aNbVBSE, k;
Standard_Real aT1, aT2;
- Handle(NCollection_IncAllocator) aAllocator;
BOPDS_ListIteratorOfListOfPaveBlock aItPB, aItPBCB;
- Handle(BOPDS_PaveBlock) aPB, aPBx;
- //-----------------------------------------------------scope f
- //
- aAllocator=new NCollection_IncAllocator();
- //
- BOPDS_MapOfPaveBlock aMPB(100,aAllocator);
+ Handle(BOPDS_PaveBlock) aPB;
+ BOPDS_MapOfPaveBlock aMPB(100);
+ TopoDS_Vertex aV1, aV2;
+ TopoDS_Edge aE;
+ BOPAlgo_VectorOfSplitEdge aVBSE;
+
//
for (i=0; i<aNbPBP; ++i) {
BOPDS_ListOfPaveBlock& aLPB=aPBP(i);
//
aNbPB=aLPB.Extent();
- //DEBf
- if (aNbPB) {
- aPBx=aLPB.First();
- }
- //DEBt
if (aNbPB==1) {
aPB=aLPB.First();
aPB->Indices(nV1, nV2);
aPB->Indices(nV1, nV2);
aPB->Range(aT1, aT2);
//
- nSp = SplitEdge(nE, nV1, aT1, nV2, aT2);
+ aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
+ aE.Orientation(TopAbs_FORWARD);
+ //
+ aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
+ aV1.Orientation(TopAbs_FORWARD);
//
+ aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2)));
+ aV2.Orientation(TopAbs_REVERSED);
+ //
+ BOPAlgo_SplitEdge& aBSE=aVBSE.Append1();
+ //
+ aBSE.SetData(aE, aV1, aT1, aV2, aT2);
+ aBSE.SetPaveBlock(aPB);
if (bCB) {
- aCB->SetEdge(nSp);
+ aBSE.SetCommonBlock(aCB);
}
- else {
- aPB->SetEdge(nSp);
- }
- }// if (aMPB.Add(aPB)) {
- }// for (; aItPB.More(); aItPB.Next()) {
- }// for (i=0; i<aNbPBP; ++i) {
+ }
+ } // for (; aItPB.More(); aItPB.Next()) {
+ } // for (i=0; i<aNbPBP; ++i) {
+ //
+ aNbVBSE=aVBSE.Extent();
+ //======================================================
+ BOPAlgo_SplitEdgeCnt::Perform(myRunParallel, aVBSE);
+ //======================================================
+ //
+ BOPDS_ShapeInfo aSI;
//
- //-----------------------------------------------------scope t
- aMPB.Clear();
- aAllocator.Nullify();
+ aSI.SetShapeType(TopAbs_EDGE);
+ //
+ for (k=0; k < aNbVBSE; ++k) {
+ BOPAlgo_SplitEdge& aBSE=aVBSE(k);
+ //
+ const TopoDS_Edge& aSp=aBSE.SplitEdge();
+ const Bnd_Box& aBox=aBSE.Box();
+ //
+ Handle(BOPDS_PaveBlock) aPBk=aBSE.PaveBlock();
+ Handle(BOPDS_CommonBlock)& aCBk=aBSE.CommonBlock();
+ //
+ aSI.SetShape(aSp);
+ aSI.ChangeBox()=aBox;
+ //
+ nSp=myDS->Append(aSI);
+ //
+ if (!aCBk.IsNull()) {
+ aCBk->SetEdge(nSp);
+ }
+ else {
+ aPBk->SetEdge(nSp);
+ }
+ }
}
-
//=======================================================================
// function: SplitEdge
// purpose:
nSp=myDS->Append(aSI);
return nSp;
}
-
//=======================================================================
// function: MakePCurves
// purpose:
//=======================================================================
- void BOPAlgo_PaveFiller::MakePCurves()
+void BOPAlgo_PaveFiller::MakePCurves()
{
Standard_Integer i, nF1, nF2, aNbC, k, nE, aNbFF, aNbFI;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
}
}
}
-
//=======================================================================
// function: RefineFaceInfoOn
// purpose:
//=======================================================================
- void BOPAlgo_PaveFiller::RefineFaceInfoOn()
+void BOPAlgo_PaveFiller::RefineFaceInfoOn()
{
Standard_Integer aNbPBP;
//
}//for (i=0; i<aNbPBP; ++i) {
myDS->RefineFaceInfoOn();
}
-
//=======================================================================
//function : UpdateVertices
//purpose : update tolerances of vertices comparing extremities of
// 3d and 2d curves
//=======================================================================
-void UpdateVertices(const TopoDS_Edge& aE, const TopoDS_Face& aF)
+void UpdateVertices(const TopoDS_Edge& aE,
+ const TopoDS_Face& aF)
{
Standard_Integer j;
Standard_Real aT[2], aUx, aVx, aTolV2, aD2, aD;
--- /dev/null
+// Created by: Peter KURNEV
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <BOPAlgo_PaveFiller.ixx>
+//
+#include <Bnd_Box.hxx>
+
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Vertex.hxx>
+
+#include <BOPCol_NCVector.hxx>
+#include <BOPCol_MapOfInteger.hxx>
+#include <BOPCol_TBB.hxx>
+
+#include <BOPDS_ShapeInfo.hxx>
+#include <BOPDS_PaveBlock.hxx>
+#include <BOPDS_Iterator.hxx>
+#include <BOPDS_ListOfPaveBlock.hxx>
+
+#include <BOPInt_ShrunkRange.hxx>
+
+//=======================================================================
+//class : BOPAlgo_ShrunkRange
+//purpose :
+//=======================================================================
+class BOPAlgo_ShrunkRange : public BOPInt_ShrunkRange {
+ public:
+ BOPAlgo_ShrunkRange()
+ : BOPInt_ShrunkRange(),
+ myWarningStatus(0) {
+ }
+ //
+ virtual ~BOPAlgo_ShrunkRange() {
+ }
+ //
+ void SetPaveBlock(const Handle(BOPDS_PaveBlock)& aPB) {
+ myPB=aPB;
+ }
+ //
+ Handle(BOPDS_PaveBlock)& PaveBlock() {
+ return myPB;
+ }
+ //
+ virtual void Perform() {
+ //
+ myWarningStatus=0;
+ //
+ BOPInt_ShrunkRange::Perform();
+ if (myErrorStatus) {
+ myWarningStatus=1;
+ }
+ }
+ //
+ Standard_Integer WarningStatus() const {
+ return myWarningStatus;
+ }
+ //
+ protected:
+ Standard_Integer myWarningStatus;
+ Handle(BOPDS_PaveBlock) myPB;
+};
+//
+//=======================================================================
+typedef BOPCol_NCVector
+ <BOPAlgo_ShrunkRange> BOPAlgo_VectorOfShrunkRange;
+//
+typedef BOPCol_TBBContextFunctor
+ <BOPAlgo_ShrunkRange,
+ BOPAlgo_VectorOfShrunkRange,
+ Handle_BOPInt_Context,
+ BOPInt_Context> BOPAlgo_ShrunkRangeFunctor;
+//
+typedef BOPCol_TBBContextCnt
+ <BOPAlgo_ShrunkRangeFunctor,
+ BOPAlgo_VectorOfShrunkRange,
+ Handle_BOPInt_Context> BOPAlgo_ShrunkRangeCnt;
+//
+//=======================================================================
+// function: FillShrunkData
+// purpose:
+//=======================================================================
+void BOPAlgo_PaveFiller::FillShrunkData(const TopAbs_ShapeEnum aType1,
+ const TopAbs_ShapeEnum aType2)
+{
+ Standard_Integer iSize;
+
+ //
+ myErrorStatus=0;
+ //
+ myIterator->Initialize(aType1, aType2);
+ iSize=myIterator->ExpectedLength();
+ if (!iSize) {
+ return;
+ }
+ //
+ Standard_Boolean bJustAdd;
+ Standard_Integer i, iEnd, nS[2], nE, nV1, nV2, aNbVSD, k, iWrn;
+ Standard_Real aT1, aT2, aTS1, aTS2;
+ BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
+ BOPCol_MapOfInteger aMI;
+ BOPAlgo_VectorOfShrunkRange aVSD;
+ //
+ iEnd=(aType2==TopAbs_EDGE) ? 2 : 1;
+ //
+ for (; myIterator->More(); myIterator->Next()) {
+ myIterator->Value(nS[0], nS[1], bJustAdd);
+ if(bJustAdd) {
+ continue;
+ }
+ //
+ for (i=0; i<iEnd; ++i) {
+ nE=nS[i];
+ if (!aMI.Add(nE)) {
+ continue;
+ }
+ //
+ const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
+ if (aSIE.HasFlag()){
+ continue;
+ }
+ //
+ BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
+ aItLPB.Initialize(aLPB);
+ for (; aItLPB.More(); aItLPB.Next()) {
+ const Handle(BOPDS_PaveBlock)& aPB=aItLPB.ChangeValue();
+ if (aPB->HasShrunkData()) {
+ continue;
+ }
+ //
+ // FillShrunkData(aPB);
+ aPB->Indices(nV1, nV2);
+ aPB->Range(aT1, aT2);
+ //
+ const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape()));
+ //
+ const TopoDS_Vertex& aV1=
+ (*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
+ //
+ const TopoDS_Vertex& aV2=
+ (*(TopoDS_Vertex *)(&myDS->Shape(nV2)));
+ //
+ BOPAlgo_ShrunkRange& aSD=aVSD.Append1();
+ //
+ aSD.SetPaveBlock(aPB);
+ aSD.SetData(aE, aT1, aT2, aV1, aV2);
+ }
+ }
+ }
+ //
+ aNbVSD=aVSD.Extent();
+ //=============================================================
+ BOPAlgo_ShrunkRangeCnt::Perform(myRunParallel, aVSD, myContext);
+ //=============================================================
+ //
+ for (k=0; k < aNbVSD; ++k) {
+ BOPAlgo_ShrunkRange& aSD=aVSD(k);
+ iWrn=aSD.WarningStatus();
+ if (iWrn==1) {
+ continue;
+ }
+ //
+ Handle(BOPDS_PaveBlock)& aPB=aSD.PaveBlock();
+ aSD.ShrunkRange(aTS1, aTS2);
+ const Bnd_Box& aBox=aSD.BndBox();
+ //
+ aPB->SetShrunkData(aTS1, aTS2, aBox);
+ }
+}
BOPAlgo_Builder_2Cnt.hxx
BOPAlgo_CheckerSI_1.cxx
+BOPAlgo_PaveFiller_9.cxx
template <class Type> class serial_range {
public:
serial_range(const Type& aBegin,
- const Type& aEnd)
+ const Type& aEnd)
: myBegin(aBegin), myEnd(aEnd) {
}
//
body.operator()(range);
};
#endif // not HAVE_TBB
+//
+// 2. Implementation of Functors/Starters
+//
+// 2.1. Pure version
+//
+//=======================================================================
+//class : BOPCol_TBBFunctor
+//purpose :
+//=======================================================================
+template <class TypeSolver,
+ class TypeSolverVector> class BOPCol_TBBFunctor {
+
+ public:
+ BOPCol_TBBFunctor(TypeSolverVector& aV)
+ : myPV(&aV) {
+ }
+ //
+ ~BOPCol_TBBFunctor() {
+ }
+ //
+ void operator()( const flexible_range<Standard_Size>& aBR ) const{
+ Standard_Size i, iBeg, iEnd;
+ //
+ TypeSolverVector& aV=*myPV;
+ //
+ iBeg=aBR.begin();
+ iEnd=aBR.end();
+ for(i=iBeg; i!=iEnd; ++i) {
+ TypeSolver& aSolver=aV(i);
+ //
+ aSolver.Perform();
+ }
+ }
+ //
+ protected:
+ TypeSolverVector* myPV;
+};
+//=======================================================================
+//class : BOPCol_TBBCnt
+//purpose :
+//=======================================================================
+template <class TypeFunctor,
+ class TypeSolverVector> class BOPCol_TBBCnt {
+ public:
+ //-------------------------------
+ // Perform
+ Standard_EXPORT
+ static void Perform(const Standard_Boolean bRunParallel,
+ TypeSolverVector& aV) {
+ //
+ TypeFunctor aFunctor(aV);
+ Standard_Size aNb=aV.Extent();
+ //
+ if (bRunParallel) {
+ flexible_for(flexible_range<Standard_Size>(0,aNb), aFunctor);
+ }
+ else {
+ aFunctor.operator()(flexible_range<Standard_Size>(0,aNb));
+ }
+ }
+};
+//
+// 2.2. Context dependent version
+//
+#include <Standard_Macro.hxx>
+
+//=======================================================================
+//class : BOPCol_TBBContextFunctor
+//purpose :
+//=======================================================================
+template <class TypeSolver,
+ class TypeSolverVector,
+ class TypeContext,
+ typename TN> class BOPCol_TBBContextFunctor {
+
+ public:
+ BOPCol_TBBContextFunctor(TypeSolverVector& aV)
+ : myPV(&aV) {
+ }
+ //
+ ~BOPCol_TBBContextFunctor() {
+ }
+ //
+ void SetContext(TypeContext& aCtx) {
+ myContext=aCtx;
+ }
+ //
+ void operator()( const flexible_range<Standard_Size>& aBR ) const{
+ Standard_Size i, iBeg, iEnd;
+ TypeContext aCtx;
+ //
+ if (myContext.IsNull()) {
+ aCtx=new TN
+ (NCollection_BaseAllocator::CommonBaseAllocator());
+ }
+ else {
+ aCtx=myContext;
+ }
+ //
+ TypeSolverVector& aV=*myPV;
+ //
+ iBeg=aBR.begin();
+ iEnd=aBR.end();
+ for(i=iBeg; i!=iEnd; ++i) {
+ TypeSolver& aSolver=aV(i);
+ //
+ aSolver.SetContext(aCtx);
+ aSolver.Perform();
+ }
+ }
+ //
+ protected:
+ TypeSolverVector* myPV;
+ TypeContext myContext;
+ //
+};
+
+//=======================================================================
+//class : BOPCol_TBBContextCnt
+//purpose :
+//=======================================================================
+template <class TypeFunctor,
+ class TypeSolverVector,
+ class TypeContext> class BOPCol_TBBContextCnt {
+ public:
+ //-------------------------------
+ // Perform
+ Standard_EXPORT
+ static void Perform(const Standard_Boolean bRunParallel,
+ TypeSolverVector& aV,
+ TypeContext& aCtx) {
+ //
+ TypeFunctor aFunctor(aV);
+ Standard_Size aNb=aV.Extent();
+ //
+ if (bRunParallel) {
+ flexible_for(flexible_range<Standard_Size>(0,aNb), aFunctor);
+ }
+ else {
+ aFunctor.SetContext(aCtx);
+ aFunctor.operator()(flexible_range<Standard_Size>(0,aNb));
+ }
+ }
+};
#endif
class ShrunkRange from BOPInt
- ---Purpose:
- --- The class provides the computation of
- --- a working (shrunk) range [t1, t2] for
- --- the 3D-curve of the edge.
-
+ ---Purpose:
+ --- The class provides the computation of
+ --- a working (shrunk) range [t1, t2] for
+ --- the 3D-curve of the edge.
+
uses
Box from Bnd,
Edge from TopoDS,
is
Create
- returns ShrunkRange from BOPInt;
-
+ returns ShrunkRange from BOPInt;
+ ---C++: alias "Standard_EXPORT virtual ~BOPInt_ShrunkRange();"
+
SetData (me:out;
- aE : Edge from TopoDS;
- aT1 : Real from Standard;
- aT2 : Real from Standard;
- aV1 : Vertex from TopoDS;
- aV2 : Vertex from TopoDS;
- ICtx: Context from BOPInt);
-
+ aE : Edge from TopoDS;
+ aT1 : Real from Standard;
+ aT2 : Real from Standard;
+ aV1 : Vertex from TopoDS;
+ aV2 : Vertex from TopoDS);
+
+ SetContext(me:out;
+ aCtx: Context from BOPInt);
+
+ Context(me)
+ returns Context from BOPInt;
+ ---C++: return const &
+
SetShrunkRange(me:out;
- aT1 : Real from Standard;
- aT2 : Real from Standard);
+ aT1 : Real from Standard;
+ aT2 : Real from Standard);
ShrunkRange(me;
- aT1 :out Real from Standard;
- aT2 :out Real from Standard);
+ aT1 :out Real from Standard;
+ aT2 :out Real from Standard);
BndBox (me)
- returns Box from Bnd;
+ returns Box from Bnd;
---C++: return const &
Edge (me)
- returns Edge from TopoDS;
- ---C++: return const &
-
+ returns Edge from TopoDS;
+ ---C++: return const &
+
Perform(me:out);
-
+
ErrorStatus(me)
- returns Integer from Standard;
- ---Purpose:
- --- Returns code of computing shrunk range
- --- completion
- --- 0 - means successful completion
- --- 1 - nothing has been done
- --- 2 - initial range is out of edge's range
- --- 3 - first boundary of initial range is more than
- --- last boundary
- --- 4 - projection of first vertex failed
- --- 5 - projection of second vertex failed
- --- 6 - shrunk range can not be computed
- --- shrunk range is setted to initial range
- ---
+ returns Integer from Standard;
+ ---Purpose:
+ --- Returns code of computing shrunk range
+ --- completion
+ --- 0 - means successful completion
+ --- 1 - nothing has been done
+ --- 2 - initial range is out of edge's range
+ --- 3 - first boundary of initial range is more than
+ --- last boundary
+ --- 4 - projection of first vertex failed
+ --- 5 - projection of second vertex failed
+ --- 6 - shrunk range can not be computed
+ --- shrunk range is setted to initial range
+ ---
fields
myEdge : Edge from TopoDS is protected;
myErrorStatus=1;
}
//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+BOPInt_ShrunkRange::~BOPInt_ShrunkRange ()
+{
+}
+//=======================================================================
//function : SetData
//purpose :
//=======================================================================
- void BOPInt_ShrunkRange::SetData(const TopoDS_Edge& aE,
- const Standard_Real aT1,
- const Standard_Real aT2,
- const TopoDS_Vertex& aV1,
- const TopoDS_Vertex& aV2,
- const Handle(BOPInt_Context)& aCtx)
+void BOPInt_ShrunkRange::SetData(const TopoDS_Edge& aE,
+ const Standard_Real aT1,
+ const Standard_Real aT2,
+ const TopoDS_Vertex& aV1,
+ const TopoDS_Vertex& aV2)
{
myEdge=aE;
myV1=aV1;
myV2=aV2;
myT1=aT1;
myT2=aT2;
- //myRange=aR;
- myCtx=aCtx;
myErrorStatus=1;
}
//=======================================================================
+//function : SetContext
+//purpose :
+//=======================================================================
+void BOPInt_ShrunkRange::SetContext(const Handle(BOPInt_Context)& aCtx)
+{
+ myCtx=aCtx;
+}
+//=======================================================================
+//function : Context
+//purpose :
+//=======================================================================
+const Handle(BOPInt_Context)& BOPInt_ShrunkRange::Context()const
+{
+ return myCtx;
+}
+//=======================================================================
//function : Edge
//purpose :
//=======================================================================
- const TopoDS_Edge& BOPInt_ShrunkRange::Edge() const
+const TopoDS_Edge& BOPInt_ShrunkRange::Edge() const
{
return myEdge;
}
//function : ShrunkRange
//purpose :
//=======================================================================
- void BOPInt_ShrunkRange::ShrunkRange(Standard_Real& aT1,
- Standard_Real& aT2) const
+void BOPInt_ShrunkRange::ShrunkRange(Standard_Real& aT1,
+ Standard_Real& aT2) const
{
aT1=myTS1;
aT2=myTS2;
//function : BndBox
//purpose :
//=======================================================================
- const Bnd_Box& BOPInt_ShrunkRange::BndBox() const
+const Bnd_Box& BOPInt_ShrunkRange::BndBox() const
{
return myBndBox;
}
//function : ErrorStatus
//purpose :
//=======================================================================
- Standard_Integer BOPInt_ShrunkRange::ErrorStatus() const
+Standard_Integer BOPInt_ShrunkRange::ErrorStatus() const
{
return myErrorStatus;
}
//function : SetShrunkRange
//purpose :
//=======================================================================
- void BOPInt_ShrunkRange::SetShrunkRange(const Standard_Real aT1,
- const Standard_Real aT2)
+void BOPInt_ShrunkRange::SetShrunkRange(const Standard_Real aT1,
+ const Standard_Real aT2)
{
myTS1=aT1;
myTS2=aT2;
//function : Perform
//purpose :
//=======================================================================
- void BOPInt_ShrunkRange::Perform()
+void BOPInt_ShrunkRange::Perform()
{
- Standard_Real aCF, aCL, aTolE, aTolV1, aTolV2, t1, t11, t1C, t2, t12, t2C;
+ Standard_Real aCF, aCL, aTolE, aTolV1;
+ Standard_Real aTolV2, t1, t11, t1C, t2, t12, t2C;
Standard_Real aCoeff1, aCoeff2, aTol1, aTol2, dt1, dt2, aR, anEps;
Standard_Integer pri;
Standard_Boolean bInf1, bInf2, bAppr;
return;
}
//
- bAppr = (fabs(t2 - t1) > 100) ? Standard_False : Standard_True;
+ bAppr = !(fabs(t2 - t1) > 100);
if (fabs(t2 - t1) < anEps) {
myErrorStatus=7;
return;
}
}
} // else {
-
-
+ //
if (t1C>t2){
t1C=0.5*(t2+t1);
t2C=t1C+0.1*(t2-t1C);
// function: MakeConnexityBlocks
// purpose:
//=======================================================================
-void BOPTools_AlgoTools::MakeConnexityBlocks (const TopoDS_Shape& theS,
- const TopAbs_ShapeEnum theType1,
- const TopAbs_ShapeEnum theType2,
- BOPCol_ListOfShape& theLCB)
+void BOPTools_AlgoTools::MakeConnexityBlocks
+ (const TopoDS_Shape& theS,
+ const TopAbs_ShapeEnum theType1,
+ const TopAbs_ShapeEnum theType2,
+ BOPCol_ListOfShape& theLCB)
{
Standard_Integer aNbF, aNbAdd, aNbAdd1, i;
BRep_Builder aBB;
//
BOPTools_AlgoTools::MakeContainer(TopAbs_SHELL, aShellNew);
//
- BOPTools::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aEFMap);
+ BOPTools::MapShapesAndAncestors(aShell,
+ TopAbs_EDGE, TopAbs_FACE,
+ aEFMap);
aNbE=aEFMap.Extent();
//
// One seam edge in aEFMap contains 2 equivalent faces.
}
return anOr;
}
-
-////////////
-
-
//=======================================================================
// function: MakeConnexityBlock.
// purpose:
//=======================================================================
-void BOPTools_AlgoTools::MakeConnexityBlock (BOPCol_ListOfShape& theLFIn,
- BOPCol_IndexedMapOfShape& theMEAvoid,
- BOPCol_ListOfShape& theLCB,
- const Handle(NCollection_BaseAllocator)& theAllocator)
+void BOPTools_AlgoTools::MakeConnexityBlock
+ (BOPCol_ListOfShape& theLFIn,
+ BOPCol_IndexedMapOfShape& theMEAvoid,
+ BOPCol_ListOfShape& theLCB,
+ const Handle(NCollection_BaseAllocator)& theAllocator)
{
Standard_Integer aNbF, aNbAdd1, aNbAdd, i;
TopExp_Explorer aExp;
// function: ComputeStateByOnePoint
// purpose:
//=======================================================================
-TopAbs_State BOPTools_AlgoTools::ComputeStateByOnePoint(const TopoDS_Shape& theS,
- const TopoDS_Solid& theRef,
- const Standard_Real theTol,
- Handle(BOPInt_Context)& theContext)
+TopAbs_State BOPTools_AlgoTools::ComputeStateByOnePoint
+ (const TopoDS_Shape& theS,
+ const TopoDS_Solid& theRef,
+ const Standard_Real theTol,
+ Handle(BOPInt_Context)& theContext)
{
TopAbs_State aState;
TopAbs_ShapeEnum aType;
// function: ComputeState
// purpose:
//=======================================================================
-TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Face& theF,
- const TopoDS_Solid& theRef,
- const Standard_Real theTol,
- BOPCol_IndexedMapOfShape& theBounds,
- Handle(BOPInt_Context)& theContext)
+TopAbs_State BOPTools_AlgoTools::ComputeState
+ (const TopoDS_Face& theF,
+ const TopoDS_Solid& theRef,
+ const Standard_Real theTol,
+ BOPCol_IndexedMapOfShape& theBounds,
+ Handle(BOPInt_Context)& theContext)
{
TopAbs_State aState;
TopExp_Explorer aExp;
//
if (!theBounds.Contains(aSE)) {
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aSE));
- aState=BOPTools_AlgoTools::ComputeState(aE, theRef, theTol, theContext);
+ aState=BOPTools_AlgoTools::ComputeState(aE, theRef, theTol,
+ theContext);
return aState;
}
if (aE1.IsNull()) {
}
// !!<- process edges that are all on theRef
if (!aE1.IsNull()) {
- BOPTools_AlgoTools3D::PointNearEdge(aE1, theF, aP2D, aP3D, theContext);
- aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol, theContext);
+ BOPTools_AlgoTools3D::PointNearEdge(aE1, theF,
+ aP2D, aP3D, theContext);
+ aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol,
+ theContext);
}
//
return aState;
// function: ComputeState
// purpose:
//=======================================================================
-TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Vertex& theV,
- const TopoDS_Solid& theRef,
- const Standard_Real theTol,
- Handle(BOPInt_Context)& theContext)
+TopAbs_State BOPTools_AlgoTools::ComputeState
+ (const TopoDS_Vertex& theV,
+ const TopoDS_Solid& theRef,
+ const Standard_Real theTol,
+ Handle(BOPInt_Context)& theContext)
{
TopAbs_State aState;
gp_Pnt aP3D;
//
aP3D=BRep_Tool::Pnt(theV);
- aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol, theContext);
+ aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol,
+ theContext);
return aState;
}
//=======================================================================
// function: ComputeState
// purpose:
//=======================================================================
-TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Edge& theE,
- const TopoDS_Solid& theRef,
- const Standard_Real theTol,
- Handle(BOPInt_Context)& theContext)
+TopAbs_State BOPTools_AlgoTools::ComputeState
+ (const TopoDS_Edge& theE,
+ const TopoDS_Solid& theRef,
+ const Standard_Real theTol,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Real aT1, aT2, aT = 0.;
TopAbs_State aState;
aC3D->D0(aT, aP3D);
}
//
- aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol, theContext);
+ aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol,
+ theContext);
//
return aState;
}
// function: ComputeState
// purpose:
//=======================================================================
-TopAbs_State BOPTools_AlgoTools::ComputeState(const gp_Pnt& theP,
- const TopoDS_Solid& theRef,
- const Standard_Real theTol,
- Handle(BOPInt_Context)& theContext)
+TopAbs_State BOPTools_AlgoTools::ComputeState
+ (const gp_Pnt& theP,
+ const TopoDS_Solid& theRef,
+ const Standard_Real theTol,
+ Handle(BOPInt_Context)& theContext)
{
TopAbs_State aState;
//
break;
}
//
- iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF1, theContext);
+ iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF1,
+ theContext);
break;
}
//
//
if (aF2.IsSame(aF1) && BRep_Tool::IsClosed(aE, aF1)) {
// treat as it was for 1 face
- iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF2, theContext);
+ iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF2,
+ theContext);
break;
}
}
return iRet; // it can not be so
}
else { // aNbF=2,4,6,8,...
- iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aLF, theContext);
+ iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aLF,
+ theContext);
break;
}
}//for(; aExp.More(); aExp.Next()) {
//
BOPTools::MapShapes(theSolid, TopAbs_EDGE, aBounds);
//
- aState=BOPTools_AlgoTools::ComputeState(theFace, theSolid, theTol, aBounds, theContext);
+ aState=BOPTools_AlgoTools::ComputeState(theFace, theSolid,
+ theTol, aBounds, theContext);
//
iRet=(aState==TopAbs_IN)? 1 : 0;
//
//function : IsInternalFace
//purpose :
//=======================================================================
-Standard_Integer BOPTools_AlgoTools::IsInternalFace(const TopoDS_Face& theFace,
- const TopoDS_Edge& theEdge,
- BOPCol_ListOfShape& theLF,
- Handle(BOPInt_Context)& theContext)
+Standard_Integer BOPTools_AlgoTools::IsInternalFace
+ (const TopoDS_Face& theFace,
+ const TopoDS_Edge& theEdge,
+ BOPCol_ListOfShape& theLF,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Integer aNbF, iRet;
//
if (aNbF==2) {
const TopoDS_Face& aF1=(*(TopoDS_Face*)(&theLF.First()));
const TopoDS_Face& aF2=(*(TopoDS_Face*)(&theLF.Last()));
- iRet=BOPTools_AlgoTools::IsInternalFace(theFace, theEdge, aF1, aF2, theContext);
+ iRet=BOPTools_AlgoTools::IsInternalFace(theFace, theEdge, aF1, aF2,
+ theContext);
return iRet;
}
//
//
const TopoDS_Face& aF1=(*(TopoDS_Face*)(&aCSFF.Shape1()));
const TopoDS_Face& aF2=(*(TopoDS_Face*)(&aCSFF.Shape2()));
- iRet=BOPTools_AlgoTools::IsInternalFace(theFace, theEdge, aF1, aF2, theContext);
+ iRet=BOPTools_AlgoTools::IsInternalFace(theFace, theEdge, aF1, aF2,
+ theContext);
if (iRet) {
return iRet;
}
aPL->Bounds(aUmin, aUsup, aVmin, aVsup);
aProjPL.Init(aPL, aUmin, aUsup, aVmin, aVsup);
//
- GetFaceDir(theE1, theF1, aPx, aT, aDTgt, aDN1, aDBF, theContext, aProjPL);
+ GetFaceDir(theE1, theF1, aPx, aT, aDTgt, aDN1, aDBF, theContext,
+ aProjPL);
//
aDTF=aDN1^aDBF;
//
const TopoDS_Face& aF2=(*(TopoDS_Face*)(&aCS.Shape2()));
//
aDTgt2 = (aE2.Orientation()==aOr) ? aDTgt : aDTgt.Reversed();
- GetFaceDir(aE2, aF2, aPx, aT, aDTgt2, aDN2, aDBF2, theContext, aProjPL);
+ GetFaceDir(aE2, aF2, aPx, aT, aDTgt2, aDN2, aDBF2, theContext,
+ aProjPL);
//Angle
aAngle=AngleWithRef(aDBF, aDBF2, aDTF);
//
//function : AreFacesSameDomain
//purpose :
//=======================================================================
-Standard_Boolean BOPTools_AlgoTools::AreFacesSameDomain(const TopoDS_Face& theF1,
- const TopoDS_Face& theF2,
- Handle(BOPInt_Context)& theContext)
+Standard_Boolean BOPTools_AlgoTools::AreFacesSameDomain
+ (const TopoDS_Face& theF1,
+ const TopoDS_Face& theF2,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Boolean bFlag;
Standard_Integer iErr;
aTolF2=BRep_Tool::Tolerance(aF2);
aTol=aTolF1+aTolF2;
//
- iErr = BOPTools_AlgoTools3D::PointInFace(aF1, aP, aP2D, theContext);
+ iErr = BOPTools_AlgoTools3D::PointInFace(aF1, aP, aP2D,
+ theContext);
if (!iErr) {
bFlag=theContext->IsValidPointForFace(aP, aF2, aTol);
}
//function : CheckSameGeom
//purpose :
//=======================================================================
-Standard_Boolean BOPTools_AlgoTools::CheckSameGeom(const TopoDS_Face& theF1,
- const TopoDS_Face& theF2,
- Handle(BOPInt_Context)& theContext)
+Standard_Boolean BOPTools_AlgoTools::CheckSameGeom
+ (const TopoDS_Face& theF1,
+ const TopoDS_Face& theF2,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Boolean bRet;
Standard_Real aTolF1, aTolF2, aTol;
// function: IsSplitToReverse
// purpose:
//=======================================================================
-Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse(const TopoDS_Shape& theSp,
- const TopoDS_Shape& theSr,
- Handle(BOPInt_Context)& theContext)
+Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
+ (const TopoDS_Shape& theSp,
+ const TopoDS_Shape& theSr,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Boolean bRet;
TopAbs_ShapeEnum aType;
//function :IsSplitToReverse
//purpose :
//=======================================================================
-Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse(const TopoDS_Face& theFSp,
- const TopoDS_Face& theFSr,
- Handle(BOPInt_Context)& theContext)
+Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
+ (const TopoDS_Face& theFSp,
+ const TopoDS_Face& theFSr,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Boolean bRet, bFound, bInFace;
Standard_Real aT1, aT2, aT, aU, aV, aScPr;
Standard_Integer iErr;
gp_Pnt2d aP2DFSp;
//
- iErr=BOPTools_AlgoTools3D::PointInFace(theFSp, aPFSp, aP2DFSp, theContext);
+ iErr=BOPTools_AlgoTools3D::PointInFace(theFSp, aPFSp, aP2DFSp,
+ theContext);
if (iErr) {
return bRet;
}
else {
BRep_Tool::Range(aESp, aT1, aT2);
aT=BOPTools_AlgoTools2D::IntermediatePoint(aT1, aT2);
- BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aESp, theFSp, aT, aPFSp, aDNFSp, theContext);
+ BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aESp, theFSp, aT,
+ aPFSp, aDNFSp,
+ theContext);
}
//
// Parts of theContext->ComputeVS(..)
//function :IsSplitToReverse
//purpose :
//=======================================================================
-Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse(const TopoDS_Edge& aEF1,
- const TopoDS_Edge& aEF2,
- Handle(BOPInt_Context)& theContext)
+Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
+ (const TopoDS_Edge& aEF1,
+ const TopoDS_Edge& aEF2,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Boolean bRet, bIsDegenerated;
//
aTolE=BRep_Tool::Tolerance(aE);
//
const Handle(Geom_Curve)& aC3DE=BRep_Tool::Curve(aE, aT1, aT2);
- Handle(Geom_TrimmedCurve)aC3DETrim=new Geom_TrimmedCurve(aC3DE, aT1, aT2);
+ Handle(Geom_TrimmedCurve)aC3DETrim=
+ new Geom_TrimmedCurve(aC3DE, aT1, aT2);
//
for (i=0; i<2; ++i) {
bPC = !i ? bPC1 : bPC2;
}
//
if (aC3DE->IsPeriodic()) {
- BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D, aC2DA);
+ BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D,
+ aC2DA);
}
else {
- BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA);
+ BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D,
+ aC2DA);
}
//
aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE);
Standard_Real aTolV;
BRep_Builder aBB;
//
- BOPTools_AlgoTools::MakeSectEdge (theIC, theV1, theT1, theV2, theT2, theE);
+ BOPTools_AlgoTools::MakeSectEdge (theIC, theV1, theT1, theV2, theT2,
+ theE);
//
aBB.UpdateEdge(theE, theTolR3D);
//
//function : GetEdgeOnFace
//purpose :
//=======================================================================
-Standard_Boolean BOPTools_AlgoTools::GetEdgeOnFace(const TopoDS_Edge& theE1,
- const TopoDS_Face& theF2,
- TopoDS_Edge& theE2)
+Standard_Boolean BOPTools_AlgoTools::GetEdgeOnFace
+(const TopoDS_Edge& theE1,
+ const TopoDS_Face& theF2,
+ TopoDS_Edge& theE2)
{
Standard_Boolean bFound;
TopoDS_Iterator aItF, aItW;
// function: IsBlockInOnFace
// purpose:
//=======================================================================
-Standard_Boolean BOPTools_AlgoTools::IsBlockInOnFace (const IntTools_Range& aShrR,
- const TopoDS_Face& aF,
- const TopoDS_Edge& aE1,
- Handle(BOPInt_Context)& aContext)
+Standard_Boolean BOPTools_AlgoTools::IsBlockInOnFace
+ (const IntTools_Range& aShrR,
+ const TopoDS_Face& aF,
+ const TopoDS_Edge& aE1,
+ Handle(BOPInt_Context)& aContext)
{
Standard_Boolean bFlag;
Standard_Real f1, l1, ULD, VLD;
//function : IsMicroEdge
//purpose :
//=======================================================================
-Standard_Boolean BOPTools_AlgoTools::IsMicroEdge(const TopoDS_Edge& aE,
- const Handle(BOPInt_Context)& aCtx)
+Standard_Boolean BOPTools_AlgoTools::IsMicroEdge
+ (const TopoDS_Edge& aE,
+ const Handle(BOPInt_Context)& aCtx)
{
Standard_Boolean bRet;
Standard_Integer iErr;
}
//
BOPInt_ShrunkRange aSR;
- aSR.SetData(aE, aT1, aT2, aV1, aV2, aCtx);
+ aSR.SetContext(aCtx);
+ aSR.SetData(aE, aT1, aT2, aV1, aV2);
aSR.Perform();
iErr=aSR.ErrorStatus();
bRet = !(iErr==0);
//
gp_Pnt aPx;
if (!FindPointInFace(aE, aF, aP, aDB, aPx, theContext, aProjPL)) {
- BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aE, aF, aT, aPx, aDN, theContext);
+ BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aE, aF, aT, aPx,
+ aDN, theContext);
aProjPL.Perform(aPx);
aPx = aProjPL.NearestPoint();
gp_Vec aVec(aP, aPx);
//function : IsOpenShell
//purpose :
//=======================================================================
-Standard_Boolean
- BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh)
+Standard_Boolean BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh)
{
Standard_Boolean bRet;
Standard_Integer i, aNbE, aNbF;
const TopoDS_Shape& aF=aItLS.Value();
aOrF=aF.Orientation();
if (aOrF==TopAbs_INTERNAL || aOrF==TopAbs_EXTERNAL) {
- continue;
+ continue;
}
++aNbF;
}
// function: UpdateVertex
// purpose:
//=======================================================================
- void BOPTools_AlgoTools::UpdateVertex (const TopoDS_Vertex& aVF,
- const TopoDS_Vertex& aNewVertex)
+void BOPTools_AlgoTools::UpdateVertex
+ (const TopoDS_Vertex& aVF,
+ const TopoDS_Vertex& aNewVertex)
{
Standard_Real aTolVF, aTolNewVertex, aDist, aDTol=1.e-12, aNewTol;
//
// function: UpdateVertex
// purpose:
//=======================================================================
- void BOPTools_AlgoTools::UpdateVertex (const TopoDS_Edge& aE,
- const Standard_Real aT,
- const TopoDS_Vertex& aV)
+void BOPTools_AlgoTools::UpdateVertex (const TopoDS_Edge& aE,
+ const Standard_Real aT,
+ const TopoDS_Vertex& aV)
{
Standard_Real aTolV, aDist, aDTol=1.e-12, aFirst, aLast;
gp_Pnt aPc;
// function: UpdateVertex
// purpose:
//=======================================================================
- void BOPTools_AlgoTools::UpdateVertex (const IntTools_Curve& aC,
- const Standard_Real aT,
- const TopoDS_Vertex& aV)
+void BOPTools_AlgoTools::UpdateVertex (const IntTools_Curve& aC,
+ const Standard_Real aT,
+ const TopoDS_Vertex& aV)
{
Standard_Real aTolV, aDist, aDTol=1.e-12;
gp_Pnt aPc;
// function: MakeSectEdge
// purpose:
//=======================================================================
- void BOPTools_AlgoTools::MakeSectEdge(const IntTools_Curve& aIC,
- const TopoDS_Vertex& aV1,
- const Standard_Real aP1,
- const TopoDS_Vertex& aV2,
- const Standard_Real aP2,
- TopoDS_Edge& aNewEdge)
+void BOPTools_AlgoTools::MakeSectEdge(const IntTools_Curve& aIC,
+ const TopoDS_Vertex& aV1,
+ const Standard_Real aP1,
+ const TopoDS_Vertex& aV2,
+ const Standard_Real aP2,
+ TopoDS_Edge& aNewEdge)
{
Handle(Geom_Curve) aC=aIC.Curve ();
// function: MakeSplitEdge
// purpose:
//=======================================================================
- void BOPTools_AlgoTools::MakeSplitEdge(const TopoDS_Edge& aE,
- const TopoDS_Vertex& aV1,
- const Standard_Real aP1,
- const TopoDS_Vertex& aV2,
- const Standard_Real aP2,
- TopoDS_Edge& aNewEdge)
+void BOPTools_AlgoTools::MakeSplitEdge(const TopoDS_Edge& aE,
+ const TopoDS_Vertex& aV1,
+ const Standard_Real aP1,
+ const TopoDS_Vertex& aV2,
+ const Standard_Real aP2,
+ TopoDS_Edge& aNewEdge)
{
- Standard_Real f, l, aTol;
- Handle(Geom_Curve) aC=BRep_Tool::Curve (aE, f, l);
+ Standard_Real aTol;//f, l,
aTol=BRep_Tool::Tolerance(aE);
//
- // MakeEdge is used for chechking all input data only
- BRepBuilderAPI_MakeEdge aMakeEdge(aC, aV1, aV2, aP1, aP2);
- //ZZ const TopoDS_Edge& E1=TopoDS::Edge(aMakeEdge.Shape());
TopoDS_Edge E=aE;
E.EmptyCopy();
-
+ //
BRep_Builder BB;
BB.Add (E, aV1);
BB.Add (E, aV2);
// function: MakeNewVertex
// purpose:
//=======================================================================
- void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Vertex& aV1,
- const TopoDS_Vertex& aV2,
- TopoDS_Vertex& aNewVertex)
+void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Vertex& aV1,
+ const TopoDS_Vertex& aV2,
+ TopoDS_Vertex& aNewVertex)
{
gp_Pnt aPnt1=BRep_Tool::Pnt(aV1);
Standard_Real aTol1=BRep_Tool::Tolerance(aV1);
// function: MakeNewVertex
// purpose:
//=======================================================================
- void BOPTools_AlgoTools::MakeNewVertex(const gp_Pnt& aP,
- const Standard_Real aTol,
- TopoDS_Vertex& aNewVertex)
+void BOPTools_AlgoTools::MakeNewVertex(const gp_Pnt& aP,
+ const Standard_Real aTol,
+ TopoDS_Vertex& aNewVertex)
{
BRep_Builder aBB;
aBB.MakeVertex (aNewVertex, aP, aTol);
// function: MakeNewVertex
// purpose:
//=======================================================================
- void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Edge& aE1,
- const Standard_Real aParm1,
- const TopoDS_Edge& aE2,
- const Standard_Real aParm2,
- TopoDS_Vertex& aNewVertex)
+void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Edge& aE1,
+ const Standard_Real aParm1,
+ const TopoDS_Edge& aE2,
+ const Standard_Real aParm2,
+ TopoDS_Vertex& aNewVertex)
{
Standard_Real aTol1, aTol2, aMaxTol, aDist;
gp_Pnt aPnt1, aPnt2;
// function: MakeNewVertex
// purpose:
//=======================================================================
- void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Edge& aE1,
- const Standard_Real aParm1,
- const TopoDS_Face& aF1,
- TopoDS_Vertex& aNewVertex)
+void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Edge& aE1,
+ const Standard_Real aParm1,
+ const TopoDS_Face& aF1,
+ TopoDS_Vertex& aNewVertex)
{
Standard_Real aTol1, aTol2, aMaxTol, delta=1.e-12;
gp_Pnt aPnt;
// function: PointOnEdge
// purpose:
//=======================================================================
- void BOPTools_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
- const Standard_Real aParm,
- gp_Pnt& aPnt)
+void BOPTools_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
+ const Standard_Real aParm,
+ gp_Pnt& aPnt)
{
Standard_Real f, l;
Handle(Geom_Curve) C1=BRep_Tool::Curve(aE, f, l);
//function : CorrectRange
//purpose :
//=======================================================================
- void BOPTools_AlgoTools::CorrectRange(const TopoDS_Edge& aE1,
- const TopoDS_Edge& aE2,
- const IntTools_Range& aSR,
- IntTools_Range& aNewSR)
+void BOPTools_AlgoTools::CorrectRange(const TopoDS_Edge& aE1,
+ const TopoDS_Edge& aE2,
+ const IntTools_Range& aSR,
+ IntTools_Range& aNewSR)
{
Standard_Integer i;
Standard_Real aRes, aTolE1, aTolE2, aTF, aTL, dT;
//function : CorrectRange
//purpose :
//=======================================================================
- void BOPTools_AlgoTools::CorrectRange(const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- const IntTools_Range& aSR,
- IntTools_Range& aNewSR)
+void BOPTools_AlgoTools::CorrectRange(const TopoDS_Edge& aE,
+ const TopoDS_Face& aF,
+ const IntTools_Range& aSR,
+ IntTools_Range& aNewSR)
{
Standard_Integer i;
Standard_Real aRes, aTolF, aTF, aTL, dT;
//function : Dimension
//purpose :
//=======================================================================
- Standard_Integer BOPTools_AlgoTools::Dimension(const TopoDS_Shape& theS)
+Standard_Integer BOPTools_AlgoTools::Dimension(const TopoDS_Shape& theS)
{
Standard_Integer i, iRet, iRx0 = 0, iRx = 0;
TopAbs_ShapeEnum aTS;
//function : TreatCompound
//purpose :
//=======================================================================
- void TreatCompound(const TopoDS_Shape& theC1,
- BOPCol_ListOfShape& theLSX)
+void TreatCompound(const TopoDS_Shape& theC1,
+ BOPCol_ListOfShape& theLSX)
{
Standard_Integer aNbC1;
TopAbs_ShapeEnum aType;