BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Ellipse.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/Mask/Ellipse.h
6 //! @brief Defines class Rectangle.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #ifndef BORNAGAIN_CORE_MASK_ELLIPSE_H
16 #define BORNAGAIN_CORE_MASK_ELLIPSE_H
17 
18 #include "Device/Mask/IShape2D.h"
19 
20 //! Ellipse shape.
21 //! @ingroup tools
22 
23 class Ellipse : public IShape2D
24 {
25 public:
26  Ellipse(double xcenter, double ycenter, double xradius, double yradius, double theta = 0.0);
27  Ellipse* clone() const { return new Ellipse(m_xc, m_yc, m_xr, m_yr, m_theta); }
28 
29  bool contains(double x, double y) const;
30  bool contains(const Bin1D& binx, const Bin1D& biny) const;
31 
32  double getCenterX() const { return m_xc; }
33  double getCenterY() const { return m_yc; }
34  double getRadiusX() const { return m_xr; }
35  double getRadiusY() const { return m_yr; }
36  double getTheta() const { return m_theta; }
37 
38 private:
39  double m_xc, m_yc, m_xr, m_yr, m_theta;
40 };
41 
42 #endif // BORNAGAIN_CORE_MASK_ELLIPSE_H
Defines basic class for all 2D shapes.
Ellipse shape.
Definition: Ellipse.h:24
double getCenterY() const
Definition: Ellipse.h:33
double m_xc
Definition: Ellipse.h:39
double m_xr
Definition: Ellipse.h:39
double getTheta() const
Definition: Ellipse.h:36
bool contains(double x, double y) const
Returns true if point with given coordinates is inside or on border of the shape.
Definition: Ellipse.cpp:34
Ellipse * clone() const
Definition: Ellipse.h:27
double getRadiusY() const
Definition: Ellipse.h:35
double m_yc
Definition: Ellipse.h:39
double getCenterX() const
Definition: Ellipse.h:32
double m_yr
Definition: Ellipse.h:39
Ellipse(double xcenter, double ycenter, double xradius, double yradius, double theta=0.0)
Definition: Ellipse.cpp:24
double m_theta
Definition: Ellipse.h:39
double getRadiusX() const
Definition: Ellipse.h:34
Basic class for all shapes in 2D.
Definition: IShape2D.h:27
Definition: Bin.h:20