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