Integration of OCCT 6.5.0 from SVN
[occt.git] / src / TopOpeBRepDS / TopOpeBRepDS_Filter.cxx
CommitLineData
7fd59977 1// File: TopOpeBRepDS_Filter.cxx
2// Created: Mon Apr 21 17:31:57 1997
3// Author: Prestataire Mary FABIEN
4// <fbi@langdox.paris1.matra-dtv.fr>
5
6#include <TopOpeBRepDS_Filter.ixx>
7#include <TopOpeBRepDS_DataStructure.hxx>
8#include <TopoDS_Shape.hxx>
9#include <TopOpeBRepDS_Interference.hxx>
10#include <TopOpeBRepDS_ListOfInterference.hxx>
11#include <TopOpeBRepDS_ListIteratorOfListOfInterference.hxx>
12
13#ifdef DEB
14Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettracePEI();
15Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettracePI();
16Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
17//unreferenced function, commented
18/*static Standard_Boolean TRCE(const Standard_Integer EIX) {
19 Standard_Boolean b1 = TopOpeBRepDS_GettracePEI();
20 Standard_Boolean b2 = TopOpeBRepDS_GettracePI();
21 Standard_Boolean b3 = TopOpeBRepDS_GettraceSPSX(EIX);
22 return (b1 || b2 || b3);
23}*/
24#endif
25
26//=======================================================================
27//function : TopOpeBRepDS_Filter
28//purpose :
29//=======================================================================
30
31TopOpeBRepDS_Filter::TopOpeBRepDS_Filter
32(const Handle(TopOpeBRepDS_HDataStructure)& HDS,
33 const TopOpeBRepTool_PShapeClassifier& pClassif)
34: myHDS(HDS),
35 myPShapeClassif(pClassif)
36{}
37
38
39//=======================================================================
40//function : ProcessInterferences
41//purpose :
42//=======================================================================
43
44void TopOpeBRepDS_Filter::ProcessInterferences()
45{
46 ProcessEdgeInterferences();
47 ProcessCurveInterferences();
48}
49
50//=======================================================================
51//function : ProcessEdgeInterferences
52//purpose :
53//=======================================================================
54
55void TopOpeBRepDS_Filter::ProcessEdgeInterferences()
56{
57 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
58 Standard_Integer i,nshape = BDS.NbShapes();
59
60 for (i = 1; i <= nshape; i++) {
61 const TopoDS_Shape& S = BDS.Shape(i);
62 if(S.IsNull()) continue;
63 if ( S.ShapeType() == TopAbs_EDGE ) {
64 ProcessEdgeInterferences(i);
65 }
66 }
67}
68
69//=======================================================================
70//function : ProcessFaceInterferences
71//purpose :
72//=======================================================================
73
74void TopOpeBRepDS_Filter::ProcessFaceInterferences
75(const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MEsp)
76{
77 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
78 Standard_Integer i,nshape = BDS.NbShapes();
79
80 for (i = 1; i <= nshape; i++) {
81 const TopoDS_Shape& S = BDS.Shape(i);
82 if(S.IsNull()) continue;
83 if ( S.ShapeType() == TopAbs_FACE ) {
84 ProcessFaceInterferences(i,MEsp);
85 }
86 }
87}
88
89//=======================================================================
90//function : ProcessCurveInterferences
91//purpose :
92//=======================================================================
93
94void TopOpeBRepDS_Filter::ProcessCurveInterferences()
95{
96 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
97 Standard_Integer i,ncurve = BDS.NbCurves();
98 for (i = 1; i <= ncurve; i++) {
99 ProcessCurveInterferences(i);
100 }
101}
102
103// ProcessFaceInterferences : voir FilterFaceInterferences.cxx
104// ProcessEdgeInterferences : voir FilterEdgeInterferences.cxx
105// ProcessCurveInterferences : voir FilterCurveInterferences.cxx