BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
EllipseView.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Mask/EllipseView.h
6 //! @brief Defines EllipseView class
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_ELLIPSEVIEW_H
16 #define BORNAGAIN_GUI_VIEW_MASK_ELLIPSEVIEW_H
17 
19 
20 class EllipseItem;
21 
22 //! This is a View of ellipse mask (represented by EllipseItem) on GraphicsScene.
23 //! Given view follows standard QGraphicsScene notations: (x,y) is top left corner.
24 
26  Q_OBJECT
27 
28 public:
29  int type() const override { return MaskEditorHelper::ELLIPSE; }
30 
31  explicit EllipseView(EllipseItem* item);
32  ~EllipseView() override;
33  SessionItem* parameterizedItem() const override;
34 
35 protected slots:
36  void onChangedX() override;
37  void onChangedY() override;
38  void onPropertyChange() override;
39 
40 protected:
41  QPainterPath shape() const override;
42  void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
43 
44 private:
45  void update_position() override;
46  QRectF mask_rectangle() override;
47  qreal left() const override;
48  qreal right() const override;
49  qreal top() const override;
50  qreal bottom() const override;
51 
52  void onItemDestroyed() override;
53 
54 private:
56 };
57 
58 #endif // BORNAGAIN_GUI_VIEW_MASK_ELLIPSEVIEW_H
Defines RectangleBaseView class.
This is a View of ellipse mask (represented by EllipseItem) on GraphicsScene. Given view follows stan...
Definition: EllipseView.h:25
QRectF mask_rectangle() override
QPainterPath shape() const override
Definition: EllipseView.cpp:96
EllipseView(EllipseItem *item)
Definition: EllipseView.cpp:20
~EllipseView() override
Definition: EllipseView.cpp:26
void onPropertyChange() override
Definition: EllipseView.cpp:45
void update_position() override
updates position of view using item properties
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
Definition: EllipseView.cpp:53
qreal top() const override
Returns the y-coordinate of the rectangle's top edge.
void onChangedY() override
Definition: EllipseView.cpp:38
EllipseItem * m_item
Definition: EllipseView.h:55
int type() const override
Definition: EllipseView.h:29
void onChangedX() override
Definition: EllipseView.cpp:31
void onItemDestroyed() override
SessionItem * parameterizedItem() const override
qreal bottom() const override
Returns the y-coordinate of the rectangle's bottom edge.
qreal left() const override
Returns the x-coordinate of the rectangle's left edge.
qreal right() const override
Returns the x-coordinate of the rectangle's right edge.
Base view for all rectangular-like masks.
Base class for a GUI data item.
Definition: SessionItem.h:204