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>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <TopoDS_Shape.hxx>
26 #include <TopTools_DataMapOfShapeListOfShape.hxx>
27 #include <TopTools_MapOfShape.hxx>
28 #include <TopTools_ListOfShape.hxx>
29 #include <Standard_Real.hxx>
30 class StdFail_NotDone;
31 class Standard_ConstructionError;
32 class Standard_NoSuchObject;
40 //! Provides a tool to cut :
41 //! - edges with a vertices,
42 //! - faces with wires,
43 //! and rebuilds the shape containing the edges and
45 class LocOpe_SplitShape
52 //! Empty constructor.
55 //! Creates the process with the shape <S>.
56 LocOpe_SplitShape(const TopoDS_Shape& S);
58 //! Initializes the process on the shape <S>.
59 Standard_EXPORT void Init (const TopoDS_Shape& S);
61 //! Tests if it is possible to split the edge <E>.
62 Standard_EXPORT Standard_Boolean CanSplit (const TopoDS_Edge& E) const;
64 //! Adds the vertex <V> on the edge <E>, at parameter <P>.
65 Standard_EXPORT void Add (const TopoDS_Vertex& V, const Standard_Real P, const TopoDS_Edge& E);
67 //! Adds the wire <W> on the face <F>.
68 Standard_EXPORT Standard_Boolean Add (const TopoDS_Wire& W, const TopoDS_Face& F);
70 //! Adds the list of wires <Lwires> on the face <F>.
71 Standard_EXPORT Standard_Boolean Add (const TopTools_ListOfShape& Lwires, const TopoDS_Face& F);
73 //! Returns the "original" shape.
74 const TopoDS_Shape& Shape() const;
76 //! Returns the list of descendant shapes of <S>.
77 Standard_EXPORT const TopTools_ListOfShape& DescendantShapes (const TopoDS_Shape& S);
79 //! Returns the "left" part defined by the wire <W> on
80 //! the face <F>. The returned list of shape is in
81 //! fact a list of faces. The face <F> is considered
82 //! with its topological orientation in the original
83 //! shape. <W> is considered with its orientation.
84 Standard_EXPORT const TopTools_ListOfShape& LeftOf (const TopoDS_Wire& W, const TopoDS_Face& F);
98 Standard_EXPORT Standard_Boolean AddOpenWire (const TopoDS_Wire& W, const TopoDS_Face& F);
100 Standard_EXPORT Standard_Boolean AddClosedWire (const TopoDS_Wire& W, const TopoDS_Face& F);
102 Standard_EXPORT void Put (const TopoDS_Shape& S);
104 Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S);
107 Standard_Boolean myDone;
108 TopoDS_Shape myShape;
109 TopTools_DataMapOfShapeListOfShape myMap;
110 TopTools_MapOfShape myDblE;
111 TopTools_ListOfShape myLeft;
117 #include <LocOpe_SplitShape.lxx>
123 #endif // _LocOpe_SplitShape_HeaderFile