Salome HOME
Fix errors in SketchPlugin/plugin-Sketch.xml
[modules/shaper.git] / src / GeomAPI / GeomAPI_Ellipse2d.h
1 // Copyright (C) 2017  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 // File:        GeomAPI_Ellipse2d.h
22 // Created:     26 April 2017
23 // Author:      Artem ZHIDKOV
24
25 #ifndef GeomAPI_Ellipse2d_H_
26 #define GeomAPI_Ellipse2d_H_
27
28 #include <GeomAPI_Interface.h>
29
30 class GeomAPI_Pnt2d;
31 class GeomAPI_Dir2d;
32
33 /**\class GeomAPI_Ellipse2d
34  * \ingroup DataModel
35  * \brief Ellipse in 2D
36  */
37 class GeomAPI_Ellipse2d : public GeomAPI_Interface
38 {
39 public:
40   /// \brief Constructs ellipse by center, X-axis and given radii
41   GEOMAPI_EXPORT GeomAPI_Ellipse2d(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
42                                    const std::shared_ptr<GeomAPI_Dir2d>& theXAxis,
43                                    const double theMajorRadius,
44                                    const double theMinorRadius);
45
46   /// \brief Constructs ellipse by center and two points lying on the ellipse:
47   ///        first of them defines an axis of the ellipse
48   ///        and another is just placed on the ellipse.
49   GEOMAPI_EXPORT GeomAPI_Ellipse2d(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
50                                    const std::shared_ptr<GeomAPI_Pnt2d>& theAxisPoint,
51                                    const std::shared_ptr<GeomAPI_Pnt2d>& thePassingPoint);
52
53   /// Returns center of the ellipse
54   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt2d> center() const;
55
56   /// Returns first focus of the ellipse
57   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt2d> firstFocus() const;
58
59   /// Returns second focus of the ellipse
60   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt2d> secondFocus() const;
61
62   /// Returns minor radius of the ellipse
63   GEOMAPI_EXPORT double minorRadius() const;
64
65   /// Returns major radius of the ellipse
66   GEOMAPI_EXPORT double majorRadius() const;
67 };
68
69 #endif