0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / LocOpe / LocOpe_SplitShape.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _LocOpe_SplitShape_HeaderFile
18 #define _LocOpe_SplitShape_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22
23 #include <TopoDS_Shape.hxx>
24 #include <TopTools_DataMapOfShapeListOfShape.hxx>
25 #include <TopTools_MapOfShape.hxx>
26 #include <TopTools_ListOfShape.hxx>
27 class TopoDS_Edge;
28 class TopoDS_Vertex;
29 class TopoDS_Wire;
30 class TopoDS_Face;
31
32
33 //! Provides a tool to cut  :
34 //! - edges with a vertices,
35 //! - faces with wires,
36 //! and  rebuilds  the shape containing the edges and
37 //! the faces.
38 class LocOpe_SplitShape 
39 {
40 public:
41
42   DEFINE_STANDARD_ALLOC
43
44   
45   //! Empty constructor.
46     LocOpe_SplitShape();
47   
48   //! Creates the process  with the shape <S>.
49     LocOpe_SplitShape(const TopoDS_Shape& S);
50   
51   //! Initializes the process on the shape <S>.
52   Standard_EXPORT void Init (const TopoDS_Shape& S);
53   
54   //! Tests if it is possible to split the edge <E>.
55   Standard_EXPORT Standard_Boolean CanSplit (const TopoDS_Edge& E) const;
56   
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);
59   
60   //! Adds the wire <W> on the face <F>.
61   Standard_EXPORT Standard_Boolean Add (const TopoDS_Wire& W, const TopoDS_Face& F);
62   
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);
65   
66   //! Returns the "original" shape.
67     const TopoDS_Shape& Shape() const;
68   
69   //! Returns the list of descendant shapes of <S>.
70   Standard_EXPORT const TopTools_ListOfShape& DescendantShapes (const TopoDS_Shape& S);
71   
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);
78
79
80
81
82 protected:
83
84
85
86
87
88 private:
89
90   
91   Standard_EXPORT Standard_Boolean AddOpenWire (const TopoDS_Wire& W, const TopoDS_Face& F);
92   
93   Standard_EXPORT Standard_Boolean AddClosedWire (const TopoDS_Wire& W, const TopoDS_Face& F);
94   
95   Standard_EXPORT void Put (const TopoDS_Shape& S);
96   
97   Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S);
98
99
100   Standard_Boolean myDone;
101   TopoDS_Shape myShape;
102   TopTools_DataMapOfShapeListOfShape myMap;
103   TopTools_MapOfShape myDblE;
104   TopTools_ListOfShape myLeft;
105
106
107 };
108
109
110 #include <LocOpe_SplitShape.lxx>
111
112
113
114
115
116 #endif // _LocOpe_SplitShape_HeaderFile