15 #ifndef BORNAGAIN_CORE_DETECTOR_IDETECTOR2D_H
16 #define BORNAGAIN_CORE_DETECTOR_IDETECTOR2D_H
Defines class DetectorMask.
Defines common detector interface.
Beam defined by wavelength, direction and intensity.
Holds precalculated information for faster SimulationElement generation.
Collection of detector masks.
Abstract 2D detector interface.
DetectorMask m_detector_mask
void resetRegionOfInterest() override
Resets region of interest making whole detector plane available for the simulation.
std::unique_ptr< DetectorContext > createContext() const
virtual IPixel * createPixel(size_t index) const =0
Creates an IPixel for the given OutputData object and index.
std::unique_ptr< RegionOfInterest > m_region_of_interest
void setRegionOfInterest(double xlow, double ylow, double xup, double yup)
Sets rectangular region of interest with lower left and upper right corners defined.
virtual size_t indexOfSpecular(const Beam &beam) const =0
Returns index of pixel that contains the specular wavevector.
IDetector2D * clone() const override=0
const RegionOfInterest * regionOfInterest() const override
Returns region of interest if exists.
void addMask(const IShape2D &shape, bool mask_value=true)
Adds mask of given shape to the stack of detector masks.
void setDetectorParameters(size_t n_x, double x_min, double x_max, size_t n_y, double y_min, double y_max)
Sets detector parameters using angle ranges.
void removeMasks()
Removes all masks from the detector.
void maskAll()
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
size_t getGlobalIndex(size_t x, size_t y) const
Calculate global index from two axis indices.
std::vector< size_t > active_indices() const
Returns vector of unmasked detector indices.
const DetectorMask * detectorMask() const override
Returns detector masks container.
Abstract detector interface.
Interface for a function that maps [0,1]x[0,1] to the kvectors in a pixel.
Basic class for all shapes in 2D.
Defines rectangular area for the detector which will be simulated/fitted.