BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
RectangularPixel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Device/Detector/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_DEVICE_DETECTOR_RECTANGULARPIXEL_H
21 #define BORNAGAIN_DEVICE_DETECTOR_RECTANGULARPIXEL_H
22 
23 #include "Base/Pixel/IPixel.h"
24 
25 //! A pixel in a RectangularDetector.
26 
27 class RectangularPixel : public IPixel {
28 public:
29  RectangularPixel(const kvector_t& corner_pos, const kvector_t& width, const kvector_t& height);
30 
31  RectangularPixel* clone() const override;
32  RectangularPixel* createZeroSizePixel(double x, double y) const override;
33  kvector_t getK(double x, double y, double wavelength) const override;
34  kvector_t getPosition(double x, double y) const;
35  double integrationFactor(double x, double y) const override;
36  double solidAngle() const override;
37 
38 private:
39  kvector_t normalizeLength(const kvector_t direction, double length) const;
40  double calculateSolidAngle() const;
41 
46  mutable double m_solid_angle;
47 };
48 
49 #endif // BORNAGAIN_DEVICE_DETECTOR_RECTANGULARPIXEL_H
50 #endif // USER_API
Defines and implements interface IPixel.
Interface for a function that maps [0,1]x[0,1] to the kvectors in a pixel.
Definition: IPixel.h:25
A pixel in a RectangularDetector.
kvector_t getK(double x, double y, double wavelength) const override
double solidAngle() const override
double integrationFactor(double x, double y) const override
kvector_t getPosition(double x, double y) const
const kvector_t m_corner_pos
const kvector_t m_width
kvector_t normalizeLength(const kvector_t direction, double length) const
RectangularPixel(const kvector_t &corner_pos, const kvector_t &width, const kvector_t &height)
RectangularPixel * clone() const override
double calculateSolidAngle() const
const kvector_t m_normal
RectangularPixel * createZeroSizePixel(double x, double y) const override
const kvector_t m_height