1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <BRepOffsetAPI_MakeDraft.hxx>
16 #include <Geom_Surface.hxx>
18 #include <Standard_NoSuchObject.hxx>
19 #include <StdFail_NotDone.hxx>
20 #include <TopoDS_Shape.hxx>
21 #include <TopoDS_Shell.hxx>
23 BRepOffsetAPI_MakeDraft::BRepOffsetAPI_MakeDraft(const TopoDS_Shape& Shape,
25 const Standard_Real Angle)
26 : myDraft( Shape, Dir, Angle)
31 void BRepOffsetAPI_MakeDraft::SetOptions(const BRepBuilderAPI_TransitionMode Style,
32 const Standard_Real AngleMin,
33 const Standard_Real AngleMax)
35 BRepFill_TransitionStyle style = BRepFill_Right;
36 if (Style == BRepBuilderAPI_RoundCorner) style = BRepFill_Round;
37 myDraft.SetOptions( style, AngleMin, AngleMax);
40 void BRepOffsetAPI_MakeDraft::SetDraft(const Standard_Boolean IsInternal)
42 myDraft.SetDraft(IsInternal);
45 void BRepOffsetAPI_MakeDraft::Perform(const Standard_Real LengthMax)
47 myDraft.Perform( LengthMax);
48 if (myDraft.IsDone()) {
50 myShape = myDraft.Shape();
54 void BRepOffsetAPI_MakeDraft::Perform(const Handle(Geom_Surface)& Surface,
55 const Standard_Boolean KeepInsideSurface)
57 myDraft.Perform(Surface, KeepInsideSurface);
58 if (myDraft.IsDone()) {
60 myShape = myDraft.Shape();
64 void BRepOffsetAPI_MakeDraft::Perform(const TopoDS_Shape& StopShape,
65 const Standard_Boolean KeepOutSide)
67 myDraft.Perform( StopShape, KeepOutSide);
68 if (myDraft.IsDone()) {
70 myShape = myDraft.Shape();
74 TopoDS_Shell BRepOffsetAPI_MakeDraft::Shell() const
76 return myDraft.Shell();
79 const TopTools_ListOfShape& BRepOffsetAPI_MakeDraft::Generated(const TopoDS_Shape& S)
81 return myDraft.Generated( S );