1 // Copyright (C) 2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 // File: GeomAPI_Ellipse.h
22 // Created: 25 April 2017
23 // Author: Vitaly Smetannikov
25 #ifndef GeomAPI_Ellipse_H_
26 #define GeomAPI_Ellipse_H_
28 #include <GeomAPI_Interface.h>
36 /**\class GeomAPI_Ellipse
38 * \brief Ellipse in 3D
40 class GeomAPI_Ellipse : public GeomAPI_Interface
44 /// \brief Constructs an epty ellipse
45 GEOMAPI_EXPORT GeomAPI_Ellipse() : GeomAPI_Interface() {}
47 /** \brief Constructs an ellipse with major and minor radiuses,
48 * where theAx2 locates the ellipse and defines its orientation in 3D space such that:\n
49 * - the center of the circle is the origin of theAx2;\n
50 * - the origin, "X Direction" and "Y Direction" of theAx2 define the plane of the circle;\n
51 * - theAx2 is the local coordinate system of the circle.\n
52 * Note: It is possible to create a circle where Radius is equal to 0.0. raised if Radius < 0.
54 GEOMAPI_EXPORT GeomAPI_Ellipse(const std::shared_ptr<GeomAPI_Ax2>& theAx2,
55 double theMajorRadius, double theMinorRadius);
57 /// Returns center of the ellipse
58 GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt> center() const;
60 /// Returns first focus of the ellipse
61 GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt> firstFocus() const;
63 /// Returns second focus of the ellipse
64 GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt> secondFocus() const;
66 /// Return orthogonal direction to the ellipse's plane
67 GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> normal() const;
69 /// Returns minor radius of the ellipse
70 GEOMAPI_EXPORT double minorRadius() const;
72 /// Returns major radius of the ellipse
73 GEOMAPI_EXPORT double majorRadius() const;
77 //! Pointer on the object
78 typedef std::shared_ptr<GeomAPI_Ellipse> GeomEllipsePtr;