BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
PolygonPointView.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Mask/PolygonPointView.h
6 //! @brief Defines PolygonPointView 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_POLYGONPOINTVIEW_H
16 #define BORNAGAIN_GUI_VIEW_MASK_POLYGONPOINTVIEW_H
17 
19 
20 class PolygonPointItem;
21 
22 //! This is a View of polygon point for PolygonMaskItem
23 
25  Q_OBJECT
26 
27 public:
28  int type() const override { return MaskEditorHelper::POLYGONPOINT; }
29 
30  explicit PolygonPointView(PolygonPointItem* item);
31  ~PolygonPointView() override;
32 
33  QRectF boundingRect() const override;
34 
35  SessionItem* parameterizedItem() const override;
36 
37  void updateParameterizedItem(const QPointF& pos);
38 
39 signals:
40  void closePolygonRequest(bool);
42 
43 protected slots:
44  void update_view() override;
45  void onPropertyChange() override;
46 
47 protected:
48  void paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*) override;
49  void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
50  void hoverEnterEvent(QGraphicsSceneHoverEvent* event) override;
51  void hoverLeaveEvent(QGraphicsSceneHoverEvent* event) override;
52 
53 private:
54  void onItemDestroyed() override;
55 
56 private:
58  bool m_on_hover;
59 };
60 
61 #endif // BORNAGAIN_GUI_VIEW_MASK_POLYGONPOINTVIEW_H
Defines interface IShape2DView.
Main interface class for views representing MaskItems, Projections on graphics scene.
Definition: IShape2DView.h:27
This is a View of polygon point for PolygonMaskItem.
SessionItem * parameterizedItem() const override
void closePolygonRequest(bool)
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
void onItemDestroyed() override
void onPropertyChange() override
QRectF boundingRect() const override
void update_view() override
PolygonPointView(PolygonPointItem *item)
PolygonPointItem * m_item
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override
int type() const override
void updateParameterizedItem(const QPointF &pos)
~PolygonPointView() override
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override
void propertyChanged()
Base class for a GUI data item.
Definition: SessionItem.h:204