42cf5bc1 |
1 | // Created on: 1995-09-18 |
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 _BRepOffsetAPI_MakeOffset_HeaderFile |
18 | #define _BRepOffsetAPI_MakeOffset_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Boolean.hxx> |
25 | #include <GeomAbs_JoinType.hxx> |
26 | #include <TopoDS_Face.hxx> |
27 | #include <TopTools_ListOfShape.hxx> |
28 | #include <BRepFill_ListOfOffsetWire.hxx> |
29 | #include <BRepBuilderAPI_MakeShape.hxx> |
30 | #include <Standard_Real.hxx> |
31 | class StdFail_NotDone; |
32 | class TopoDS_Face; |
33 | class TopoDS_Wire; |
34 | class TopoDS_Shape; |
35 | |
36 | |
37 | //! Describes algorithms for offsetting wires from a set of |
38 | //! wires contained in a planar face. |
39 | //! A MakeOffset object provides a framework for: |
40 | //! - defining the construction of an offset, |
41 | //! - implementing the construction algorithm, and |
42 | //! - consulting the result. |
43 | class BRepOffsetAPI_MakeOffset : public BRepBuilderAPI_MakeShape |
44 | { |
45 | public: |
46 | |
47 | DEFINE_STANDARD_ALLOC |
48 | |
49 | |
50 | //! Constructs an algorithm for creating an empty offset |
51 | Standard_EXPORT BRepOffsetAPI_MakeOffset(); |
52 | |
53 | //! Constructs an algorithm for creating an algorithm |
54 | //! to build parallels to the spine Spine |
55 | Standard_EXPORT BRepOffsetAPI_MakeOffset(const TopoDS_Face& Spine, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False); |
56 | |
57 | //! Initializes the algorithm to construct parallels to the spine Spine. |
58 | //! Join defines the type of parallel generated by the |
59 | //! salient vertices of the spine. |
60 | //! The default type is GeomAbs_Arc where the vertices generate |
61 | //! sections of a circle. |
62 | //! If join type is GeomAbs_Intersection, the edges that |
63 | //! intersect in a salient vertex generate the edges |
64 | //! prolonged until intersection. |
65 | Standard_EXPORT void Init (const TopoDS_Face& Spine, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False); |
66 | |
67 | Standard_EXPORT BRepOffsetAPI_MakeOffset(const TopoDS_Wire& Spine, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False); |
68 | |
69 | //! Initialize the evaluation of Offseting. |
70 | Standard_EXPORT void Init (const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False); |
71 | |
72 | //! Initializes the algorithm to construct parallels to the wire Spine. |
73 | Standard_EXPORT void AddWire (const TopoDS_Wire& Spine); |
74 | |
75 | //! Computes a parallel to the spine at distance Offset and |
76 | //! at an altitude Alt from the plane of the spine in relation |
77 | //! to the normal to the spine. |
78 | //! Exceptions: StdFail_NotDone if the offset is not built. |
79 | Standard_EXPORT void Perform (const Standard_Real Offset, const Standard_Real Alt = 0.0); |
80 | |
81 | //! Builds the resulting shape (redefined from MakeShape). |
82 | Standard_EXPORT virtual void Build() Standard_OVERRIDE; |
83 | |
84 | //! returns a list of the created shapes |
85 | //! from the shape <S>. |
86 | Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE; |
87 | |
88 | |
89 | |
90 | |
91 | protected: |
92 | |
93 | |
94 | |
95 | |
96 | |
97 | private: |
98 | |
99 | |
100 | |
101 | Standard_Boolean myIsInitialized; |
102 | Standard_Boolean myLastIsLeft; |
103 | GeomAbs_JoinType myJoin; |
104 | Standard_Boolean myIsOpenResult; |
105 | TopoDS_Face myFace; |
106 | TopTools_ListOfShape myWires; |
107 | BRepFill_ListOfOffsetWire myLeft; |
108 | BRepFill_ListOfOffsetWire myRight; |
109 | |
110 | |
111 | }; |
112 | |
113 | |
114 | |
115 | |
116 | |
117 | |
118 | |
119 | #endif // _BRepOffsetAPI_MakeOffset_HeaderFile |