b311480e |
1 | // Created on: 1993-07-23 |
2 | // Created by: Remi LEQUETTE |
3 | // Copyright (c) 1993-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 | // |
973c2be1 |
8 | // This library is free software; you can redistribute it and / or modify it |
9 | // under the terms of the GNU Lesser General Public 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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | #include <BRepBuilderAPI_MakeWire.ixx> |
18 | |
19 | |
20 | //======================================================================= |
21 | //function : BRepBuilderAPI_MakeWire |
22 | //purpose : |
23 | //======================================================================= |
24 | |
25 | BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire() |
26 | { |
27 | } |
28 | |
29 | |
30 | //======================================================================= |
31 | //function : BRepBuilderAPI_MakeWire |
32 | //purpose : |
33 | //======================================================================= |
34 | |
35 | BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E) |
36 | : myMakeWire(E) |
37 | { |
38 | if ( myMakeWire.IsDone()) { |
39 | Done(); |
40 | myShape = myMakeWire.Wire(); |
41 | } |
42 | } |
43 | |
44 | |
45 | //======================================================================= |
46 | //function : BRepBuilderAPI_MakeWire |
47 | //purpose : |
48 | //======================================================================= |
49 | |
50 | BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1, |
51 | const TopoDS_Edge& E2) |
52 | : myMakeWire(E1,E2) |
53 | { |
54 | if ( myMakeWire.IsDone()) { |
55 | Done(); |
56 | myShape = myMakeWire.Wire(); |
57 | } |
58 | } |
59 | |
60 | |
61 | //======================================================================= |
62 | //function : BRepBuilderAPI_MakeWire |
63 | //purpose : |
64 | //======================================================================= |
65 | |
66 | BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1, |
67 | const TopoDS_Edge& E2, |
68 | const TopoDS_Edge& E3) |
69 | : myMakeWire(E1,E2,E3) |
70 | { |
71 | if ( myMakeWire.IsDone()) { |
72 | Done(); |
73 | myShape = myMakeWire.Wire(); |
74 | } |
75 | } |
76 | |
77 | |
78 | //======================================================================= |
79 | //function : BRepBuilderAPI_MakeWire |
80 | //purpose : |
81 | //======================================================================= |
82 | |
83 | BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1, |
84 | const TopoDS_Edge& E2, |
85 | const TopoDS_Edge& E3, |
86 | const TopoDS_Edge& E4) |
87 | : myMakeWire(E1,E2,E3,E4) |
88 | { |
89 | if ( myMakeWire.IsDone()) { |
90 | Done(); |
91 | myShape = myMakeWire.Wire(); |
92 | } |
93 | } |
94 | |
95 | |
96 | //======================================================================= |
97 | //function : BRepBuilderAPI_MakeWire |
98 | //purpose : |
99 | //======================================================================= |
100 | |
101 | BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Wire& W) |
102 | : myMakeWire(W) |
103 | { |
104 | if ( myMakeWire.IsDone()) { |
105 | Done(); |
106 | myShape = myMakeWire.Wire(); |
107 | } |
108 | } |
109 | |
110 | |
111 | //======================================================================= |
112 | //function : BRepBuilderAPI_MakeWire |
113 | //purpose : |
114 | //======================================================================= |
115 | |
116 | BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Wire& W, |
117 | const TopoDS_Edge& E) |
118 | : myMakeWire(W,E) |
119 | { |
120 | if ( myMakeWire.IsDone()) { |
121 | Done(); |
122 | myShape = myMakeWire.Wire(); |
123 | } |
124 | } |
125 | |
126 | |
127 | //======================================================================= |
128 | //function : Add |
129 | //purpose : |
130 | //======================================================================= |
131 | |
132 | void BRepBuilderAPI_MakeWire::Add(const TopoDS_Wire& W) |
133 | { |
134 | myMakeWire.Add(W); |
135 | if ( myMakeWire.IsDone()) { |
136 | Done(); |
137 | myShape = myMakeWire.Wire(); |
138 | } |
139 | } |
140 | |
141 | //======================================================================= |
142 | //function : Add |
143 | //purpose : |
144 | //======================================================================= |
145 | |
146 | void BRepBuilderAPI_MakeWire::Add(const TopoDS_Edge& E) |
147 | { |
148 | myMakeWire.Add(E); |
149 | if ( myMakeWire.IsDone()) { |
150 | Done(); |
151 | myShape = myMakeWire.Wire(); |
152 | } |
153 | } |
154 | |
155 | //======================================================================= |
156 | //function : Add |
157 | //purpose : |
158 | //======================================================================= |
159 | |
160 | void BRepBuilderAPI_MakeWire::Add(const TopTools_ListOfShape& L) |
161 | { |
162 | myMakeWire.Add(L); |
163 | if ( myMakeWire.IsDone()) { |
164 | Done(); |
165 | myShape = myMakeWire.Wire(); |
166 | } |
167 | } |
168 | |
169 | |
170 | //======================================================================= |
171 | //function : Wire |
172 | //purpose : |
173 | //======================================================================= |
174 | |
175 | const TopoDS_Wire& BRepBuilderAPI_MakeWire::Wire()const |
176 | { |
177 | return myMakeWire.Wire(); |
178 | } |
179 | |
180 | |
181 | //======================================================================= |
182 | //function : Edge |
183 | //purpose : |
184 | //======================================================================= |
185 | |
186 | const TopoDS_Edge& BRepBuilderAPI_MakeWire::Edge()const |
187 | { |
188 | return myMakeWire.Edge(); |
189 | } |
190 | |
191 | |
192 | //======================================================================= |
193 | //function : Vertex |
194 | //purpose : |
195 | //======================================================================= |
196 | |
197 | const TopoDS_Vertex& BRepBuilderAPI_MakeWire::Vertex()const |
198 | { |
199 | return myMakeWire.Vertex(); |
200 | } |
201 | |
202 | |
203 | //======================================================================= |
204 | //function : operator |
205 | //purpose : |
206 | //======================================================================= |
207 | |
208 | BRepBuilderAPI_MakeWire::operator TopoDS_Wire() const |
209 | { |
210 | return Wire(); |
211 | } |
212 | |
213 | |
214 | //======================================================================= |
215 | //function : IsDone |
216 | //purpose : |
217 | //======================================================================= |
218 | |
219 | Standard_Boolean BRepBuilderAPI_MakeWire::IsDone() const |
220 | { |
221 | return myMakeWire.IsDone(); |
222 | } |
223 | |
224 | |
225 | |
226 | //======================================================================= |
227 | //function : Error |
228 | //purpose : |
229 | //======================================================================= |
230 | |
231 | BRepBuilderAPI_WireError BRepBuilderAPI_MakeWire::Error() const |
232 | { |
233 | switch ( myMakeWire.Error()) { |
234 | |
235 | case BRepLib_WireDone: |
236 | return BRepBuilderAPI_WireDone; |
237 | |
238 | case BRepLib_EmptyWire: |
239 | return BRepBuilderAPI_EmptyWire; |
240 | |
241 | case BRepLib_DisconnectedWire: |
242 | return BRepBuilderAPI_DisconnectedWire; |
243 | |
244 | case BRepLib_NonManifoldWire: |
245 | return BRepBuilderAPI_NonManifoldWire; |
246 | } |
247 | |
248 | // portage WNT |
249 | return BRepBuilderAPI_WireDone; |
250 | } |