BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SimulationArea.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Device/Detector/SimulationArea.h
6 //! @brief Defines class SimulationArea.
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_SIMULATIONAREA_H
21 #define BORNAGAIN_DEVICE_DETECTOR_SIMULATIONAREA_H
22 
24 
25 class IDetector;
26 
27 //! Holds iteration logic over active detector channels in the presence of masked areas
28 //! and RegionOfInterest defined.
29 //! @ingroup detector
30 
32 public:
34  explicit SimulationArea(const IDetector* detector);
35  virtual ~SimulationArea() {}
36 
39 
40  //! returns true if given iterator index correspond to masked detector channel
41  virtual bool isMasked(size_t index) const;
42 
43  size_t totalSize() const;
44 
45  //! Return index in ROI map from iterator index
46  size_t roiIndex(size_t index) const;
47 
48  //! Return detector index from iterator index
49  size_t detectorIndex(size_t index) const;
50 
51 protected:
53  size_t m_max_index;
54 };
55 
56 inline size_t SimulationArea::totalSize() const
57 {
58  return m_max_index;
59 }
60 
61 //! Holds iteration logic over active detector channels in the presence of ROI. On the contrary
62 //! to SimulationArea class, iterates also over masked areas.
63 //! @ingroup detector
64 
66 public:
67  explicit SimulationRoiArea(const IDetector* detector);
68 
69  virtual bool isMasked(size_t) const;
70 };
71 
72 #endif // BORNAGAIN_DEVICE_DETECTOR_SIMULATIONAREA_H
73 #endif // USER_API
Defines class SimulationAreaIterator.
Abstract detector interface.
Definition: IDetector.h:36
An iterator for SimulationArea.
Holds iteration logic over active detector channels in the presence of masked areas and RegionOfInter...
size_t totalSize() const
virtual bool isMasked(size_t index) const
returns true if given iterator index correspond to masked detector channel
size_t detectorIndex(size_t index) const
Return detector index from iterator index.
virtual ~SimulationArea()
SimulationAreaIterator begin()
SimulationAreaIterator end()
SimulationArea(const IDetector *detector)
size_t roiIndex(size_t index) const
Return index in ROI map from iterator index.
const IDetector * m_detector
Holds iteration logic over active detector channels in the presence of ROI.
virtual bool isMasked(size_t) const
returns true if given iterator index correspond to masked detector channel
SimulationRoiArea(const IDetector *detector)