BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
PointwiseAxisItem.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Device/PointwiseAxisItem.h
6 //! @brief Defines pointwise axis item
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_POINTWISEAXISITEM_H
16 #define BORNAGAIN_GUI_MODEL_DEVICE_POINTWISEAXISITEM_H
17 
19 
20 class PointwiseAxis;
22 class InstrumentItem;
23 
24 //! Item for non-uniform axis with specified coordinates.
26 private:
27  static constexpr auto P_NATIVE_AXIS_UNITS{"NativeAxisUnits"};
28 
29 public:
30  static constexpr auto M_TYPE{"PointwiseAxis"};
31 
32  explicit PointwiseAxisItem();
33  ~PointwiseAxisItem() override;
34 
35  void serialize(Streamer& s) override;
36 
37  // setters, getters
38  void init(const IAxis& axis, const QString& units_label);
39  void setOwningInstrument(const InstrumentItem* instrument);
40 
41  const IAxis* axis() const;
42  QString getUnitsLabel() const;
43 
44  std::unique_ptr<IAxis> createAxis(double scale) const override;
45 
46  void updateIndicators();
47 
48  QByteArray serializeBinaryData() const override;
49  void deserializeBinaryData(const QByteArray& data) override;
50 
51 private:
52  bool checkValidity() const;
53 
55  std::unique_ptr<IAxis> m_axis;
56 };
57 
58 #endif // BORNAGAIN_GUI_MODEL_DEVICE_POINTWISEAXISITEM_H
Defines various axis items.
Abstract base class for instrument-specific item classes.
Item for non-uniform axis with specified coordinates.
static constexpr auto M_TYPE
void deserializeBinaryData(const QByteArray &data) override
~PointwiseAxisItem() override
bool checkValidity() const
const SpecularInstrumentItem * m_instrumentItem
std::unique_ptr< IAxis > createAxis(double scale) const override
static constexpr auto P_NATIVE_AXIS_UNITS
void serialize(Streamer &s) override
void setOwningInstrument(const InstrumentItem *instrument)
std::unique_ptr< IAxis > m_axis
QByteArray serializeBinaryData() const override
const IAxis * axis() const
QString getUnitsLabel() const
void init(const IAxis &axis, const QString &units_label)
Supports serialization to or deserialization from QXmlStream.
Definition: Streamer.h:36