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 | |
7fd59977 |
26 | //======================================================================= |
27 | //function : TopOpeBRepDS_Filter |
28 | //purpose : |
29 | //======================================================================= |
30 | |
31 | TopOpeBRepDS_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 | |
44 | void TopOpeBRepDS_Filter::ProcessInterferences() |
45 | { |
46 | ProcessEdgeInterferences(); |
47 | ProcessCurveInterferences(); |
48 | } |
49 | |
50 | //======================================================================= |
51 | //function : ProcessEdgeInterferences |
52 | //purpose : |
53 | //======================================================================= |
54 | |
55 | void 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 | |
74 | void 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 | |
94 | void 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 |