BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MaskContainerView.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Mask/MaskContainerView.cpp
6 //! @brief Implements MaskContainerView 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 
19 #include <QBrush>
20 #include <QPainter>
21 #include <QStyleOptionGraphicsItem>
22 
24  : IShape2DView(item)
25  , m_item(item)
26 {
27  // the key flag to not to draw children going outside ot given shape
28  setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
29 }
30 
32  : IShape2DView(item)
33  , m_item(item)
34 {
35  setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
36 }
37 
39 {
41 }
42 
44 {
45  return m_item;
46 }
47 
49 {
51  update();
52 }
53 
54 void MaskContainerView::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*)
55 {
56  Q_UNUSED(painter);
57 }
58 
60 {
61  m_item = nullptr;
62 }
Defines interface class ISceneAdaptor.
Defines MaskContainerView class.
Defines MaskItems classes.
Defines items related to projections over color map.
virtual const QRectF & viewportRectangle() const
Returns viewport rectangle in scene coordinates.
Definition: ISceneAdaptor.h:39
Main interface class for views representing MaskItems, Projections on graphics scene.
Definition: IShape2DView.h:27
const ISceneAdaptor * m_adaptor
Definition: IShape2DView.h:67
void disconnectFromItem(SessionItem *item)
QRectF m_bounding_rect
Definition: IShape2DView.h:68
Container holding various masks as children.
Definition: MaskItems.h:202
void onItemDestroyed() override
void update_view() override
SessionItem * parameterizedItem() const override
MaskContainerView(MaskContainerItem *item)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
~MaskContainerView() override
SessionItem * m_item
A container to hold ProjectionItems, intended to store projections of color map on X,...
Base class for a GUI data item.
Definition: SessionItem.h:204