BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
LineViews.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Mask/LineViews.h
6 //! @brief Defines classes VerticalLineView and HorizontalLineView
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_VIEW_MASK_LINEVIEWS_H
16 #define BORNAGAIN_GUI_VIEW_MASK_LINEVIEWS_H
17 
19 
20 class VerticalLineItem;
21 class HorizontalLineItem;
22 
23 //! This is a view of VerticalLineItem mask
24 
26  Q_OBJECT
27 
28 public:
29  int type() const override { return MaskEditorHelper::VERTICALLINE; }
30 
31  explicit VerticalLineView(VerticalLineItem* item);
32  ~VerticalLineView() override;
33  QPainterPath shape() const override;
34  SessionItem* parameterizedItem() const override;
35 
36 protected slots:
37  void update_view() override;
38  void onChangedX() override;
39  void onPropertyChange() override;
40 
41 protected:
42  void paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*) override;
43  QVariant itemChange(GraphicsItemChange change, const QVariant& value) override;
44 
45 private:
46  void onItemDestroyed() override;
47 
48 private:
50 };
51 
52 
53 //! This is a view of HorizontalLineItem mask
54 
56  Q_OBJECT
57 
58 public:
59  int type() const override { return MaskEditorHelper::HORIZONTALLINE; }
60 
61  explicit HorizontalLineView(HorizontalLineItem* item);
62  ~HorizontalLineView() override;
63  QPainterPath shape() const override;
64  SessionItem* parameterizedItem() const override;
65 
66 protected slots:
67  void update_view() override;
68  void onChangedY() override;
69  void onPropertyChange() override;
70 
71 protected:
72  void paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*) override;
73  QVariant itemChange(GraphicsItemChange change, const QVariant& value) override;
74 
75 private:
76  void onItemDestroyed() override;
77 
78 private:
80 };
81 
82 #endif // BORNAGAIN_GUI_VIEW_MASK_LINEVIEWS_H
Defines interface IShape2DView.
This is a view of HorizontalLineItem mask.
Definition: LineViews.h:55
HorizontalLineView(HorizontalLineItem *item)
Definition: LineViews.cpp:116
void onPropertyChange() override
Definition: LineViews.cpp:151
void update_view() override
Definition: LineViews.cpp:156
HorizontalLineItem * m_item
Definition: LineViews.h:79
int type() const override
Definition: LineViews.h:59
void onChangedY() override
Definition: LineViews.cpp:144
QPainterPath shape() const override
Definition: LineViews.cpp:131
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
Allows item movement along y, prevent movement along x.
Definition: LineViews.cpp:186
SessionItem * parameterizedItem() const override
Definition: LineViews.cpp:139
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
Definition: LineViews.cpp:167
~HorizontalLineView() override
Definition: LineViews.cpp:126
void onItemDestroyed() override
Definition: LineViews.cpp:197
Main interface class for views representing MaskItems, Projections on graphics scene.
Definition: IShape2DView.h:27
Base class for a GUI data item.
Definition: SessionItem.h:204
This is a view of VerticalLineItem mask.
Definition: LineViews.h:25
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
Allows item movement along x, prevent movement along y.
Definition: LineViews.cpp:98
void onItemDestroyed() override
Definition: LineViews.cpp:109
void onChangedX() override
Definition: LineViews.cpp:56
void onPropertyChange() override
Definition: LineViews.cpp:63
SessionItem * parameterizedItem() const override
Definition: LineViews.cpp:51
QPainterPath shape() const override
Definition: LineViews.cpp:44
int type() const override
Definition: LineViews.h:29
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
Definition: LineViews.cpp:79
VerticalLineView(VerticalLineItem *item)
Definition: LineViews.cpp:29
void update_view() override
Definition: LineViews.cpp:68
~VerticalLineView() override
Definition: LineViews.cpp:39
VerticalLineItem * m_item
Definition: LineViews.h:49