973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
7fd59977 |
14 | #include <BRepOffsetAPI_MakeDraft.ixx> |
15 | |
16 | |
17 | BRepOffsetAPI_MakeDraft::BRepOffsetAPI_MakeDraft(const TopoDS_Shape& Shape, |
18 | const gp_Dir& Dir, |
19 | const Standard_Real Angle) |
20 | : myDraft( Shape, Dir, Angle) |
21 | { |
22 | NotDone(); |
23 | } |
24 | |
25 | void BRepOffsetAPI_MakeDraft::SetOptions(const BRepBuilderAPI_TransitionMode Style, |
26 | const Standard_Real AngleMin, |
27 | const Standard_Real AngleMax) |
28 | { |
29 | BRepFill_TransitionStyle style = BRepFill_Right; |
30 | if (Style == BRepBuilderAPI_RoundCorner) style = BRepFill_Round; |
31 | myDraft.SetOptions( style, AngleMin, AngleMax); |
32 | } |
33 | |
34 | void BRepOffsetAPI_MakeDraft::SetDraft(const Standard_Boolean IsInternal) |
35 | { |
36 | myDraft.SetDraft(IsInternal); |
37 | } |
38 | |
39 | void BRepOffsetAPI_MakeDraft::Perform(const Standard_Real LengthMax) |
40 | { |
41 | myDraft.Perform( LengthMax); |
42 | if (myDraft.IsDone()) { |
43 | Done(); |
44 | myShape = myDraft.Shape(); |
45 | } |
46 | } |
47 | |
48 | void BRepOffsetAPI_MakeDraft::Perform(const Handle(Geom_Surface)& Surface, |
49 | const Standard_Boolean KeepInsideSurface) |
50 | { |
51 | myDraft.Perform(Surface, KeepInsideSurface); |
52 | if (myDraft.IsDone()) { |
53 | Done(); |
54 | myShape = myDraft.Shape(); |
55 | } |
56 | } |
57 | |
58 | void BRepOffsetAPI_MakeDraft::Perform(const TopoDS_Shape& StopShape, |
59 | const Standard_Boolean KeepOutSide) |
60 | { |
61 | myDraft.Perform( StopShape, KeepOutSide); |
62 | if (myDraft.IsDone()) { |
63 | Done(); |
64 | myShape = myDraft.Shape(); |
65 | } |
66 | } |
67 | |
68 | TopoDS_Shell BRepOffsetAPI_MakeDraft::Shell() const |
69 | { |
70 | return myDraft.Shell(); |
71 | } |
72 | |
73 | const TopTools_ListOfShape& BRepOffsetAPI_MakeDraft::Generated(const TopoDS_Shape& S) |
74 | { |
75 | return myDraft.Generated( S ); |
76 | } |
77 | |