Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GEOMAlgo_Extractor.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // File: GEOMAlgo_Extractor.hxx
24 // Author: Sergey KHROMOV
25 
26 #ifndef _GEOMAlgo_Extractor_HeaderFile
27 #define _GEOMAlgo_Extractor_HeaderFile
28 
29 
30 #include <GEOMAlgo_Algo.hxx>
31 
32 #include <NCollection_List.hxx>
33 #include <TopoDS_Shape.hxx>
34 #include <TopTools_DataMapOfShapeListOfShape.hxx>
35 #include <TopTools_ListOfShape.hxx>
36 #include <TopTools_MapOfShape.hxx>
37 #include <TopTools_IndexedMapOfShape.hxx>
38 
39 
45 {
46 public:
47 
51  Standard_EXPORT GEOMAlgo_Extractor();
52 
56  Standard_EXPORT virtual ~GEOMAlgo_Extractor();
57 
63  Standard_EXPORT void SetShape(const TopoDS_Shape &theShape);
64 
70  const TopoDS_Shape &GetShape() const
71  { return myShape; }
72 
79  Standard_EXPORT void SetShapesToRemove
80  (const TopTools_ListOfShape &theSubShapes);
81 
88  const TopTools_ListOfShape &GetShapesToRemove() const
89  { return mySubShapes; }
90 
94  Standard_EXPORT virtual void Perform();
95 
101  Standard_EXPORT const TopoDS_Shape &GetResult() const;
102 
108  const TopTools_ListOfShape &GetRemoved() const
109  { return myRemoved; }
110 
116  const TopTools_ListOfShape &GetModified() const
117  { return myModified; }
118 
125  const TopTools_ListOfShape &GetNew() const
126  { return myNew; }
127 
128 private:
129 
133  void clear();
134 
138  void checkData();
139 
147  void makeMapShapeAncestors(const TopoDS_Shape &theShape);
148 
152  void markShapes();
153 
160  void markRemoved(const TopoDS_Shape &theShape);
161 
168  void markAncestorsModified(const TopoDS_Shape &theShape);
169 
176  void processShapes(const TopAbs_ShapeEnum &theType);
177 
183  void processEdge(const TopoDS_Shape &theEdge);
184 
190  void processWire(const TopoDS_Shape &theWire);
191 
197  void processFOrSo(const TopoDS_Shape &theFOrSo);
198 
204  void processShOrCS(const TopoDS_Shape &theShOrCS);
205 
211  void processCompound(const TopoDS_Shape &theCompound);
212 
219  void removeBoundsOnFOrSo(const TopAbs_ShapeEnum theType);
220 
228  TopoDS_Shape oriented(const TopoDS_Shape &theShape,
229  const TopoDS_Shape &theContext);
230 
239  TopoDS_Shape makeShape(const TopoDS_Shape &theShape,
240  const TopTools_ListOfShape &theSubShapes);
241 
251  TopoDS_Shape getShapeFromSubShapes(const TopoDS_Shape &theShape,
252  const TopTools_ListOfShape &theSubShapes);
253 
262  TopoDS_Shape makeResult(const TopoDS_Shape &theShape);
263 
272  void makeHistory(const TopoDS_Shape &theShape,
273  TopTools_MapOfShape &theMapFence);
274 
285  Standard_Boolean removeCommonEdges
286  (const TopoDS_Shape &theWire,
287  const TopTools_IndexedMapOfShape &theMapEdgesToRm,
288  TopTools_ListOfShape &theNewWires);
289 
300  Standard_Boolean removeCommonFaces
301  (const TopoDS_Shape &theShell,
302  const TopTools_IndexedMapOfShape &theMapFacesToRm,
303  TopTools_ListOfShape &theNewShells);
304 
313  void makeWires(const TopoDS_Shape &theWire,
314  NCollection_List<TopTools_ListOfShape> &theListListEdges,
315  TopTools_ListOfShape &theWires);
316 
328  void groupViaBounds(const TopoDS_Shape &theShape,
329  const TopTools_ListOfShape &theSubShapes,
330  TopTools_ListOfShape &theNewShapes);
331 
343  void getModified(const TopoDS_Shape &theShape,
344  TopTools_ListOfShape &theModifShapes,
345  const TopAbs_ShapeEnum theShapeType = TopAbs_SHAPE);
346 
347 protected:
348 
349  TopoDS_Shape myShape;
350  TopoDS_Shape myResult;
351  TopTools_ListOfShape mySubShapes;
352  TopTools_ListOfShape myRemoved;
353  TopTools_ListOfShape myModified;
354  TopTools_ListOfShape myNew;
355  TopTools_DataMapOfShapeListOfShape myMapShapeAnc;
356  TopTools_MapOfShape myMapRemoved;
357  TopTools_DataMapOfShapeListOfShape myMapModified;
358  TopTools_DataMapOfShapeListOfShape myMapNewShapeAnc;
359 
360 };
361 
362 #endif