BornAgain  1.18.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 scattering at grazing incidence
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 #ifndef BORNAGAIN_CORE_DETECTOR_SIMULATIONAREA_H
16 #define BORNAGAIN_CORE_DETECTOR_SIMULATIONAREA_H
17 
19 
20 class IDetector;
21 
22 //! Holds iteration logic over active detector channels in the presence of masked areas
23 //! and RegionOfInterest defined.
24 //! @ingroup detector
25 
27 {
28 public:
30  explicit SimulationArea(const IDetector* detector);
31  virtual ~SimulationArea() {}
32 
35 
36  //! returns true if given iterator index correspond to masked detector channel
37  virtual bool isMasked(size_t index) const;
38 
39  size_t totalSize() const;
40 
41  //! Return index in ROI map from iterator index
42  size_t roiIndex(size_t index) const;
43 
44  //! Return detector index from iterator index
45  size_t detectorIndex(size_t index) const;
46 
47 protected:
49  size_t m_max_index;
50 };
51 
52 inline size_t SimulationArea::totalSize() const
53 {
54  return m_max_index;
55 }
56 
57 //! Holds iteration logic over active detector channels in the presence of ROI. On the contrary
58 //! to SimulationArea class, iterates also over masked areas.
59 //! @ingroup detector
60 
62 {
63 public:
64  explicit SimulationRoiArea(const IDetector* detector);
65 
66  virtual bool isMasked(size_t) const;
67 };
68 
69 #endif // BORNAGAIN_CORE_DETECTOR_SIMULATIONAREA_H
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)