15 #ifndef BORNAGAIN_GUI_VIEW_PLOTUTIL_COLORMAP_H
16 #define BORNAGAIN_GUI_VIEW_PLOTUTIL_COLORMAP_H
22 #include <qcustomplot.h>
40 explicit ColorMap(QWidget* parent =
nullptr);
42 QSize
sizeHint()
const override {
return QSize(500, 400); }
Declares class ScientificPlot.
The ColorMap class presents 2D intensity data from IntensityDataItem as color map.
UpdateTimer * m_updateTimer
QRectF viewportRectangleInWidgetCoordinates()
Returns rectangle representing current axes zoom state in widget coordinates.
void setAxesRangeFromItem(IntensityDataItem *item)
Sets (xmin,xmax,nbins) and (ymin,ymax,nbins) of ColorMap from intensity item.
const QCustomPlot * customPlot() const override
QCPLayoutGrid * m_colorBarLayout
ColorMap(QWidget *parent=nullptr)
void setUpdateTimerConnected(bool isConnected)
PlotEventInfo eventInfo(double xpos, double ypos) const override
Returns PlotEventInfo corresponding to given axes coordinates.
void setConnected(bool isConnected)
void setFixedColorMapMargins()
to make fixed margins for whole colormap (change in axes labels wont affect axes rectangle)
void replot()
Schedule replot for later execution by onTimeReplot() slot.
void unsubscribeFromItem() override
QCPColorScale * colorScale()
void onYaxisRangeChanged(QCPRange newRange)
Propagate ymin, ymax back to IntensityDataItem.
void initColorMap()
creates and initializes the color map
QSize minimumSizeHint() const override
void marginsChanged(double left, double right)
void setAxesRangeConnected(bool isConnected)
Connects/disconnects signals related to ColorMap's X,Y axes rectangle change.
QCustomPlot * customPlot() override
void setAxesLabelsFromItem(IntensityDataItem *item)
Sets X,Y axes labels from item.
void setDataRangeFromItem(IntensityDataItem *item)
void setColorMapFromItem(IntensityDataItem *intensityItem)
Sets initial state of ColorMap to match given intensity item.
void setDataRangeConnected(bool isConnected)
Connects/disconnects signals related to ColorMap's Z-axis (min,max) change.
void onPropertyChanged(const QString &property_name)
updates color map depending on IntensityDataItem properties
void onAxisPropertyChanged(const QString &axisName, const QString &propertyName)
void onTimeToReplot()
Replots ColorMap.
void subscribeToItem() override
QCPColorScale * m_colorScale
void onDataRangeChanged(QCPRange newRange)
Propagate zmin, zmax back to IntensityDataItem.
void setColorScaleAppearanceFromItem(IntensityDataItem *item)
Sets the appearance of color scale (visibility, gradient type) from intensity item.
IntensityDataItem * intensityItem()
void setDataFromItem(IntensityDataItem *item)
Sets the intensity values to ColorMap.
void resetView()
reset all axes min,max to initial value
void setLogz(bool logz)
sets logarithmic scale
void onIntensityModified()
void onXaxisRangeChanged(QCPRange newRange)
Propagate xmin, xmax back to IntensityDataItem.
QCustomPlot * m_customPlot
void setColorScaleVisible(bool visibility_flag)
QSize sizeHint() const override
void marginsChangedNotify()
Calculates left, right margins around color map to report to projection plot.
void setAxesZoomFromItem(IntensityDataItem *item)
Sets zoom range of X,Y axes as in intensity item.
Contains parameters of mouse position in 1D or 2D plot.
Helps ScientificPlot to handle mouse events. Particularly, it constructs a valid status string....
Common interface for plot-descriptor interaction.
The UpdateTimer class accumulates update requests during certain period of time, and at the end of th...