1 // Created on: 1992-10-02
2 // Created by: Remi GILET
3 // Copyright (c) 1992-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 <GCE2d_MakeEllipse.hxx>
19 #include <gce_MakeElips2d.hxx>
20 #include <Geom2d_Ellipse.hxx>
21 #include <gp_Ax2d.hxx>
22 #include <gp_Ax22d.hxx>
23 #include <gp_Elips2d.hxx>
24 #include <gp_Pnt2d.hxx>
25 #include <StdFail_NotDone.hxx>
27 GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Elips2d& E)
30 TheEllipse = new Geom2d_Ellipse(E);
33 GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax22d& Axis ,
34 const Standard_Real MajorRadius ,
35 const Standard_Real MinorRadius )
37 gce_MakeElips2d E = gce_MakeElips2d(Axis,MajorRadius,MinorRadius);
38 TheError = E.Status();
39 if (TheError == gce_Done) {
40 TheEllipse = new Geom2d_Ellipse(E.Value());
44 GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax2d& MajorAxis ,
45 const Standard_Real MajorRadius ,
46 const Standard_Real MinorRadius ,
47 const Standard_Boolean Sense )
49 gce_MakeElips2d E = gce_MakeElips2d(MajorAxis,MajorRadius,MinorRadius,Sense);
50 TheError = E.Status();
51 if (TheError == gce_Done) {
52 TheEllipse = new Geom2d_Ellipse(E.Value());
56 GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Pnt2d& S1 ,
58 const gp_Pnt2d& Center ) {
59 gce_MakeElips2d E = gce_MakeElips2d(S1,S2,Center);
60 TheError = E.Status();
61 if (TheError == gce_Done) {
62 TheEllipse = new Geom2d_Ellipse(E.Value());
66 const Handle(Geom2d_Ellipse)& GCE2d_MakeEllipse::Value() const
68 StdFail_NotDone_Raise_if (TheError != gce_Done,
69 "GCE2d_MakeEllipse::Value() - no result");