Salome HOME
Issue #2612 : Re-calculate model after modification of parameters
[modules/shaper.git] / src / GeomAPI / GeomAPI_Ellipse.cpp
index 1eae6445f4e532683b4b5abc36e3ec7d7f3c36ac..23247f8435186e8050a71134b4c1464d8250edfd 100644 (file)
@@ -1,4 +1,22 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2017  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
 
 // File:        GeomAPI_Ellipse.cpp
 // Created:     25 April 2017
@@ -18,6 +36,12 @@ GeomAPI_Ellipse::GeomAPI_Ellipse(const std::shared_ptr<GeomAPI_Ax2>& theAx2,
 {
 }
 
+std::shared_ptr<GeomAPI_Pnt> GeomAPI_Ellipse::center() const
+{
+  const gp_Pnt& aCenter = MY_ELIPS->Location();
+  return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aCenter.X(), aCenter.Y(), aCenter.Z()));
+}
+
 GeomPointPtr GeomAPI_Ellipse::firstFocus() const
 {
   const gp_Pnt& aFirst = MY_ELIPS->Focus1();
@@ -30,6 +54,13 @@ GeomPointPtr GeomAPI_Ellipse::secondFocus() const
   return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aSecond.X(), aSecond.Y(), aSecond.Z()));
 }
 
+std::shared_ptr<GeomAPI_Dir> GeomAPI_Ellipse::normal() const
+{
+  const gp_Ax1& anAxis = MY_ELIPS->Axis();
+  const gp_Dir& aDir = anAxis.Direction();
+  return std::shared_ptr<GeomAPI_Dir>(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z()));
+}
+
 double GeomAPI_Ellipse::minorRadius() const
 {
   return MY_ELIPS->MinorRadius();