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 | |
42cf5bc1 |
15 | #include <BRepOffsetAPI_MakeDraft.hxx> |
16 | #include <Geom_Surface.hxx> |
17 | #include <gp_Dir.hxx> |
18 | #include <Standard_NoSuchObject.hxx> |
19 | #include <StdFail_NotDone.hxx> |
20 | #include <TopoDS_Shape.hxx> |
21 | #include <TopoDS_Shell.hxx> |
7fd59977 |
22 | |
23 | BRepOffsetAPI_MakeDraft::BRepOffsetAPI_MakeDraft(const TopoDS_Shape& Shape, |
24 | const gp_Dir& Dir, |
25 | const Standard_Real Angle) |
26 | : myDraft( Shape, Dir, Angle) |
27 | { |
28 | NotDone(); |
29 | } |
30 | |
31 | void BRepOffsetAPI_MakeDraft::SetOptions(const BRepBuilderAPI_TransitionMode Style, |
32 | const Standard_Real AngleMin, |
33 | const Standard_Real AngleMax) |
34 | { |
35 | BRepFill_TransitionStyle style = BRepFill_Right; |
36 | if (Style == BRepBuilderAPI_RoundCorner) style = BRepFill_Round; |
37 | myDraft.SetOptions( style, AngleMin, AngleMax); |
38 | } |
39 | |
40 | void BRepOffsetAPI_MakeDraft::SetDraft(const Standard_Boolean IsInternal) |
41 | { |
42 | myDraft.SetDraft(IsInternal); |
43 | } |
44 | |
45 | void BRepOffsetAPI_MakeDraft::Perform(const Standard_Real LengthMax) |
46 | { |
47 | myDraft.Perform( LengthMax); |
48 | if (myDraft.IsDone()) { |
49 | Done(); |
50 | myShape = myDraft.Shape(); |
51 | } |
52 | } |
53 | |
54 | void BRepOffsetAPI_MakeDraft::Perform(const Handle(Geom_Surface)& Surface, |
55 | const Standard_Boolean KeepInsideSurface) |
56 | { |
57 | myDraft.Perform(Surface, KeepInsideSurface); |
58 | if (myDraft.IsDone()) { |
59 | Done(); |
60 | myShape = myDraft.Shape(); |
61 | } |
62 | } |
63 | |
64 | void BRepOffsetAPI_MakeDraft::Perform(const TopoDS_Shape& StopShape, |
65 | const Standard_Boolean KeepOutSide) |
66 | { |
67 | myDraft.Perform( StopShape, KeepOutSide); |
68 | if (myDraft.IsDone()) { |
69 | Done(); |
70 | myShape = myDraft.Shape(); |
71 | } |
72 | } |
73 | |
74 | TopoDS_Shell BRepOffsetAPI_MakeDraft::Shell() const |
75 | { |
76 | return myDraft.Shell(); |
77 | } |
78 | |
79 | const TopTools_ListOfShape& BRepOffsetAPI_MakeDraft::Generated(const TopoDS_Shape& S) |
80 | { |
81 | return myDraft.Generated( S ); |
82 | } |
83 | |