BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
RectangularPixel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Pixel/RectangularPixel.h
6 //! @brief Defines class RectangularPixel.
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_BASE_PIXEL_RECTANGULARPIXEL_H
21 #define BORNAGAIN_BASE_PIXEL_RECTANGULARPIXEL_H
22 
23 #include "Base/Pixel/IPixel.h"
24 
25 class IAxis;
26 
27 //! A pixel in a RectangularDetector.
28 
29 class RectangularPixel : public IPixel {
30 public:
31  RectangularPixel(const R3& corner_pos, const R3& width, const R3& height);
32 
33  RectangularPixel* clone() const override;
34  RectangularPixel* createZeroSizePixel(double x, double y) const override;
35  R3 getK(double x, double y, double wavelength) const override;
36  R3 getPosition(double x, double y) const;
37  double integrationFactor(double x, double y) const override;
38  double solidAngle() const override;
39 
40  IAxis* createAxis(size_t n) const;
41 
42 private:
43  R3 normalizeLength(R3 direction, double length) const;
44  double calculateSolidAngle() const;
45 
46  const R3 m_corner_pos;
47  const R3 m_width;
48  const R3 m_height;
49  const R3 m_normal;
50  mutable double m_solid_angle;
51 };
52 
53 #endif // BORNAGAIN_BASE_PIXEL_RECTANGULARPIXEL_H
54 #endif // USER_API
Defines and implements interface IPixel.
Abstract base class for one-dimensional axes.
Definition: IAxis.h:27
Interface for a function that maps [0,1]x[0,1] to the kvectors in a pixel. Abstract base class for Sp...
Definition: IPixel.h:29
A pixel in a RectangularDetector.
double solidAngle() const override
double integrationFactor(double x, double y) const override
R3 normalizeLength(R3 direction, double length) const
R3 getPosition(double x, double y) const
IAxis * createAxis(size_t n) const
R3 getK(double x, double y, double wavelength) const override
RectangularPixel * clone() const override
double calculateSolidAngle() const
RectangularPixel * createZeroSizePixel(double x, double y) const override
RectangularPixel(const R3 &corner_pos, const R3 &width, const R3 &height)