1 // Created on: 1998-11-19
2 // Created by: Jean-Michel BOULCOURT
3 // Copyright (c) 1998-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.
17 #ifndef _TopOpeBRepTool_PurgeInternalEdges_HeaderFile
18 #define _TopOpeBRepTool_PurgeInternalEdges_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopoDS_Shape.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <TopTools_DataMapOfShapeListOfShape.hxx>
27 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
28 #include <Standard_Integer.hxx>
31 //! remove from a shape, the internal edges that are
32 //! not connected to any face in the shape. We can
33 //! get the list of the edges as a
34 //! DataMapOfShapeListOfShape with a Face of the Shape
35 //! as the key and a list of internal edges as the
36 //! value. The list of internal edges means edges
37 //! that are not connected to any face in the shape.
40 //! TopTools_DataMapOfShapeListOfShape mymap;
41 //! TopOpeBRepTool_PurgeInternalEdges
42 //! mypurgealgo(mysolid); mypurgealgo.GetFaces(mymap);
43 class TopOpeBRepTool_PurgeInternalEdges
50 //! Initialize members and begin exploration of shape
51 //! depending of the value of PerformNow
52 Standard_EXPORT TopOpeBRepTool_PurgeInternalEdges(const TopoDS_Shape& theShape, const Standard_Boolean PerformNow = Standard_True);
54 //! returns the list internal edges associated with
55 //! the faces of the myShape. If PerformNow was False
56 //! when created, then call the private Perform method
57 //! that do the main job.
58 Standard_EXPORT void Faces (TopTools_DataMapOfShapeListOfShape& theMapFacLstEdg);
60 //! returns myShape modified with the list of internal
61 //! edges removed from it.
62 Standard_EXPORT TopoDS_Shape& Shape();
64 //! returns the number of edges candidate to be removed
65 Standard_EXPORT Standard_Integer NbEdges() const;
67 //! returns False if the list of internal edges has
68 //! not been extracted
69 Standard_Boolean IsDone() const
74 //! Using the list of internal edge from each face,
75 //! rebuild myShape by removing thoses edges.
76 Standard_EXPORT void Perform();
80 TopTools_IndexedDataMapOfShapeListOfShape myMapEdgLstFac;
84 //! Do the main job. Explore all the edges of myShape and
85 //! build a map with faces as a key and list of internal
86 //! edges(without connected faces) as value.
87 Standard_EXPORT void BuildList();
92 Standard_Boolean myIsDone;
93 TopTools_DataMapOfShapeListOfShape myMapFacLstEdg;
96 #endif // _TopOpeBRepTool_PurgeInternalEdges_HeaderFile