1 // Created on: 1997-04-21
2 // Created by: Prestataire Mary FABIEN
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
22 #include <TopOpeBRepDS_Filter.ixx>
23 #include <TopOpeBRepDS_DataStructure.hxx>
24 #include <TopoDS_Shape.hxx>
25 #include <TopOpeBRepDS_Interference.hxx>
26 #include <TopOpeBRepDS_ListOfInterference.hxx>
27 #include <TopOpeBRepDS_ListIteratorOfListOfInterference.hxx>
30 Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettracePEI();
31 Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettracePI();
32 Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
33 //unreferenced function, commented
34 /*static Standard_Boolean TRCE(const Standard_Integer EIX) {
35 Standard_Boolean b1 = TopOpeBRepDS_GettracePEI();
36 Standard_Boolean b2 = TopOpeBRepDS_GettracePI();
37 Standard_Boolean b3 = TopOpeBRepDS_GettraceSPSX(EIX);
38 return (b1 || b2 || b3);
42 //=======================================================================
43 //function : TopOpeBRepDS_Filter
45 //=======================================================================
47 TopOpeBRepDS_Filter::TopOpeBRepDS_Filter
48 (const Handle(TopOpeBRepDS_HDataStructure)& HDS,
49 const TopOpeBRepTool_PShapeClassifier& pClassif)
51 myPShapeClassif(pClassif)
55 //=======================================================================
56 //function : ProcessInterferences
58 //=======================================================================
60 void TopOpeBRepDS_Filter::ProcessInterferences()
62 ProcessEdgeInterferences();
63 ProcessCurveInterferences();
66 //=======================================================================
67 //function : ProcessEdgeInterferences
69 //=======================================================================
71 void TopOpeBRepDS_Filter::ProcessEdgeInterferences()
73 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
74 Standard_Integer i,nshape = BDS.NbShapes();
76 for (i = 1; i <= nshape; i++) {
77 const TopoDS_Shape& S = BDS.Shape(i);
78 if(S.IsNull()) continue;
79 if ( S.ShapeType() == TopAbs_EDGE ) {
80 ProcessEdgeInterferences(i);
85 //=======================================================================
86 //function : ProcessFaceInterferences
88 //=======================================================================
90 void TopOpeBRepDS_Filter::ProcessFaceInterferences
91 (const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MEsp)
93 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
94 Standard_Integer i,nshape = BDS.NbShapes();
96 for (i = 1; i <= nshape; i++) {
97 const TopoDS_Shape& S = BDS.Shape(i);
98 if(S.IsNull()) continue;
99 if ( S.ShapeType() == TopAbs_FACE ) {
100 ProcessFaceInterferences(i,MEsp);
105 //=======================================================================
106 //function : ProcessCurveInterferences
108 //=======================================================================
110 void TopOpeBRepDS_Filter::ProcessCurveInterferences()
112 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
113 Standard_Integer i,ncurve = BDS.NbCurves();
114 for (i = 1; i <= ncurve; i++) {
115 ProcessCurveInterferences(i);
119 // ProcessFaceInterferences : voir FilterFaceInterferences.cxx
120 // ProcessEdgeInterferences : voir FilterEdgeInterferences.cxx
121 // ProcessCurveInterferences : voir FilterCurveInterferences.cxx