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.
18 #include <TopoDS_Shape.hxx>
19 #include <TopOpeBRepDS_DataStructure.hxx>
20 #include <TopOpeBRepDS_Filter.hxx>
21 #include <TopOpeBRepDS_HDataStructure.hxx>
22 #include <TopOpeBRepDS_Interference.hxx>
23 #include <TopOpeBRepDS_ListIteratorOfListOfInterference.hxx>
24 #include <TopOpeBRepDS_ListOfInterference.hxx>
26 //=======================================================================
27 //function : TopOpeBRepDS_Filter
29 //=======================================================================
31 TopOpeBRepDS_Filter::TopOpeBRepDS_Filter
32 (const Handle(TopOpeBRepDS_HDataStructure)& HDS,
33 const TopOpeBRepTool_PShapeClassifier& pClassif)
35 myPShapeClassif(pClassif)
39 //=======================================================================
40 //function : ProcessInterferences
42 //=======================================================================
44 void TopOpeBRepDS_Filter::ProcessInterferences()
46 ProcessEdgeInterferences();
47 ProcessCurveInterferences();
50 //=======================================================================
51 //function : ProcessEdgeInterferences
53 //=======================================================================
55 void TopOpeBRepDS_Filter::ProcessEdgeInterferences()
57 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
58 Standard_Integer i,nshape = BDS.NbShapes();
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);
69 //=======================================================================
70 //function : ProcessFaceInterferences
72 //=======================================================================
74 void TopOpeBRepDS_Filter::ProcessFaceInterferences
75 (const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MEsp)
77 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
78 Standard_Integer i,nshape = BDS.NbShapes();
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);
89 //=======================================================================
90 //function : ProcessCurveInterferences
92 //=======================================================================
94 void TopOpeBRepDS_Filter::ProcessCurveInterferences()
96 TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
97 Standard_Integer i,ncurve = BDS.NbCurves();
98 for (i = 1; i <= ncurve; i++) {
99 ProcessCurveInterferences(i);
103 // ProcessFaceInterferences : voir FilterFaceInterferences.cxx
104 // ProcessEdgeInterferences : voir FilterEdgeInterferences.cxx
105 // ProcessCurveInterferences : voir FilterCurveInterferences.cxx