15 #ifndef BORNAGAIN_GUI_VIEW_PLOTCOMPARISON_PLOT1D_H
16 #define BORNAGAIN_GUI_VIEW_PLOTCOMPARISON_PLOT1D_H
19 #include <qcustomplot.h>
25 class SpecularPlotEvent;
36 explicit Plot1D(QWidget* parent =
nullptr);
38 QSize
sizeHint()
const override {
return QSize(500, 400); }
Declares class ScientificPlot.
Holds data required for 1D DataItem representation.
View model for 1D DataItem. Can represent several items at once. In current implementation the first ...
Abstract base class for IntensityDataItem and SpecularDataItem. Owns one simulated data set of type D...
The Plot1D class presents data of several 1D DataItems contained in a Data1DViewItem....
void onTimeToReplot()
Replots SpecularPlot.
QCustomPlot * customPlot() override
void updateAllGraphs()
Sets data to graphs.
void initPlots()
creates and initializes the color map
void setAxesRangeConnected(bool isConnected)
Connects/disconnects signals related to SpecularPlot's X,Y axes rectangle change.
void resetView()
reset all axes min,max to initial value
QSize minimumSizeHint() const override
Plot1D(QWidget *parent=nullptr)
void setAxesLabelsFromItem(Data1DViewItem *item)
Sets X,Y axes labels from item.
void setAxesRangeFromItem(Data1DViewItem *item)
Sets (xmin,xmax) and (ymin,ymax) of SpecularPlot from specular item. Also sets logarithmic scale on y...
void setConnected(bool isConnected)
void refreshPlotData()
Refresh axes' labels, range and graph data.
const QCustomPlot * customPlot() const override
void setUpdateTimerConnected(bool isConnected)
QSize sizeHint() const override
void replot()
Schedule replot for later execution by onTimeReplot() slot.
QCustomPlot * m_custom_plot
UpdateTimer * m_update_timer
PlotEventInfo eventInfo(double xpos, double ypos) const override
Returns PlotEventInfo corresponding to given axes coordinates.
void updateGraph(Data1DProperties *item)
Sets data to the graph corresponding to the passed Data1DProperties.
void onPropertyChanged(const QString &property_name)
updates plot depending on IntensityDataItem properties
void onYaxisRangeChanged(QCPRange newRange)
Propagate ymin, ymax back to IntensityDataItem.
void setLog(bool log)
sets logarithmic scale
Data1DViewItem * viewItem()
void unsubscribeFromItem() override
std::map< Data1DProperties *, QCPGraph * > m_graph_map
void setLabel(const BasicAxisItem *item, QCPAxis *axis, QString label)
Sets label to axis.
void onXaxisRangeChanged(QCPRange newRange)
Propagate xmin, xmax back to IntensityDataItem.
void modifyAxesProperties(const QString &axisName, const QString &propertyName)
void subscribeToItem() override
Contains parameters of mouse position in 1D or 2D plot.
Common interface for plot-descriptor interaction.
The UpdateTimer class accumulates update requests during certain period of time, and at the end of th...