0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / TopOpeBRepDS / TopOpeBRepDS_Filter.cxx
CommitLineData
b311480e 1// Created on: 1997-04-21
2// Created by: Prestataire Mary FABIEN
3// Copyright (c) 1997-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
42cf5bc1 17
7fd59977 18#include <TopoDS_Shape.hxx>
42cf5bc1 19#include <TopOpeBRepDS_DataStructure.hxx>
20#include <TopOpeBRepDS_Filter.hxx>
21#include <TopOpeBRepDS_HDataStructure.hxx>
7fd59977 22#include <TopOpeBRepDS_Interference.hxx>
7fd59977 23#include <TopOpeBRepDS_ListIteratorOfListOfInterference.hxx>
42cf5bc1 24#include <TopOpeBRepDS_ListOfInterference.hxx>
7fd59977 25
0797d9d3 26#ifdef OCCT_DEBUG
1d0a9d4d 27extern Standard_Boolean TopOpeBRepDS_GettracePEI();
28extern Standard_Boolean TopOpeBRepDS_GettracePI();
29extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
7fd59977 30//unreferenced function, commented
31/*static Standard_Boolean TRCE(const Standard_Integer EIX) {
32 Standard_Boolean b1 = TopOpeBRepDS_GettracePEI();
33 Standard_Boolean b2 = TopOpeBRepDS_GettracePI();
34 Standard_Boolean b3 = TopOpeBRepDS_GettraceSPSX(EIX);
35 return (b1 || b2 || b3);
36}*/
37#endif
38
39//=======================================================================
40//function : TopOpeBRepDS_Filter
41//purpose :
42//=======================================================================
43
44TopOpeBRepDS_Filter::TopOpeBRepDS_Filter
45(const Handle(TopOpeBRepDS_HDataStructure)& HDS,
46 const TopOpeBRepTool_PShapeClassifier& pClassif)
47: myHDS(HDS),
48 myPShapeClassif(pClassif)
49{}
50
51
52//=======================================================================
53//function : ProcessInterferences
54//purpose :
55//=======================================================================
56
57void TopOpeBRepDS_Filter::ProcessInterferences()
58{
59 ProcessEdgeInterferences();
60 ProcessCurveInterferences();
61}
62
63//=======================================================================
64//function : ProcessEdgeInterferences
65//purpose :
66//=======================================================================
67
68void TopOpeBRepDS_Filter::ProcessEdgeInterferences()
69{
70 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
71 Standard_Integer i,nshape = BDS.NbShapes();
72
73 for (i = 1; i <= nshape; i++) {
74 const TopoDS_Shape& S = BDS.Shape(i);
75 if(S.IsNull()) continue;
76 if ( S.ShapeType() == TopAbs_EDGE ) {
77 ProcessEdgeInterferences(i);
78 }
79 }
80}
81
82//=======================================================================
83//function : ProcessFaceInterferences
84//purpose :
85//=======================================================================
86
87void TopOpeBRepDS_Filter::ProcessFaceInterferences
88(const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MEsp)
89{
90 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
91 Standard_Integer i,nshape = BDS.NbShapes();
92
93 for (i = 1; i <= nshape; i++) {
94 const TopoDS_Shape& S = BDS.Shape(i);
95 if(S.IsNull()) continue;
96 if ( S.ShapeType() == TopAbs_FACE ) {
97 ProcessFaceInterferences(i,MEsp);
98 }
99 }
100}
101
102//=======================================================================
103//function : ProcessCurveInterferences
104//purpose :
105//=======================================================================
106
107void TopOpeBRepDS_Filter::ProcessCurveInterferences()
108{
109 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
110 Standard_Integer i,ncurve = BDS.NbCurves();
111 for (i = 1; i <= ncurve; i++) {
112 ProcessCurveInterferences(i);
113 }
114}
115
116// ProcessFaceInterferences : voir FilterFaceInterferences.cxx
117// ProcessEdgeInterferences : voir FilterEdgeInterferences.cxx
118// ProcessCurveInterferences : voir FilterCurveInterferences.cxx