BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MaskGraphicsProxy Class Reference

Description

Graphics proxy to place QWidget inside QGraphicsScene, used by MaskEditorCanvas.

Definition at line 29 of file MaskGraphicsProxy.h.

Inheritance diagram for MaskGraphicsProxy:
[legend]
Collaboration diagram for MaskGraphicsProxy:
[legend]

Public Member Functions

 MaskGraphicsProxy ()
 
 ~MaskGraphicsProxy () override
 
ColorMapcolorMap ()
 
void setIntensityItem (IntensityDataItem *item)
 
void setInZoomMode (bool value)
 Sets widget to zoom mode, when signals (zoom wheel, mouse clicks) are send down to ColorMap plot. In non-zoom mode, widget doesn't react on clicks. More...
 
void setSceneAdaptor (ISceneAdaptor *sceneAdaptor)
 
int type () const override
 

Protected Member Functions

void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 
void wheelEvent (QGraphicsSceneWheelEvent *event) override
 

Private Attributes

ColorMapm_colorMap
 
ColorMapSceneAdaptorm_sceneAdaptor
 
bool m_send_signals_to_colormap
 

Constructor & Destructor Documentation

◆ MaskGraphicsProxy()

MaskGraphicsProxy::MaskGraphicsProxy ( )

Definition at line 21 of file MaskGraphicsProxy.cpp.

22  : m_colorMap(new ColorMap)
23  , m_sceneAdaptor(nullptr)
25 {
26  resize(1200, 1000);
27  setInZoomMode(true);
28 }
The ColorMap class presents 2D intensity data from IntensityDataItem as color map.
Definition: ColorMap.h:36
ColorMapSceneAdaptor * m_sceneAdaptor
void setInZoomMode(bool value)
Sets widget to zoom mode, when signals (zoom wheel, mouse clicks) are send down to ColorMap plot....

References setInZoomMode().

Here is the call graph for this function:

◆ ~MaskGraphicsProxy()

MaskGraphicsProxy::~MaskGraphicsProxy ( )
override

Definition at line 30 of file MaskGraphicsProxy.cpp.

31 {
32  // no need to delete m_colorMap, base QGraphicsProxyWidget will take care about it
33  if (m_sceneAdaptor)
35 }
void setColorMapPlot(ColorMap *plot)

References m_sceneAdaptor, and ColorMapSceneAdaptor::setColorMapPlot().

Here is the call graph for this function:

Member Function Documentation

◆ colorMap()

ColorMap * MaskGraphicsProxy::colorMap ( )

Definition at line 66 of file MaskGraphicsProxy.cpp.

67 {
68  return m_colorMap;
69 }

References m_colorMap.

Referenced by MaskGraphicsScene::colorMap().

◆ mouseMoveEvent()

void MaskGraphicsProxy::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Definition at line 93 of file MaskGraphicsProxy.cpp.

94 {
96  return;
97  QGraphicsProxyWidget::mouseMoveEvent(event);
98 }

References m_send_signals_to_colormap.

◆ mousePressEvent()

void MaskGraphicsProxy::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Definition at line 71 of file MaskGraphicsProxy.cpp.

72 {
74  return;
75  QGraphicsProxyWidget::mousePressEvent(event);
76  event->accept();
77 }

References m_send_signals_to_colormap.

◆ mouseReleaseEvent()

void MaskGraphicsProxy::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Definition at line 79 of file MaskGraphicsProxy.cpp.

80 {
82  return;
83  QGraphicsProxyWidget::mouseReleaseEvent(event);
84 }

References m_send_signals_to_colormap.

◆ setIntensityItem()

void MaskGraphicsProxy::setIntensityItem ( IntensityDataItem item)

Definition at line 37 of file MaskGraphicsProxy.cpp.

38 {
40  if (widget() != m_colorMap)
41  setWidget(m_colorMap);
42 }
virtual void setItem(SessionItem *item)
IntensityDataItem * intensityDataItem(SessionItem *parent)
Returns IntensityDataItem contained as a child in givent parent.

References GUI::Model::DataItemUtils::intensityDataItem(), m_colorMap, and SessionItemWidget::setItem().

Referenced by MaskGraphicsScene::updateProxyWidget().

Here is the call graph for this function:

◆ setInZoomMode()

void MaskGraphicsProxy::setInZoomMode ( bool  value)

Sets widget to zoom mode, when signals (zoom wheel, mouse clicks) are send down to ColorMap plot. In non-zoom mode, widget doesn't react on clicks.

Definition at line 57 of file MaskGraphicsProxy.cpp.

58 {
60  if (value)
61  setAcceptedMouseButtons(Qt::LeftButton);
62  else
63  setAcceptedMouseButtons(Qt::NoButton);
64 }

References m_send_signals_to_colormap.

Referenced by MaskGraphicsProxy(), and MaskGraphicsScene::setInPanAndZoomMode().

◆ setSceneAdaptor()

void MaskGraphicsProxy::setSceneAdaptor ( ISceneAdaptor sceneAdaptor)

Definition at line 44 of file MaskGraphicsProxy.cpp.

45 {
46  if (m_sceneAdaptor)
48 
49  m_sceneAdaptor = dynamic_cast<ColorMapSceneAdaptor*>(sceneAdaptor);
50 
51  if (m_sceneAdaptor)
53 }
Performs conversion of MaskItems coordinates between ColorMap and GraphicsScene.

References m_colorMap, m_sceneAdaptor, and ColorMapSceneAdaptor::setColorMapPlot().

Referenced by MaskGraphicsScene::~MaskGraphicsScene(), and MaskGraphicsScene::updateProxyWidget().

Here is the call graph for this function:

◆ type()

int MaskGraphicsProxy::type ( ) const
inlineoverride

◆ wheelEvent()

void MaskGraphicsProxy::wheelEvent ( QGraphicsSceneWheelEvent *  event)
overrideprotected

Definition at line 86 of file MaskGraphicsProxy.cpp.

87 {
89  return;
90  QGraphicsProxyWidget::wheelEvent(event);
91 }

References m_send_signals_to_colormap.

Member Data Documentation

◆ m_colorMap

ColorMap* MaskGraphicsProxy::m_colorMap
private

Definition at line 51 of file MaskGraphicsProxy.h.

Referenced by colorMap(), setIntensityItem(), and setSceneAdaptor().

◆ m_sceneAdaptor

ColorMapSceneAdaptor* MaskGraphicsProxy::m_sceneAdaptor
private

Definition at line 52 of file MaskGraphicsProxy.h.

Referenced by ~MaskGraphicsProxy(), and setSceneAdaptor().

◆ m_send_signals_to_colormap

bool MaskGraphicsProxy::m_send_signals_to_colormap
private

The documentation for this class was generated from the following files: