BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
RectangularDetectorItem.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Device/RectangularDetectorItem.h
6 //! @brief Defines class RectangularDetectorItem
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_GUI_MODEL_DEVICE_RECTANGULARDETECTORITEM_H
16 #define BORNAGAIN_GUI_MODEL_DEVICE_RECTANGULARDETECTORITEM_H
17 
18 #include "Device/Detector/RectangularDetector.h"
23 
25 private:
26  static constexpr auto P_X_AXIS{"X axis"};
27  static constexpr auto P_Y_AXIS{"Y axis"};
28  static constexpr auto P_NORMAL{"Normal vector"};
29  static constexpr auto P_DIRECTION{"Direction vector"};
30  static constexpr auto P_U0{"u0"};
31  static constexpr auto P_V0{"v0"};
32  static constexpr auto P_DBEAM_U0{"u0 (dbeam)"};
33  static constexpr auto P_DBEAM_V0{"v0 (dbeam)"};
34  static constexpr auto P_DISTANCE{"Distance"};
35 
36 public:
38 
39  void serialize(Streamer& s) override;
40 
41  int xSize() const override;
42  void setXSize(size_t nx) override;
43 
44  int ySize() const override;
45  void setYSize(size_t ny) override;
46 
47  DOUBLE_PROPERTY(width, Width);
48  DOUBLE_PROPERTY(height, Height);
49 
50  void setDetectorAlignment(RectangularDetector::EDetectorArrangement alignment);
51  RectangularDetector::EDetectorArrangement detectorAlignment() const;
54 
55  //! The properties of the currently active alignment. Sorted as expected on the UI
56  QVector<std::variant<VectorDescriptor, DoubleDescriptor>> alignmentPropertiesForUI() const;
57 
58  VECTOR_PROPERTY(normalVector, NormalVector);
59  VECTOR_PROPERTY(directionVector, DirectionVector);
60 
61  DOUBLE_PROPERTY(u0, U0);
62  DOUBLE_PROPERTY(v0, V0);
63  DOUBLE_PROPERTY(distance, Distance);
64 
65 private:
66  std::unique_ptr<IDetector> createDomainDetector() const override;
67  void updateTooltips();
68 
69 private:
70  RectangularDetector::EDetectorArrangement m_detectorAlignment;
71  int m_xSize;
72  int m_ySize;
73 };
74 
75 #endif // BORNAGAIN_GUI_MODEL_DEVICE_RECTANGULARDETECTORITEM_H
Defines class AxisProperty.
Defines classes DetectorItems.
Defines class DoubleProperty.
Defines class VectorProperty.
static constexpr auto P_X_AXIS
VECTOR_PROPERTY(directionVector, DirectionVector)
static constexpr auto P_DBEAM_V0
static constexpr auto P_DBEAM_U0
static constexpr auto P_U0
static constexpr auto P_Y_AXIS
int ySize() const override
Returns the size of y-axis of the detector.
void setXSize(size_t nx) override
sets the size of x-axis of the detector
SelectionDescriptor< RectangularDetector::EDetectorArrangement > detectorAlignmentSelection() const
void serialize(Streamer &s) override
std::unique_ptr< IDetector > createDomainDetector() const override
static constexpr auto P_V0
RectangularDetector::EDetectorArrangement m_detectorAlignment
static constexpr auto P_NORMAL
QVector< std::variant< VectorDescriptor, DoubleDescriptor > > alignmentPropertiesForUI() const
The properties of the currently active alignment. Sorted as expected on the UI.
DOUBLE_PROPERTY(width, Width)
VECTOR_PROPERTY(normalVector, NormalVector)
void setYSize(size_t ny) override
sets the size of y-axis of the detector
static constexpr auto P_DIRECTION
void setDetectorAlignment(RectangularDetector::EDetectorArrangement alignment)
DOUBLE_PROPERTY(distance, Distance)
static constexpr auto P_DISTANCE
int xSize() const override
Returns the size of x-axis of the detector.
DOUBLE_PROPERTY(height, Height)
RectangularDetector::EDetectorArrangement detectorAlignment() const
Describes a selection (various possibilities and the current one).
Supports serialization to or deserialization from QXmlStream.
Definition: Streamer.h:36