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

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). More...

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

Classes

struct  ColorMapCanvasImpl
 

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)
 
void setStatusLabelEnabled (bool flag)
 

Protected Member Functions

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

Private Attributes

FontScalingEventm_canvasEvent
 
ColorMapm_colorMap
 
SessionItemControllerm_itemController
 
PlotStatusLabelm_statusLabel
 

Detailed 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.

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  QVBoxLayout* 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.
The PlotStatusLabel class shows status string as reported by DescriptedPlot in a frame.
SessionItemWidget(QWidget *parent=0)

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]

SessionItem * SessionItemWidget::currentItem ( )
inherited

Definition at line 41 of file SessionItemWidget.cpp.

42 {
43  return const_cast<SessionItem*>(static_cast<const SessionItemWidget*>(this)->currentItem());
44 }
The SessionItemWidget class is a base for all widgets representing the content of SessionItem.
SessionItem * currentItem()

Referenced by RectangularDetectorEditor::detectorItem(), SphericalDetectorEditor::detectorItem(), FitFlowWidget::fitSuiteItem(), DistributionEditor::groupItem(), DepthProbeInstrumentEditor::instrumentItem(), EnvironmentEditor::instrumentItem(), GISASBeamEditor::instrumentItem(), GISASDetectorEditor::instrumentItem(), GISASInstrumentEditor::instrumentItem(), OffSpecularBeamEditor::instrumentItem(), OffSpecularInstrumentEditor::instrumentItem(), PolarizationAnalysisEditor::instrumentItem(), SpecularBeamEditor::instrumentItem(), SpecularInstrumentEditor::instrumentItem(), RealDataMaskWidget::intensityDataItem(), IntensityDataCanvas::intensityDataItem(), IntensityDataProjectionsWidget::intensityDataItem(), IntensityDataWidget::intensityDataItem(), ProjectionsPlot::intensityItem(), ColorMap::intensityItem(), DetectorPresenter::itemPresentation(), InstrumentPresenter::itemPresentation(), JobResultsPresenter::itemPresentation(), FitComparisonWidget::jobItem(), FitComparisonWidget1D::jobItem(), FitParameterWidget::jobItem(), RunFitControlWidget::jobItem(), JobPropertiesWidget::jobItem(), ParameterTuningWidget::jobItem(), SpecularDataImportWidget::realDataItem(), ItemComboWidget::setPresentation(), JobResultsPresenter::setPresentation(), SpecularDataCanvas::specularDataItem(), SpecularDataImportWidget::specularDataItem(), SpecularDataWidget::specularDataItem(), SpecularPlot::specularItem(), ItemComboWidget::subscribeToItem(), DistributionEditor::subscribeToItem(), GISASDetectorEditor::subscribeToItem(), PolarizationAnalysisEditor::subscribeToItem(), IntensityDataPropertyWidget::subscribeToItem(), JobPropertiesWidget::subscribeToItem(), ProjectionsPropertyPanel::subscribeToItem(), ProjectionsPlot::unsubscribeFromChildren(), and Plot1D::viewItem().

◆ 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 *  )
protectedvirtualinherited

Definition at line 56 of file SessionItemWidget.cpp.

57 {
59 }
void unsubscribe()
Fully unsubscribes the parent from listening item's signals.

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:39
QString const & name(EShape k)
Definition: particles.cpp:21

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

Here is the call graph for this function:

◆ setItem()

void ColorMapCanvas::setItem ( SessionItem intensityDataItem)
virtual

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 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 *  )
protectedvirtualinherited

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()

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: