1 // Created on: 1995-07-11
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1995-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 _LocOpe_SplitShape_HeaderFile
18 #define _LocOpe_SplitShape_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
23 #include <TopoDS_Shape.hxx>
24 #include <TopTools_DataMapOfShapeListOfShape.hxx>
25 #include <TopTools_MapOfShape.hxx>
26 #include <TopTools_ListOfShape.hxx>
33 //! Provides a tool to cut :
34 //! - edges with a vertices,
35 //! - faces with wires,
36 //! and rebuilds the shape containing the edges and
38 class LocOpe_SplitShape
45 //! Empty constructor.
48 //! Creates the process with the shape <S>.
49 LocOpe_SplitShape(const TopoDS_Shape& S);
51 //! Initializes the process on the shape <S>.
52 Standard_EXPORT void Init (const TopoDS_Shape& S);
54 //! Tests if it is possible to split the edge <E>.
55 Standard_EXPORT Standard_Boolean CanSplit (const TopoDS_Edge& E) const;
57 //! Adds the vertex <V> on the edge <E>, at parameter <P>.
58 Standard_EXPORT void Add (const TopoDS_Vertex& V, const Standard_Real P, const TopoDS_Edge& E);
60 //! Adds the wire <W> on the face <F>.
61 Standard_EXPORT Standard_Boolean Add (const TopoDS_Wire& W, const TopoDS_Face& F);
63 //! Adds the list of wires <Lwires> on the face <F>.
64 Standard_EXPORT Standard_Boolean Add (const TopTools_ListOfShape& Lwires, const TopoDS_Face& F);
66 //! Returns the "original" shape.
67 const TopoDS_Shape& Shape() const;
69 //! Returns the list of descendant shapes of <S>.
70 Standard_EXPORT const TopTools_ListOfShape& DescendantShapes (const TopoDS_Shape& S);
72 //! Returns the "left" part defined by the wire <W> on
73 //! the face <F>. The returned list of shape is in
74 //! fact a list of faces. The face <F> is considered
75 //! with its topological orientation in the original
76 //! shape. <W> is considered with its orientation.
77 Standard_EXPORT const TopTools_ListOfShape& LeftOf (const TopoDS_Wire& W, const TopoDS_Face& F);
91 Standard_EXPORT Standard_Boolean AddOpenWire (const TopoDS_Wire& W, const TopoDS_Face& F);
93 Standard_EXPORT Standard_Boolean AddClosedWire (const TopoDS_Wire& W, const TopoDS_Face& F);
95 Standard_EXPORT void Put (const TopoDS_Shape& S);
97 Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S);
100 Standard_Boolean myDone;
101 TopoDS_Shape myShape;
102 TopTools_DataMapOfShapeListOfShape myMap;
103 TopTools_MapOfShape myDblE;
104 TopTools_ListOfShape myLeft;
110 #include <LocOpe_SplitShape.lxx>
116 #endif // _LocOpe_SplitShape_HeaderFile