15 #ifndef BORNAGAIN_GUI_VIEW_PLOTSPECULAR_SPECULARPLOT_H
16 #define BORNAGAIN_GUI_VIEW_PLOTSPECULAR_SPECULARPLOT_H
20 #include <qcustomplot.h>
24 class SpecularPlotEvent;
38 QSize
sizeHint()
const override {
return QSize(500, 400); }
Declares class ScientificPlot.
Contains parameters of mouse position in 1D or 2D plot.
Common interface for plot-descriptor interaction.
The SpecularPlot class presents 1D intensity data from SpecularDataItem.
QCustomPlot * customPlot() override
void initPlot()
creates and initializes the color map
void setAxesRangeConnected(bool isConnected)
Connects/disconnects signals related to SpecularPlot's X,Y axes rectangle change.
void setConnected(bool isConnected)
void setAxesLabelsFromItem(SpecularDataItem *item)
Sets X,Y axes labels from item.
SpecularPlot(QWidget *parent=nullptr)
void setLog(bool log)
sets logarithmic scale
PlotEventInfo eventInfo(double xpos, double ypos) const override
Returns PlotEventInfo corresponding to given axes coordinates.
UpdateTimer * m_update_timer
QSize sizeHint() const override
void setUpdateTimerConnected(bool isConnected)
void onXaxisRangeChanged(QCPRange newRange)
Propagate xmin, xmax back to IntensityDataItem.
void setPlotFromItem(SpecularDataItem *specularItem)
Sets initial state of SpecularPlot to match given intensity item.
void initScatter()
Adds scatter ro real data plot.
void setAxesRangeFromItem(SpecularDataItem *item)
Sets (xmin,xmax) and (ymin,ymax) of SpecularPlot from specular item. Also sets logarithmic scale on y...
void modifyAxesProperties(const QString &axisName, const QString &propertyName)
const QCustomPlot * customPlot() const override
void onTimeToReplot()
Replots SpecularPlot.
void setLabel(const BasicAxisItem *item, QCPAxis *axis, QString label)
Sets label to axis.
void onPropertyChanged(const QString &property_name)
updates plot depending on IntensityDataItem properties
QCustomPlot * m_custom_plot
void setDataFromItem(SpecularDataItem *item)
Sets the intensity values to SpecularPlot.
void subscribeToItem() override
SpecularDataItem * specularItem()
QSize minimumSizeHint() const override
void replot()
Schedule replot for later execution by onTimeReplot() slot.
void unsubscribeFromItem() override
void onYaxisRangeChanged(QCPRange newRange)
Propagate ymin, ymax back to IntensityDataItem.
void resetView()
reset all axes min,max to initial value
The UpdateTimer class accumulates update requests during certain period of time, and at the end of th...