1 // Created by: Peter KURNEV
2 // Copyright (c) 2010-2012 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 // The content of this file is subject to the Open CASCADE Technology Public
8 // License Version 6.5 (the "License"). You may not use the content of this file
9 // except in compliance with the License. Please obtain a copy of the License
10 // at http://www.opencascade.org and read it completely before using this file.
12 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
13 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
15 // The Original Code and all software distributed under the License is
16 // distributed on an "AS IS" basis, without warranty of any kind, and the
17 // Initial Developer hereby disclaims all such warranties, including without
18 // limitation, any warranties of merchantability, fitness for a particular
19 // purpose or non-infringement. Please see the License for the specific terms
20 // and conditions governing the rights and limitations under the License.
23 #include <BOPAlgo_PaveFiller.ixx>
25 #include <TopoDS_Vertex.hxx>
26 #include <TopoDS_Edge.hxx>
27 #include <BRep_Tool.hxx>
29 #include <BOPInt_Context.hxx>
31 #include <BOPDS_Iterator.hxx>
32 #include <BOPDS_VectorOfInterfVE.hxx>
33 #include <BOPDS_Interf.hxx>
34 #include <BOPDS_PassKey.hxx>
35 #include <BOPDS_MapOfPassKey.hxx>
36 #include <BRepBndLib.hxx>
37 #include <BRep_Builder.hxx>
40 //=======================================================================
41 // function: PerformVE
43 //=======================================================================
44 void BOPAlgo_PaveFiller::PerformVE()
46 Standard_Boolean bJustAdd;
47 Standard_Integer iSize, nV, nE, nVSD, iFlag, nVx, i;
48 Standard_Real aT, aTolE, aTolV;
51 BOPDS_MapOfPassKey aMPK;
56 myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE);
57 iSize=myIterator->ExpectedLength();
62 BOPDS_VectorOfInterfVE& aVEs=myDS->InterfVE();
63 aVEs.SetStartSize(iSize);
64 aVEs.SetIncrement(iSize);
67 for (; myIterator->More(); myIterator->Next()) {
68 myIterator->Value(nV, nE, bJustAdd);
73 const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
74 if (aSIE.HasSubShape(nV)) {
82 if (myDS->HasInterfShapeSubShapes(nV, nE)) {
83 myDS->ChangePaveBlocks(nE);
88 if (myDS->HasShapeSD(nV, nVSD)) {
97 const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape()));
98 const TopoDS_Vertex& aV=(*(TopoDS_Vertex *)(&myDS->Shape(nVx)));
100 iFlag=myContext->ComputeVE (aV, aE, aT);
104 BOPDS_InterfVE& aVE=aVEs(i);
105 aVE.SetIndices(nV, nE);
106 aVE.SetParameter(aT);
108 myDS->AddInterf(nV, nE);
110 BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
111 Handle(BOPDS_PaveBlock)& aPB=*((Handle_BOPDS_PaveBlock*)&aLPB.First());
114 aPave.SetParameter(aT);
115 aPB->AppendExtPave(aPave);
116 aTolV = BRep_Tool::Tolerance(aV);
117 aTolE = BRep_Tool::Tolerance(aE);
118 if ( aTolV < aTolE) {
119 aBB.UpdateVertex(aV, aTolE);
120 BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nVx);
121 Bnd_Box& aBoxDS=aSIDS.ChangeBox();
122 BRepBndLib::Add(aV, aBoxDS);
125 }//for (; myIterator->More(); myIterator->Next()) {