b311480e |
1 | // Created on: 1994-02-18 |
2 | // Created by: Remi LEQUETTE |
3 | // Copyright (c) 1994-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <BRepBuilderAPI_MakeShell.hxx> |
19 | #include <Geom_Surface.hxx> |
20 | #include <StdFail_NotDone.hxx> |
21 | #include <TopoDS_Shell.hxx> |
7fd59977 |
22 | |
23 | //======================================================================= |
24 | //function : BRepBuilderAPI_MakeShell |
25 | //purpose : |
26 | //======================================================================= |
7fd59977 |
27 | BRepBuilderAPI_MakeShell::BRepBuilderAPI_MakeShell() |
28 | { |
29 | } |
30 | |
31 | |
32 | //======================================================================= |
33 | //function : BRepBuilderAPI_MakeShell |
34 | //purpose : |
35 | //======================================================================= |
36 | |
37 | BRepBuilderAPI_MakeShell::BRepBuilderAPI_MakeShell(const Handle(Geom_Surface)& S, |
38 | const Standard_Boolean Segment) |
39 | : myMakeShell(S,Segment) |
40 | { |
41 | if ( myMakeShell.IsDone()) { |
42 | Done(); |
43 | myShape = myMakeShell.Shape(); |
44 | } |
45 | } |
46 | |
47 | |
48 | //======================================================================= |
49 | //function : BRepBuilderAPI_MakeShell |
50 | //purpose : |
51 | //======================================================================= |
52 | |
53 | BRepBuilderAPI_MakeShell::BRepBuilderAPI_MakeShell(const Handle(Geom_Surface)& S, |
54 | const Standard_Real UMin, |
55 | const Standard_Real UMax, |
56 | const Standard_Real VMin, |
57 | const Standard_Real VMax, |
58 | const Standard_Boolean Segment) |
59 | : myMakeShell(S,UMin,UMax,VMin,VMax,Segment) |
60 | { |
61 | if ( myMakeShell.IsDone()) { |
62 | Done(); |
63 | myShape = myMakeShell.Shape(); |
64 | } |
65 | } |
66 | |
67 | |
68 | //======================================================================= |
69 | //function : Init |
70 | //purpose : |
71 | //======================================================================= |
72 | |
73 | void BRepBuilderAPI_MakeShell::Init(const Handle(Geom_Surface)& S, |
74 | const Standard_Real UMin, |
75 | const Standard_Real UMax, |
76 | const Standard_Real VMin, |
77 | const Standard_Real VMax, |
78 | const Standard_Boolean Segment) |
79 | { |
80 | myMakeShell.Init(S,UMin,UMax,VMin,VMax,Segment); |
81 | if ( myMakeShell.IsDone()) { |
82 | Done(); |
83 | myShape = myMakeShell.Shape(); |
84 | } |
85 | } |
86 | |
87 | //======================================================================= |
88 | //function : IsDone |
89 | //purpose : |
90 | //======================================================================= |
91 | |
92 | Standard_Boolean BRepBuilderAPI_MakeShell::IsDone() const |
93 | { |
94 | return myMakeShell.IsDone(); |
95 | } |
96 | |
97 | |
98 | |
99 | //======================================================================= |
100 | //function : Error |
101 | //purpose : |
102 | //======================================================================= |
103 | |
104 | BRepBuilderAPI_ShellError BRepBuilderAPI_MakeShell::Error() const |
105 | { |
106 | switch ( myMakeShell.Error()) { |
107 | |
108 | case BRepLib_ShellDone: |
109 | return BRepBuilderAPI_ShellDone; |
110 | |
111 | case BRepLib_EmptyShell: |
112 | return BRepBuilderAPI_EmptyShell; |
113 | |
114 | case BRepLib_DisconnectedShell: |
115 | return BRepBuilderAPI_DisconnectedShell; |
116 | |
117 | case BRepLib_ShellParametersOutOfRange: |
118 | return BRepBuilderAPI_ShellParametersOutOfRange; |
119 | |
120 | } |
121 | |
122 | // portage WNT |
123 | return BRepBuilderAPI_ShellDone; |
124 | } |
125 | |
126 | |
127 | //======================================================================= |
128 | //function : TopoDS_Shell& |
129 | //purpose : |
130 | //======================================================================= |
131 | |
132 | const TopoDS_Shell& BRepBuilderAPI_MakeShell::Shell() const |
133 | { |
134 | return myMakeShell.Shell(); |
135 | } |
136 | |
137 | |
138 | |
139 | //======================================================================= |
140 | //function : TopoDS_Shell |
141 | //purpose : |
142 | //======================================================================= |
143 | |
144 | BRepBuilderAPI_MakeShell::operator TopoDS_Shell() const |
145 | { |
146 | return Shell(); |
147 | } |
148 | |
149 | |