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

Description

The ColorMapCanvas class contains ColorMap for intensity data presentation, and provide control of font size, status string appearance, defines common actions (reset view, save plot, show context menu).

Definition at line 30 of file ColorMapCanvas.h.

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

Public Slots

void onStatusString (const QString &name)
 

Public Member Functions

 ColorMapCanvas (QWidget *parent=nullptr)
 
virtual QList< QAction * > actionList ()
 
ColorMapcolorMap ()
 
SessionItemcurrentItem ()
 
const SessionItemcurrentItem () const
 
QCustomPlot * customPlot ()
 
void setItem (SessionItem *intensityDataItem) override
 
void setStatusLabelEnabled (bool flag)
 

Protected Member Functions

void hideEvent (QHideEvent *) override
 
void showEvent (QShowEvent *) override
 
virtual void subscribeToItem ()
 
virtual void unsubscribeFromItem ()
 

Private Attributes

FontScalingEventm_canvasEvent
 
ColorMapm_colorMap
 
SessionItemControllerm_itemController
 
PlotStatusLabelm_statusLabel
 

Constructor & Destructor Documentation

◆ ColorMapCanvas()

ColorMapCanvas::ColorMapCanvas ( QWidget *  parent = nullptr)
explicit

Definition at line 23 of file ColorMapCanvas.cpp.

24  : SessionItemWidget(parent)
25  , m_colorMap(new ColorMap)
28 {
29  this->installEventFilter(m_canvasEvent);
30  auto* layout = new QVBoxLayout;
31  layout->setMargin(0);
32  layout->setSpacing(0);
33 
34  layout->addWidget(m_colorMap);
35  layout->addWidget(m_statusLabel);
36 
37  setLayout(layout);
38 
39  setStatusLabelEnabled(false);
40 }
ColorMap * m_colorMap
PlotStatusLabel * m_statusLabel
void setStatusLabelEnabled(bool flag)
FontScalingEvent * m_canvasEvent
The ColorMap class presents 2D intensity data from IntensityDataItem as color map.
Definition: ColorMap.h:36
Provides event filter for ScientificPlot. Its goal is to make font size adjustments on resize events.
The PlotStatusLabel class shows status string as reported by DescriptedPlot in a frame....
SessionItemWidget(QWidget *parent=nullptr)

References m_canvasEvent, m_colorMap, m_statusLabel, and setStatusLabelEnabled().

Here is the call graph for this function:

Member Function Documentation

◆ actionList()

QList< QAction * > SessionItemWidget::actionList ( )
virtualinherited

◆ colorMap()

ColorMap * ColorMapCanvas::colorMap ( )

Definition at line 48 of file ColorMapCanvas.cpp.

49 {
50  return m_colorMap;
51 }

References m_colorMap.

Referenced by FitComparisonWidget::subscribeToItem().

◆ currentItem() [1/2]

◆ currentItem() [2/2]

const SessionItem * SessionItemWidget::currentItem ( ) const
inherited

Definition at line 46 of file SessionItemWidget.cpp.

47 {
48  return m_itemController->currentItem();
49 }
SessionItemController * m_itemController

References SessionItemController::currentItem(), and SessionItemWidget::m_itemController.

Here is the call graph for this function:

◆ customPlot()

QCustomPlot * ColorMapCanvas::customPlot ( )

Definition at line 53 of file ColorMapCanvas.cpp.

54 {
55  return m_colorMap->customPlot();
56 }
QCustomPlot * customPlot() override
Definition: ColorMap.h:45

References ColorMap::customPlot(), and m_colorMap.

Referenced by IntensityDataCanvas::IntensityDataCanvas(), and IntensityDataCanvas::onSavePlotAction().

Here is the call graph for this function:

◆ hideEvent()

void SessionItemWidget::hideEvent ( QHideEvent *  )
overrideprotectedinherited

Definition at line 56 of file SessionItemWidget.cpp.

57 {
59 }
void unsubscribe()
Fully unsubscribes the parent from listening item's signals. Controller stays active to track item de...

References SessionItemWidget::m_itemController, and SessionItemController::unsubscribe().

Here is the call graph for this function:

◆ onStatusString

void ColorMapCanvas::onStatusString ( const QString &  name)
slot

Definition at line 64 of file ColorMapCanvas.cpp.

65 {
67 }
void setText(const QString &text)
Definition: StatusLabel.cpp:42
QString const & name(EShape k)
Definition: particles.cpp:20

References m_statusLabel, GUI::RealSpace::Particles::name(), and StatusLabel::setText().

Here is the call graph for this function:

◆ setItem()

void ColorMapCanvas::setItem ( SessionItem intensityDataItem)
overridevirtual

Reimplemented from SessionItemWidget.

Definition at line 42 of file ColorMapCanvas.cpp.

43 {
46 }
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 IntensityDataCanvas::setItem(), and FitComparisonWidget::subscribeToItem().

Here is the call graph for this function:

◆ setStatusLabelEnabled()

void ColorMapCanvas::setStatusLabelEnabled ( bool  flag)

Definition at line 58 of file ColorMapCanvas.cpp.

59 {
61  m_statusLabel->setHidden(!flag);
62 }
void setLabelEnabled(bool flag)
Enables/disables label. If disabled, all colorMaps are disconnected and label is hiding.

References m_statusLabel, and PlotStatusLabel::setLabelEnabled().

Referenced by ColorMapCanvas(), and IntensityDataCanvas::IntensityDataCanvas().

Here is the call graph for this function:

◆ showEvent()

void SessionItemWidget::showEvent ( QShowEvent *  )
overrideprotectedinherited

Definition at line 51 of file SessionItemWidget.cpp.

52 {
54 }
void subscribe()
Subscribe parent to item's signals.

References SessionItemWidget::m_itemController, and SessionItemController::subscribe().

Here is the call graph for this function:

◆ subscribeToItem()

◆ unsubscribeFromItem()

virtual void SessionItemWidget::unsubscribeFromItem ( )
inlineprotectedvirtualinherited

Member Data Documentation

◆ m_canvasEvent

FontScalingEvent* ColorMapCanvas::m_canvasEvent
private

Definition at line 48 of file ColorMapCanvas.h.

Referenced by ColorMapCanvas().

◆ m_colorMap

ColorMap* ColorMapCanvas::m_colorMap
private

Definition at line 47 of file ColorMapCanvas.h.

Referenced by ColorMapCanvas(), colorMap(), customPlot(), and setItem().

◆ m_itemController

◆ m_statusLabel

PlotStatusLabel* ColorMapCanvas::m_statusLabel
private

Definition at line 49 of file ColorMapCanvas.h.

Referenced by ColorMapCanvas(), onStatusString(), and setStatusLabelEnabled().


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