BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
InfinitePlane.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Device/Mask/InfinitePlane.h
6 //! @brief Defines class InfinitePlane.
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_MASK_INFINITEPLANE_H
21 #define BORNAGAIN_DEVICE_MASK_INFINITEPLANE_H
22 
23 #include "Device/Mask/IShape2D.h"
24 
25 //! The infinite plane is used for masking the entire detector.
26 //! @ingroup tools
27 
28 class InfinitePlane : public IShape2D {
29 public:
31  : IShape2D("InfinitePlane")
32  {
33  }
34  InfinitePlane* clone() const override { return new InfinitePlane(); }
35 
36  bool contains(double, double) const override { return true; }
37  bool contains(const Bin1D&, const Bin1D&) const override { return true; }
38 };
39 
40 #endif // BORNAGAIN_DEVICE_MASK_INFINITEPLANE_H
41 #endif // USER_API
Defines basic class for all 2D shapes.
Definition: Bin.h:20
Basic class for all shapes in 2D.
Definition: IShape2D.h:26
The infinite plane is used for masking the entire detector.
Definition: InfinitePlane.h:28
bool contains(double, double) const override
Returns true if point with given coordinates is inside or on border of the shape.
Definition: InfinitePlane.h:36
InfinitePlane * clone() const override
Definition: InfinitePlane.h:34
bool contains(const Bin1D &, const Bin1D &) const override
Returns true if area defined by two bins is inside or on border of polygon (more precisely,...
Definition: InfinitePlane.h:37