1 // Created on: 1993-07-29
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
23 #include <BRepBuilderAPI_MakePolygon.ixx>
25 //=======================================================================
26 //function : BRepBuilderAPI_MakePolygon
28 //=======================================================================
30 BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon()
35 //=======================================================================
36 //function : BRepBuilderAPI_MakePolygon
38 //=======================================================================
40 BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const gp_Pnt& P1, const gp_Pnt& P2)
41 : myMakePolygon(P1,P2)
43 if (myMakePolygon.IsDone()) {
45 myShape = myMakePolygon.Shape();
50 //=======================================================================
51 //function : BRepBuilderAPI_MakePolygon
53 //=======================================================================
55 BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const gp_Pnt& P1,
58 const Standard_Boolean Cl)
59 : myMakePolygon(P1,P2,P3,Cl)
61 if (myMakePolygon.IsDone()) {
63 myShape = myMakePolygon.Shape();
68 //=======================================================================
69 //function : BRepBuilderAPI_MakePolygon
71 //=======================================================================
73 BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const gp_Pnt& P1,
77 const Standard_Boolean Cl)
78 : myMakePolygon(P1,P2,P3,P4,Cl)
80 if (myMakePolygon.IsDone()) {
82 myShape = myMakePolygon.Shape();
87 //=======================================================================
88 //function : BRepBuilderAPI_MakePolygon
90 //=======================================================================
92 BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const TopoDS_Vertex& V1,
93 const TopoDS_Vertex& V2)
94 : myMakePolygon(V1,V2)
96 if (myMakePolygon.IsDone()) {
98 myShape = myMakePolygon.Shape();
103 //=======================================================================
104 //function : BRepBuilderAPI_MakePolygon
106 //=======================================================================
108 BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const TopoDS_Vertex& V1,
109 const TopoDS_Vertex& V2,
110 const TopoDS_Vertex& V3,
111 const Standard_Boolean Cl)
112 : myMakePolygon(V1,V2,V3,Cl)
114 if (myMakePolygon.IsDone()) {
116 myShape = myMakePolygon.Shape();
121 //=======================================================================
122 //function : BRepBuilderAPI_MakePolygon
124 //=======================================================================
126 BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const TopoDS_Vertex& V1,
127 const TopoDS_Vertex& V2,
128 const TopoDS_Vertex& V3,
129 const TopoDS_Vertex& V4,
130 const Standard_Boolean Cl)
131 : myMakePolygon(V1,V2,V3,V4,Cl)
133 if (myMakePolygon.IsDone()) {
135 myShape = myMakePolygon.Shape();
140 //=======================================================================
143 //=======================================================================
145 void BRepBuilderAPI_MakePolygon::Add(const gp_Pnt& P)
147 myMakePolygon.Add(P);
148 if (myMakePolygon.IsDone()) {
150 if ( !LastVertex().IsNull())
151 myShape = myMakePolygon.Shape();
156 //=======================================================================
159 //=======================================================================
161 void BRepBuilderAPI_MakePolygon::Add(const TopoDS_Vertex& V)
163 myMakePolygon.Add(V);
164 if (myMakePolygon.IsDone()) {
166 myShape = myMakePolygon.Shape();
170 //=======================================================================
173 //=======================================================================
175 Standard_Boolean BRepBuilderAPI_MakePolygon::Added()const
177 return myMakePolygon.Added();
181 //=======================================================================
184 //=======================================================================
186 void BRepBuilderAPI_MakePolygon::Close()
188 myMakePolygon.Close();
189 myShape = myMakePolygon.Shape();
193 //=======================================================================
194 //function : FirstVertex
196 //=======================================================================
198 const TopoDS_Vertex& BRepBuilderAPI_MakePolygon::FirstVertex()const
200 return myMakePolygon.FirstVertex();
204 //=======================================================================
205 //function : LastVertex
207 //=======================================================================
209 const TopoDS_Vertex& BRepBuilderAPI_MakePolygon::LastVertex()const
211 return myMakePolygon.LastVertex();
214 //=======================================================================
217 //=======================================================================
219 Standard_Boolean BRepBuilderAPI_MakePolygon::IsDone() const
221 return myMakePolygon.IsDone();
225 //=======================================================================
228 //=======================================================================
230 const TopoDS_Edge& BRepBuilderAPI_MakePolygon::Edge()const
232 return myMakePolygon.Edge();
235 //=======================================================================
238 //=======================================================================
240 const TopoDS_Wire& BRepBuilderAPI_MakePolygon::Wire()const
242 return myMakePolygon.Wire();
245 //=======================================================================
246 //function : operator
248 //=======================================================================
250 BRepBuilderAPI_MakePolygon::operator TopoDS_Edge() const
255 //=======================================================================
256 //function : operator
258 //=======================================================================
260 BRepBuilderAPI_MakePolygon::operator TopoDS_Wire() const