1 // Created on: 1997-04-21
2 // Created by: Prestataire Mary FABIEN
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <TopOpeBRepDS_Filter.ixx>
18 #include <TopOpeBRepDS_DataStructure.hxx>
19 #include <TopoDS_Shape.hxx>
20 #include <TopOpeBRepDS_Interference.hxx>
21 #include <TopOpeBRepDS_ListOfInterference.hxx>
22 #include <TopOpeBRepDS_ListIteratorOfListOfInterference.hxx>
25 extern Standard_Boolean TopOpeBRepDS_GettracePEI();
26 extern Standard_Boolean TopOpeBRepDS_GettracePI();
27 extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
28 //unreferenced function, commented
29 /*static Standard_Boolean TRCE(const Standard_Integer EIX) {
30 Standard_Boolean b1 = TopOpeBRepDS_GettracePEI();
31 Standard_Boolean b2 = TopOpeBRepDS_GettracePI();
32 Standard_Boolean b3 = TopOpeBRepDS_GettraceSPSX(EIX);
33 return (b1 || b2 || b3);
37 //=======================================================================
38 //function : TopOpeBRepDS_Filter
40 //=======================================================================
42 TopOpeBRepDS_Filter::TopOpeBRepDS_Filter
43 (const Handle(TopOpeBRepDS_HDataStructure)& HDS,
44 const TopOpeBRepTool_PShapeClassifier& pClassif)
46 myPShapeClassif(pClassif)
50 //=======================================================================
51 //function : ProcessInterferences
53 //=======================================================================
55 void TopOpeBRepDS_Filter::ProcessInterferences()
57 ProcessEdgeInterferences();
58 ProcessCurveInterferences();
61 //=======================================================================
62 //function : ProcessEdgeInterferences
64 //=======================================================================
66 void TopOpeBRepDS_Filter::ProcessEdgeInterferences()
68 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
69 Standard_Integer i,nshape = BDS.NbShapes();
71 for (i = 1; i <= nshape; i++) {
72 const TopoDS_Shape& S = BDS.Shape(i);
73 if(S.IsNull()) continue;
74 if ( S.ShapeType() == TopAbs_EDGE ) {
75 ProcessEdgeInterferences(i);
80 //=======================================================================
81 //function : ProcessFaceInterferences
83 //=======================================================================
85 void TopOpeBRepDS_Filter::ProcessFaceInterferences
86 (const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MEsp)
88 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
89 Standard_Integer i,nshape = BDS.NbShapes();
91 for (i = 1; i <= nshape; i++) {
92 const TopoDS_Shape& S = BDS.Shape(i);
93 if(S.IsNull()) continue;
94 if ( S.ShapeType() == TopAbs_FACE ) {
95 ProcessFaceInterferences(i,MEsp);
100 //=======================================================================
101 //function : ProcessCurveInterferences
103 //=======================================================================
105 void TopOpeBRepDS_Filter::ProcessCurveInterferences()
107 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
108 Standard_Integer i,ncurve = BDS.NbCurves();
109 for (i = 1; i <= ncurve; i++) {
110 ProcessCurveInterferences(i);
114 // ProcessFaceInterferences : voir FilterFaceInterferences.cxx
115 // ProcessEdgeInterferences : voir FilterEdgeInterferences.cxx
116 // ProcessCurveInterferences : voir FilterCurveInterferences.cxx