1 // Created on: 1993-07-23
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <BRepBuilderAPI_MakeWire.hxx>
19 #include <StdFail_NotDone.hxx>
20 #include <TopoDS_Edge.hxx>
21 #include <TopoDS_Vertex.hxx>
22 #include <TopoDS_Wire.hxx>
24 //=======================================================================
25 //function : BRepBuilderAPI_MakeWire
27 //=======================================================================
28 BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire()
33 //=======================================================================
34 //function : BRepBuilderAPI_MakeWire
36 //=======================================================================
38 BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E)
41 if ( myMakeWire.IsDone()) {
43 myShape = myMakeWire.Wire();
48 //=======================================================================
49 //function : BRepBuilderAPI_MakeWire
51 //=======================================================================
53 BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,
54 const TopoDS_Edge& E2)
57 if ( myMakeWire.IsDone()) {
59 myShape = myMakeWire.Wire();
64 //=======================================================================
65 //function : BRepBuilderAPI_MakeWire
67 //=======================================================================
69 BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,
70 const TopoDS_Edge& E2,
71 const TopoDS_Edge& E3)
72 : myMakeWire(E1,E2,E3)
74 if ( myMakeWire.IsDone()) {
76 myShape = myMakeWire.Wire();
81 //=======================================================================
82 //function : BRepBuilderAPI_MakeWire
84 //=======================================================================
86 BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,
87 const TopoDS_Edge& E2,
88 const TopoDS_Edge& E3,
89 const TopoDS_Edge& E4)
90 : myMakeWire(E1,E2,E3,E4)
92 if ( myMakeWire.IsDone()) {
94 myShape = myMakeWire.Wire();
99 //=======================================================================
100 //function : BRepBuilderAPI_MakeWire
102 //=======================================================================
104 BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Wire& W)
107 if ( myMakeWire.IsDone()) {
109 myShape = myMakeWire.Wire();
114 //=======================================================================
115 //function : BRepBuilderAPI_MakeWire
117 //=======================================================================
119 BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Wire& W,
120 const TopoDS_Edge& E)
123 if ( myMakeWire.IsDone()) {
125 myShape = myMakeWire.Wire();
130 //=======================================================================
133 //=======================================================================
135 void BRepBuilderAPI_MakeWire::Add(const TopoDS_Wire& W)
138 if ( myMakeWire.IsDone()) {
140 myShape = myMakeWire.Wire();
144 //=======================================================================
147 //=======================================================================
149 void BRepBuilderAPI_MakeWire::Add(const TopoDS_Edge& E)
152 if ( myMakeWire.IsDone()) {
154 myShape = myMakeWire.Wire();
158 //=======================================================================
161 //=======================================================================
163 void BRepBuilderAPI_MakeWire::Add(const TopTools_ListOfShape& L)
166 if ( myMakeWire.IsDone()) {
168 myShape = myMakeWire.Wire();
173 //=======================================================================
176 //=======================================================================
178 const TopoDS_Wire& BRepBuilderAPI_MakeWire::Wire()
180 return myMakeWire.Wire();
184 //=======================================================================
187 //=======================================================================
189 const TopoDS_Edge& BRepBuilderAPI_MakeWire::Edge()const
191 return myMakeWire.Edge();
195 //=======================================================================
198 //=======================================================================
200 const TopoDS_Vertex& BRepBuilderAPI_MakeWire::Vertex()const
202 return myMakeWire.Vertex();
206 //=======================================================================
207 //function : operator
209 //=======================================================================
211 BRepBuilderAPI_MakeWire::operator TopoDS_Wire()
217 //=======================================================================
220 //=======================================================================
222 Standard_Boolean BRepBuilderAPI_MakeWire::IsDone() const
224 return myMakeWire.IsDone();
229 //=======================================================================
232 //=======================================================================
234 BRepBuilderAPI_WireError BRepBuilderAPI_MakeWire::Error() const
236 switch ( myMakeWire.Error()) {
238 case BRepLib_WireDone:
239 return BRepBuilderAPI_WireDone;
241 case BRepLib_EmptyWire:
242 return BRepBuilderAPI_EmptyWire;
244 case BRepLib_DisconnectedWire:
245 return BRepBuilderAPI_DisconnectedWire;
247 case BRepLib_NonManifoldWire:
248 return BRepBuilderAPI_NonManifoldWire;
252 return BRepBuilderAPI_WireDone;