1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Ellipse.cpp
4 // Created: 25 April 2017
5 // Author: Vitaly Smetannikov
7 #include "GeomAPI_Ellipse.h"
8 #include "GeomAPI_Ax2.h"
9 #include "GeomAPI_Pnt.h"
11 #include <gp_Elips.hxx>
13 #define MY_ELIPS implPtr<gp_Elips>()
15 GeomAPI_Ellipse::GeomAPI_Ellipse(const std::shared_ptr<GeomAPI_Ax2>& theAx2,
16 double theMajorRadius, double theMinorRadius)
17 : GeomAPI_Interface(new gp_Elips(theAx2->impl<gp_Ax2>(), theMajorRadius, theMinorRadius))
21 GeomPointPtr GeomAPI_Ellipse::firstFocus() const
23 const gp_Pnt& aFirst = MY_ELIPS->Focus1();
24 return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aFirst.X(), aFirst.Y(), aFirst.Z()));
27 GeomPointPtr GeomAPI_Ellipse::secondFocus() const
29 const gp_Pnt& aSecond = MY_ELIPS->Focus2();
30 return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aSecond.X(), aSecond.Y(), aSecond.Z()));
33 double GeomAPI_Ellipse::minorRadius() const
35 return MY_ELIPS->MinorRadius();
38 double GeomAPI_Ellipse::majorRadius() const
40 return MY_ELIPS->MajorRadius();