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

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

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

Public Member Functions

 MaskGraphicsProxy ()
 
virtual ~MaskGraphicsProxy ()
 
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. More...
 
void setSceneAdaptor (ISceneAdaptor *sceneAdaptor)
 
int type () const
 

Protected Member Functions

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

Private Attributes

ColorMapm_colorMap
 
ColorMapSceneAdaptorm_sceneAdaptor
 
bool m_send_signals_to_colormap
 

Detailed Description

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

Definition at line 29 of file MaskGraphicsProxy.h.

Constructor & Destructor Documentation

◆ MaskGraphicsProxy()

MaskGraphicsProxy::MaskGraphicsProxy ( )

Definition at line 21 of file MaskGraphicsProxy.cpp.

23 {
24  resize(1200, 1000);
25  setInZoomMode(true);
26 }
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 ( )
virtual

Definition at line 28 of file MaskGraphicsProxy.cpp.

29 {
30  // no need to delete m_colorMap, base QGraphicsProxyWidget will take care about it
31  if (m_sceneAdaptor)
33 }
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 65 of file MaskGraphicsProxy.cpp.

66 {
67  return m_colorMap;
68 }

References m_colorMap.

Referenced by MaskGraphicsScene::colorMap().

◆ mouseMoveEvent()

void MaskGraphicsProxy::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
protected

Definition at line 92 of file MaskGraphicsProxy.cpp.

93 {
95  return;
96  QGraphicsProxyWidget::mouseMoveEvent(event);
97 }

References m_send_signals_to_colormap.

◆ mousePressEvent()

void MaskGraphicsProxy::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protected

Definition at line 70 of file MaskGraphicsProxy.cpp.

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

References m_send_signals_to_colormap.

◆ mouseReleaseEvent()

void MaskGraphicsProxy::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protected

Definition at line 78 of file MaskGraphicsProxy.cpp.

79 {
81  return;
82  QGraphicsProxyWidget::mouseReleaseEvent(event);
83 }

References m_send_signals_to_colormap.

◆ setIntensityItem()

void MaskGraphicsProxy::setIntensityItem ( IntensityDataItem item)

Definition at line 35 of file MaskGraphicsProxy.cpp.

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

References 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 55 of file MaskGraphicsProxy.cpp.

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

References m_send_signals_to_colormap.

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

◆ setSceneAdaptor()

void MaskGraphicsProxy::setSceneAdaptor ( ISceneAdaptor sceneAdaptor)

Definition at line 42 of file MaskGraphicsProxy.cpp.

43 {
44  if (m_sceneAdaptor)
46 
47  m_sceneAdaptor = dynamic_cast<ColorMapSceneAdaptor*>(sceneAdaptor);
48 
49  if (m_sceneAdaptor)
51 }
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
inline

◆ wheelEvent()

void MaskGraphicsProxy::wheelEvent ( QGraphicsSceneWheelEvent *  event)
protected

Definition at line 85 of file MaskGraphicsProxy.cpp.

86 {
88  return;
89  QGraphicsProxyWidget::wheelEvent(event);
90 }

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: