0024893: CLang warnings -Wlogical-not-parentheses for gce_Done comparisons
[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
17#include <GCE2d_MakeEllipse.ixx>
18#include <gce_MakeElips2d.hxx>
19#include <StdFail_NotDone.hxx>
20
21GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Elips2d& E)
22{
23 TheError = gce_Done;
24 TheEllipse = new Geom2d_Ellipse(E);
25}
26
27GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax22d& Axis ,
28 const Standard_Real MajorRadius ,
29 const Standard_Real MinorRadius )
30{
31 gce_MakeElips2d E = gce_MakeElips2d(Axis,MajorRadius,MinorRadius);
32 TheError = E.Status();
33 if (TheError == gce_Done) {
34 TheEllipse = new Geom2d_Ellipse(E.Value());
35 }
36}
37
38GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax2d& MajorAxis ,
39 const Standard_Real MajorRadius ,
40 const Standard_Real MinorRadius ,
41 const Standard_Boolean Sense )
42{
43 gce_MakeElips2d E = gce_MakeElips2d(MajorAxis,MajorRadius,MinorRadius,Sense);
44 TheError = E.Status();
45 if (TheError == gce_Done) {
46 TheEllipse = new Geom2d_Ellipse(E.Value());
47 }
48}
49
50GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Pnt2d& S1 ,
51 const gp_Pnt2d& S2 ,
52 const gp_Pnt2d& Center ) {
53 gce_MakeElips2d E = gce_MakeElips2d(S1,S2,Center);
54 TheError = E.Status();
55 if (TheError == gce_Done) {
56 TheEllipse = new Geom2d_Ellipse(E.Value());
57 }
58}
59
60const Handle(Geom2d_Ellipse)& GCE2d_MakeEllipse::Value() const
61{
82fc327c 62 StdFail_NotDone_Raise_if(TheError != gce_Done,"");
7fd59977 63 return TheEllipse;
64}
65
66const Handle(Geom2d_Ellipse)& GCE2d_MakeEllipse::Operator() const
67{
68 return Value();
69}
70
71GCE2d_MakeEllipse::operator Handle(Geom2d_Ellipse) () const
72{
73 return Value();
74}
75