VerticalExtent.hpp
1 #pragma once
2 #include <QPointF>
3 
4 #include <verdigris>
5 
6 namespace Scenario
7 {
19 struct VerticalExtent final : public QPointF
20 {
21  Q_DECL_CONSTEXPR VerticalExtent() = default;
22  Q_DECL_CONSTEXPR VerticalExtent(qreal x, qreal y)
23  : QPointF{x, y}
24  {
25  }
26  Q_DECL_CONSTEXPR VerticalExtent(const VerticalExtent&) = default;
27  Q_DECL_CONSTEXPR VerticalExtent(VerticalExtent&&) noexcept = default;
28  Q_DECL_CONSTEXPR VerticalExtent(QPointF other)
29  : QPointF{other}
30  {
31  }
32  VerticalExtent& operator=(VerticalExtent other)
33  {
34  static_cast<QPointF&>(*this) = other;
35  return *this;
36  }
37  VerticalExtent& operator=(QPointF other)
38  {
39  static_cast<QPointF&>(*this) = other;
40  return *this;
41  }
42 
43  Q_DECL_CONSTEXPR VerticalExtent operator*(qreal other)
44  {
45  return VerticalExtent{top() * other, bottom() * other};
46  }
47 
48  Q_DECL_CONSTEXPR double top() const { return QPointF::x(); }
49  Q_DECL_CONSTEXPR double bottom() const { return QPointF::y(); }
50 };
51 
52 }
53 Q_DECLARE_METATYPE(Scenario::VerticalExtent)
54 W_REGISTER_ARGTYPE(Scenario::VerticalExtent)
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
The VerticalExtent struct.
Definition: VerticalExtent.hpp:20