0028550: Foundation Classes - fix empty message passed to thrown exception
[occt.git] / src / GCE2d / GCE2d_MakeEllipse.cxx
CommitLineData
b311480e 1// Created on: 1992-10-02
2// Created by: Remi GILET
3// Copyright (c) 1992-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
42cf5bc1 17
18#include <GCE2d_MakeEllipse.hxx>
7fd59977 19#include <gce_MakeElips2d.hxx>
42cf5bc1 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>
7fd59977 25#include <StdFail_NotDone.hxx>
26
27GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Elips2d& E)
28{
29 TheError = gce_Done;
30 TheEllipse = new Geom2d_Ellipse(E);
31}
32
33GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax22d& Axis ,
34 const Standard_Real MajorRadius ,
35 const Standard_Real MinorRadius )
36{
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());
41 }
42}
43
44GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax2d& MajorAxis ,
45 const Standard_Real MajorRadius ,
46 const Standard_Real MinorRadius ,
47 const Standard_Boolean Sense )
48{
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());
53 }
54}
55
56GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Pnt2d& S1 ,
57 const gp_Pnt2d& S2 ,
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());
63 }
64}
65
66const Handle(Geom2d_Ellipse)& GCE2d_MakeEllipse::Value() const
67{
2d2b3d53 68 StdFail_NotDone_Raise_if (TheError != gce_Done,
69 "GCE2d_MakeEllipse::Value() - no result");
7fd59977 70 return TheEllipse;
71}