0023024: Update headers of OCCT files
[occt.git] / src / BRepBuilderAPI / BRepBuilderAPI_MakeWire.cxx
CommitLineData
b311480e 1// Created on: 1993-07-23
2// Created by: Remi LEQUETTE
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
22
23#include <BRepBuilderAPI_MakeWire.ixx>
24
25
26//=======================================================================
27//function : BRepBuilderAPI_MakeWire
28//purpose :
29//=======================================================================
30
31BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire()
32{
33}
34
35
36//=======================================================================
37//function : BRepBuilderAPI_MakeWire
38//purpose :
39//=======================================================================
40
41BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E)
42: myMakeWire(E)
43{
44 if ( myMakeWire.IsDone()) {
45 Done();
46 myShape = myMakeWire.Wire();
47 }
48}
49
50
51//=======================================================================
52//function : BRepBuilderAPI_MakeWire
53//purpose :
54//=======================================================================
55
56BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,
57 const TopoDS_Edge& E2)
58: myMakeWire(E1,E2)
59{
60 if ( myMakeWire.IsDone()) {
61 Done();
62 myShape = myMakeWire.Wire();
63 }
64}
65
66
67//=======================================================================
68//function : BRepBuilderAPI_MakeWire
69//purpose :
70//=======================================================================
71
72BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,
73 const TopoDS_Edge& E2,
74 const TopoDS_Edge& E3)
75: myMakeWire(E1,E2,E3)
76{
77 if ( myMakeWire.IsDone()) {
78 Done();
79 myShape = myMakeWire.Wire();
80 }
81}
82
83
84//=======================================================================
85//function : BRepBuilderAPI_MakeWire
86//purpose :
87//=======================================================================
88
89BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,
90 const TopoDS_Edge& E2,
91 const TopoDS_Edge& E3,
92 const TopoDS_Edge& E4)
93: myMakeWire(E1,E2,E3,E4)
94{
95 if ( myMakeWire.IsDone()) {
96 Done();
97 myShape = myMakeWire.Wire();
98 }
99}
100
101
102//=======================================================================
103//function : BRepBuilderAPI_MakeWire
104//purpose :
105//=======================================================================
106
107BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Wire& W)
108: myMakeWire(W)
109{
110 if ( myMakeWire.IsDone()) {
111 Done();
112 myShape = myMakeWire.Wire();
113 }
114}
115
116
117//=======================================================================
118//function : BRepBuilderAPI_MakeWire
119//purpose :
120//=======================================================================
121
122BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Wire& W,
123 const TopoDS_Edge& E)
124: myMakeWire(W,E)
125{
126 if ( myMakeWire.IsDone()) {
127 Done();
128 myShape = myMakeWire.Wire();
129 }
130}
131
132
133//=======================================================================
134//function : Add
135//purpose :
136//=======================================================================
137
138void BRepBuilderAPI_MakeWire::Add(const TopoDS_Wire& W)
139{
140 myMakeWire.Add(W);
141 if ( myMakeWire.IsDone()) {
142 Done();
143 myShape = myMakeWire.Wire();
144 }
145}
146
147//=======================================================================
148//function : Add
149//purpose :
150//=======================================================================
151
152void BRepBuilderAPI_MakeWire::Add(const TopoDS_Edge& E)
153{
154 myMakeWire.Add(E);
155 if ( myMakeWire.IsDone()) {
156 Done();
157 myShape = myMakeWire.Wire();
158 }
159}
160
161//=======================================================================
162//function : Add
163//purpose :
164//=======================================================================
165
166void BRepBuilderAPI_MakeWire::Add(const TopTools_ListOfShape& L)
167{
168 myMakeWire.Add(L);
169 if ( myMakeWire.IsDone()) {
170 Done();
171 myShape = myMakeWire.Wire();
172 }
173}
174
175
176//=======================================================================
177//function : Wire
178//purpose :
179//=======================================================================
180
181const TopoDS_Wire& BRepBuilderAPI_MakeWire::Wire()const
182{
183 return myMakeWire.Wire();
184}
185
186
187//=======================================================================
188//function : Edge
189//purpose :
190//=======================================================================
191
192const TopoDS_Edge& BRepBuilderAPI_MakeWire::Edge()const
193{
194 return myMakeWire.Edge();
195}
196
197
198//=======================================================================
199//function : Vertex
200//purpose :
201//=======================================================================
202
203const TopoDS_Vertex& BRepBuilderAPI_MakeWire::Vertex()const
204{
205 return myMakeWire.Vertex();
206}
207
208
209//=======================================================================
210//function : operator
211//purpose :
212//=======================================================================
213
214BRepBuilderAPI_MakeWire::operator TopoDS_Wire() const
215{
216 return Wire();
217}
218
219
220//=======================================================================
221//function : IsDone
222//purpose :
223//=======================================================================
224
225Standard_Boolean BRepBuilderAPI_MakeWire::IsDone() const
226{
227 return myMakeWire.IsDone();
228}
229
230
231
232//=======================================================================
233//function : Error
234//purpose :
235//=======================================================================
236
237BRepBuilderAPI_WireError BRepBuilderAPI_MakeWire::Error() const
238{
239 switch ( myMakeWire.Error()) {
240
241 case BRepLib_WireDone:
242 return BRepBuilderAPI_WireDone;
243
244 case BRepLib_EmptyWire:
245 return BRepBuilderAPI_EmptyWire;
246
247 case BRepLib_DisconnectedWire:
248 return BRepBuilderAPI_DisconnectedWire;
249
250 case BRepLib_NonManifoldWire:
251 return BRepBuilderAPI_NonManifoldWire;
252 }
253
254 // portage WNT
255 return BRepBuilderAPI_WireDone;
256}