a207521653712112fcb079cf19992d733f8620de
[occt.git] / src / BRepOffset / BRepOffset_Offset.hxx
1 // Created on: 1995-10-19
2 // Created by: Bruno DUMORTIER
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_Offset_HeaderFile
18 #define _BRepOffset_Offset_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <TopoDS_Shape.hxx>
25 #include <BRepOffset_Status.hxx>
26 #include <TopoDS_Face.hxx>
27 #include <TopTools_DataMapOfShapeShape.hxx>
28 #include <Standard_Real.hxx>
29 #include <Standard_Boolean.hxx>
30 #include <GeomAbs_JoinType.hxx>
31 #include <GeomAbs_Shape.hxx>
32 #include <TopTools_ListOfShape.hxx>
33 class TopoDS_Face;
34 class TopoDS_Edge;
35 class TopoDS_Vertex;
36 class TopoDS_Shape;
37
38
39 //! This class compute elemenary offset surface.
40 //! Evaluate the offset generated :
41 //! 1 - from a face.
42 //! 2 - from an edge.
43 //! 3 - from a vertex.
44 class BRepOffset_Offset 
45 {
46 public:
47
48   DEFINE_STANDARD_ALLOC
49
50   
51   Standard_EXPORT BRepOffset_Offset();
52   
53   Standard_EXPORT BRepOffset_Offset(const TopoDS_Face& Face, const Standard_Real Offset, const Standard_Boolean OffsetOutside = Standard_True, const GeomAbs_JoinType JoinType = GeomAbs_Arc);
54   
55   //! This method will be  called when you want to share
56   //! the  edges  soon generated  from  an other  face.
57   //! e.g. when two faces are  tangents the common  edge
58   //! will generate only one edge ( no pipe).
59   //!
60   //! The Map  will be fill  as  follow:
61   //!
62   //! Created(E) = E'
63   //! with: E  = an edge of <Face>
64   //! E' = the image of E in the offseting  of
65   //! another  face  sharing E  with a
66   //! continuity at least G1
67   Standard_EXPORT BRepOffset_Offset(const TopoDS_Face& Face, const Standard_Real Offset, const TopTools_DataMapOfShapeShape& Created, const Standard_Boolean OffsetOutside = Standard_True, const GeomAbs_JoinType JoinType = GeomAbs_Arc);
68   
69   Standard_EXPORT BRepOffset_Offset(const TopoDS_Edge& Path, const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2, const Standard_Real Offset, const Standard_Boolean Polynomial = Standard_False, const Standard_Real Tol = 1.0e-4, const GeomAbs_Shape Conti = GeomAbs_C1);
70   
71   Standard_EXPORT BRepOffset_Offset(const TopoDS_Edge& Path, const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2, const Standard_Real Offset, const TopoDS_Edge& FirstEdge, const TopoDS_Edge& LastEdge, const Standard_Boolean Polynomial = Standard_False, const Standard_Real Tol = 1.0e-4, const GeomAbs_Shape Conti = GeomAbs_C1);
72   
73   //! Tol and Conti are only used if Polynomial is True
74   //! (Used to perfrom the approximation)
75   Standard_EXPORT BRepOffset_Offset(const TopoDS_Vertex& Vertex, const TopTools_ListOfShape& LEdge, const Standard_Real Offset, const Standard_Boolean Polynomial = Standard_False, const Standard_Real Tol = 1.0e-4, const GeomAbs_Shape Conti = GeomAbs_C1);
76   
77   Standard_EXPORT void Init (const TopoDS_Face& Face, const Standard_Real Offset, const Standard_Boolean OffsetOutside = Standard_True, const GeomAbs_JoinType JoinType = GeomAbs_Arc);
78   
79   Standard_EXPORT void Init (const TopoDS_Face& Face, const Standard_Real Offset, const TopTools_DataMapOfShapeShape& Created, const Standard_Boolean OffsetOutside = Standard_True, const GeomAbs_JoinType JoinType = GeomAbs_Arc);
80   
81   Standard_EXPORT void Init (const TopoDS_Edge& Path, const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2, const Standard_Real Offset, const Standard_Boolean Polynomial = Standard_False, const Standard_Real Tol = 1.0e-4, const GeomAbs_Shape Conti = GeomAbs_C1);
82   
83   Standard_EXPORT void Init (const TopoDS_Edge& Path, const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2, const Standard_Real Offset, const TopoDS_Edge& FirstEdge, const TopoDS_Edge& LastEdge, const Standard_Boolean Polynomial = Standard_False, const Standard_Real Tol = 1.0e-4, const GeomAbs_Shape Conti = GeomAbs_C1);
84   
85   //! Tol and Conti are only used if Polynomial is True
86   //! (Used to perfrom the approximation)
87   Standard_EXPORT void Init (const TopoDS_Vertex& Vertex, const TopTools_ListOfShape& LEdge, const Standard_Real Offset, const Standard_Boolean Polynomial = Standard_False, const Standard_Real Tol = 1.0e-4, const GeomAbs_Shape Conti = GeomAbs_C1);
88   
89   //! Only used in Rolling Ball. Pipe on Free Boundary
90   Standard_EXPORT void Init (const TopoDS_Edge& Edge, const Standard_Real Offset);
91   
92     const TopoDS_Shape& InitialShape() const;
93   
94   Standard_EXPORT const TopoDS_Face& Face() const;
95   
96   Standard_EXPORT TopoDS_Shape Generated (const TopoDS_Shape& Shape) const;
97   
98   Standard_EXPORT BRepOffset_Status Status() const;
99
100
101
102
103 protected:
104
105
106
107
108
109 private:
110
111
112
113   TopoDS_Shape myShape;
114   BRepOffset_Status myStatus;
115   TopoDS_Face myFace;
116   TopTools_DataMapOfShapeShape myMap;
117
118
119 };
120
121
122 #include <BRepOffset_Offset.lxx>
123
124
125
126
127
128 #endif // _BRepOffset_Offset_HeaderFile