b050ef62aab6466200ae10ace75ee5fac3ad44ed
[occt.git] / src / BRepOffset / BRepOffset_Analyse.hxx
1 // Created on: 1995-10-20
2 // Created by: Yves FRICAUD
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 _BRepOffset_Analyse_HeaderFile
18 #define _BRepOffset_Analyse_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Boolean.hxx>
25 #include <TopoDS_Shape.hxx>
26 #include <BRepOffset_DataMapOfShapeListOfInterval.hxx>
27 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
28 #include <Standard_Real.hxx>
29 #include <BRepOffset_ListOfInterval.hxx>
30 #include <BRepOffset_Type.hxx>
31 #include <TopTools_ListOfShape.hxx>
32 #include <TopTools_MapOfShape.hxx>
33 class TopoDS_Shape;
34 class TopoDS_Edge;
35 class TopoDS_Vertex;
36 class TopoDS_Face;
37 class TopoDS_Compound;
38
39
40 //! Analyse of a shape consit to
41 //! Find the part of edges convex concave tangent.
42 class BRepOffset_Analyse 
43 {
44 public:
45
46   DEFINE_STANDARD_ALLOC
47
48   
49   Standard_EXPORT BRepOffset_Analyse();
50   
51   Standard_EXPORT BRepOffset_Analyse(const TopoDS_Shape& S, const Standard_Real Angle);
52   
53   Standard_EXPORT void Perform (const TopoDS_Shape& S, const Standard_Real Angle);
54   
55   Standard_EXPORT Standard_Boolean IsDone() const;
56   
57   Standard_EXPORT void Clear();
58   
59   Standard_EXPORT const BRepOffset_ListOfInterval& Type (const TopoDS_Edge& E) const;
60   
61   //! Stores in <L> all the edges of Type <T>
62   //! on the vertex <V>.
63   Standard_EXPORT void Edges (const TopoDS_Vertex& V, const BRepOffset_Type T, TopTools_ListOfShape& L) const;
64   
65   //! Stores in <L> all the edges of Type <T>
66   //! on the face <F>.
67   Standard_EXPORT void Edges (const TopoDS_Face& F, const BRepOffset_Type T, TopTools_ListOfShape& L) const;
68   
69   //! set in <Edges> all  the Edges of <Shape> which are
70   //! tangent to <Edge> at the vertex <Vertex>.
71   Standard_EXPORT void TangentEdges (const TopoDS_Edge& Edge, const TopoDS_Vertex& Vertex, TopTools_ListOfShape& Edges) const;
72   
73   Standard_EXPORT Standard_Boolean HasAncestor (const TopoDS_Shape& S) const;
74   
75   Standard_EXPORT const TopTools_ListOfShape& Ancestors (const TopoDS_Shape& S) const;
76   
77   //! Explode in compounds of faces where
78   //! all the connex edges are of type <Side>
79   Standard_EXPORT void Explode (TopTools_ListOfShape& L, const BRepOffset_Type Type) const;
80   
81   //! Explode in compounds of faces where
82   //! all the connex edges are of type <Side1> or <Side2>
83   Standard_EXPORT void Explode (TopTools_ListOfShape& L, const BRepOffset_Type Type1, const BRepOffset_Type Type2) const;
84   
85   //! Add in <CO> the faces of the shell containing <Face>
86   //! where all the connex edges are of type <Side>.
87   Standard_EXPORT void AddFaces (const TopoDS_Face& Face, TopoDS_Compound& Co, TopTools_MapOfShape& Map, const BRepOffset_Type Type) const;
88   
89   //! Add in <CO> the faces of the shell containing <Face>
90   //! where all the connex edges are of type <Side1> or <Side2>.
91   Standard_EXPORT void AddFaces (const TopoDS_Face& Face, TopoDS_Compound& Co, TopTools_MapOfShape& Map, const BRepOffset_Type Type1, const BRepOffset_Type Type2) const;
92
93
94
95
96 protected:
97
98
99
100
101
102 private:
103
104
105
106   Standard_Boolean myDone;
107   TopoDS_Shape myShape;
108   BRepOffset_DataMapOfShapeListOfInterval mapEdgeType;
109   TopTools_IndexedDataMapOfShapeListOfShape ancestors;
110   Standard_Real angle;
111
112
113 };
114
115
116
117
118
119
120
121 #endif // _BRepOffset_Analyse_HeaderFile