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.
22 #include <BOPAlgo_CheckerSI.ixx>
24 #include <Standard_ErrorHandler.hxx>
25 #include <Standard_Failure.hxx>
27 #include <BOPDS_DS.hxx>
28 #include <BOPDS_IteratorSI.hxx>
29 #include <BOPDS_PIteratorSI.hxx>
30 #include <BOPInt_Context.hxx>
32 #include <BOPDS_Interf.hxx>
33 #include <BOPDS_MapOfPassKey.hxx>
34 #include <BOPDS_PassKey.hxx>
35 #include <BOPDS_VectorOfInterfVV.hxx>
36 #include <BOPDS_VectorOfInterfVE.hxx>
37 #include <BOPDS_VectorOfInterfVE.hxx>
38 #include <BOPDS_VectorOfInterfVF.hxx>
39 #include <BOPDS_VectorOfInterfEF.hxx>
40 #include <BOPDS_VectorOfInterfFF.hxx>
41 #include <BOPDS_VectorOfPoint.hxx>
42 #include <BOPTools_AlgoTools.hxx>
44 //=======================================================================
47 //=======================================================================
48 BOPAlgo_CheckerSI::BOPAlgo_CheckerSI()
54 //=======================================================================
57 //=======================================================================
58 BOPAlgo_CheckerSI::~BOPAlgo_CheckerSI()
61 //=======================================================================
62 //function : SetLevelOfCheck
64 //=======================================================================
65 void BOPAlgo_CheckerSI::SetLevelOfCheck(const Standard_Integer theLevel)
67 if (theLevel >= 0 && theLevel <= 5) {
68 myLevelOfCheck = theLevel;
71 //=======================================================================
74 //=======================================================================
75 void BOPAlgo_CheckerSI::Init()
79 if (!myArguments.Extent()) {
87 myDS=new BOPDS_DS(myAllocator);
88 myDS->SetArguments(myArguments);
92 BOPDS_PIteratorSI theIterSI=new BOPDS_IteratorSI(myAllocator);
93 theIterSI->SetDS(myDS);
95 theIterSI->UpdateByLevelOfCheck(myLevelOfCheck);
100 myContext=new BOPInt_Context;
104 //=======================================================================
107 //=======================================================================
108 void BOPAlgo_CheckerSI::Perform()
110 //modified by NIZNHY-PKV Thu Sep 19 08:14:52 2013f
114 BOPAlgo_PaveFiller::Perform();
121 catch (Standard_Failure) {
124 BOPAlgo_PaveFiller::Perform();
131 //modified by NIZNHY-PKV Thu Sep 19 08:14:56 2013t
133 //=======================================================================
134 //function : PostTreat
136 //=======================================================================
137 void BOPAlgo_CheckerSI::PostTreat()
139 Standard_Integer i, aNb, n1, n2;
142 BOPDS_MapOfPassKey& aMPK=*((BOPDS_MapOfPassKey*)&myDS->Interferences());
146 BOPDS_VectorOfInterfVV& aVVs=myDS->InterfVV();
148 for (i=0; i!=aNb; ++i) {
149 const BOPDS_InterfVV& aVV=aVVs(i);
156 BOPDS_VectorOfInterfVE& aVEs=myDS->InterfVE();
158 for (i=0; i!=aNb; ++i) {
159 const BOPDS_InterfVE& aVE=aVEs(i);
166 BOPDS_VectorOfInterfEE& aEEs=myDS->InterfEE();
168 for (i=0; i!=aNb; ++i) {
169 const BOPDS_InterfEE& aEE=aEEs(i);
176 BOPDS_VectorOfInterfVF& aVFs=myDS->InterfVF();
178 for (i=0; i!=aNb; ++i) {
179 const BOPDS_InterfVF& aVF=aVFs(i);
186 BOPDS_VectorOfInterfEF& aEFs=myDS->InterfEF();
188 for (i=0; i!=aNb; ++i) {
189 const BOPDS_InterfEF& aEF=aEFs(i);
190 if (aEF.CommonPart().Type()==TopAbs_SHAPE) {
199 BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
201 for (i=0; i!=aNb; ++i) {
202 Standard_Boolean bTangentFaces, bFlag;
203 Standard_Integer aNbC, aNbP, j, iFound;
205 const BOPDS_InterfFF& aFF=aFFs(i);
208 bTangentFaces=aFF.TangentFaces();
209 aNbP=aFF.Points().Extent();
210 const BOPDS_VectorOfCurve& aVC=aFF.Curves();
212 if (!aNbP && !aNbC && !bTangentFaces) {
218 const TopoDS_Face& aF1 = *((TopoDS_Face*)&myDS->Shape(n1));
219 const TopoDS_Face& aF2 = *((TopoDS_Face*)&myDS->Shape(n2));
220 bFlag=BOPTools_AlgoTools::AreFacesSameDomain(aF1, aF2, myContext);
226 for (j=0; j!=aNbC; ++j) {
227 const BOPDS_Curve& aNC=aVC(j);
228 const BOPDS_ListOfPaveBlock& aLPBC=aNC.PaveBlocks();
229 if (aLPBC.Extent()) {