1 // Created by: Peter KURNEV
2 // Copyright (c) 2010-2014 OPEN CASCADE SAS
3 // Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 // Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
5 // EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 // This file is part of Open CASCADE Technology software library.
9 // This library is free software; you can redistribute it and / or modify it
10 // under the terms of the GNU Lesser General Public version 2.1 as published
11 // by the Free Software Foundation, with special exception defined in the file
12 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
13 // distribution for complete text of the license and disclaimer of any warranty.
15 // Alternatively, this file may be used under the terms of Open CASCADE
16 // commercial license or contractual agreement.
18 #include <BOPAlgo_PaveFiller.ixx>
20 #include <TopoDS_Vertex.hxx>
21 #include <TopoDS_Edge.hxx>
22 #include <BRep_Tool.hxx>
24 #include <BOPInt_Context.hxx>
26 #include <BOPDS_Iterator.hxx>
27 #include <BOPDS_VectorOfInterfVE.hxx>
28 #include <BOPDS_Interf.hxx>
29 #include <BOPDS_PassKey.hxx>
30 #include <BOPDS_MapOfPassKey.hxx>
31 #include <BRepBndLib.hxx>
32 #include <BRep_Builder.hxx>
35 //=======================================================================
36 // function: PerformVE
38 //=======================================================================
39 void BOPAlgo_PaveFiller::PerformVE()
41 Standard_Boolean bJustAdd;
42 Standard_Integer iSize, nV, nE, nVSD, iFlag, nVx, i;
43 Standard_Real aT, aTolE, aTolV;
46 BOPDS_MapOfPassKey aMPK;
51 myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE);
52 iSize=myIterator->ExpectedLength();
57 BOPDS_VectorOfInterfVE& aVEs=myDS->InterfVE();
58 aVEs.SetStartSize(iSize);
59 aVEs.SetIncrement(iSize);
62 for (; myIterator->More(); myIterator->Next()) {
63 myIterator->Value(nV, nE, bJustAdd);
68 const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
69 if (aSIE.HasSubShape(nV)) {
77 if (myDS->HasInterfShapeSubShapes(nV, nE)) {
78 myDS->ChangePaveBlocks(nE);
83 if (myDS->HasShapeSD(nV, nVSD)) {
92 const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape()));
93 const TopoDS_Vertex& aV=(*(TopoDS_Vertex *)(&myDS->Shape(nVx)));
95 iFlag=myContext->ComputeVE (aV, aE, aT);
99 BOPDS_InterfVE& aVE=aVEs(i);
100 aVE.SetIndices(nV, nE);
101 aVE.SetParameter(aT);
103 myDS->AddInterf(nV, nE);
105 BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
106 Handle(BOPDS_PaveBlock)& aPB=*((Handle_BOPDS_PaveBlock*)&aLPB.First());
109 aPave.SetParameter(aT);
110 aPB->AppendExtPave(aPave);
111 aTolV = BRep_Tool::Tolerance(aV);
112 aTolE = BRep_Tool::Tolerance(aE);
113 if ( aTolV < aTolE) {
114 aBB.UpdateVertex(aV, aTolE);
115 BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nVx);
116 Bnd_Box& aBoxDS=aSIDS.ChangeBox();
117 BRepBndLib::Add(aV, aBoxDS);
120 }//for (; myIterator->More(); myIterator->Next()) {