BornAgain  1.19.0
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/coregui/Views/MaskWidgets/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_COREGUI_VIEWS_MASKWIDGETS_LINEVIEWS_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_MASKWIDGETS_LINEVIEWS_H
17 
19 
20 //! This is a view of VerticalLineItem mask
21 
23  Q_OBJECT
24 
25 public:
26  int type() const { return MaskEditorHelper::VERTICALLINE; }
27 
29 
30 protected slots:
31  virtual void update_view();
32  virtual void onChangedX();
33  virtual void onPropertyChange(const QString& propertyName);
34 
35 protected:
36  void paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*);
37  QVariant itemChange(GraphicsItemChange change, const QVariant& value);
38 };
39 
40 //! This is a view of HorizontalLineItem mask
41 
43  Q_OBJECT
44 
45 public:
46  int type() const { return MaskEditorHelper::HORIZONTALLINE; }
47 
49 
50 protected slots:
51  virtual void update_view();
52  virtual void onChangedY();
53  virtual void onPropertyChange(const QString& propertyName);
54 
55 protected:
56  void paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*);
57  QVariant itemChange(GraphicsItemChange change, const QVariant& value);
58 };
59 
60 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_MASKWIDGETS_LINEVIEWS_H
Defines interface IShape2DView.
This is a view of HorizontalLineItem mask.
Definition: LineViews.h:42
virtual void onPropertyChange(const QString &propertyName)
Definition: LineViews.cpp:106
virtual void update_view()
Definition: LineViews.cpp:112
int type() const
Definition: LineViews.h:46
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
Definition: LineViews.cpp:123
virtual void onChangedY()
Definition: LineViews.cpp:99
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Allows item movement along y, prevent movement along x.
Definition: LineViews.cpp:142
Main interface class for views representing MaskItems, Projections on graphics scene.
Definition: IShape2DView.h:27
This is a view of VerticalLineItem mask.
Definition: LineViews.h:22
virtual void onChangedX()
Definition: LineViews.cpp:35
virtual void update_view()
Definition: LineViews.cpp:48
virtual void onPropertyChange(const QString &propertyName)
Definition: LineViews.cpp:42
int type() const
Definition: LineViews.h:26
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
Definition: LineViews.cpp:59
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Allows item movement along x, prevent movement along y.
Definition: LineViews.cpp:78