From df6493999bbd9e230e263e511c25f9b6f388ced9 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Wed, 27 Dec 2023 11:48:37 +0100 Subject: [PATCH] replot fcts -> SciPlot --- GUI/View/Plotter/ColorMap.cpp | 14 -------------- GUI/View/Plotter/ColorMap.h | 2 -- GUI/View/Plotter/ScientificPlot.cpp | 10 ++++++++++ GUI/View/Plotter/ScientificPlot.h | 3 +++ GUI/View/Plotter/SpecularPlot.cpp | 10 ---------- GUI/View/Plotter/SpecularPlot.h | 6 ------ 6 files changed, 13 insertions(+), 32 deletions(-) diff --git a/GUI/View/Plotter/ColorMap.cpp b/GUI/View/Plotter/ColorMap.cpp index de052a4edf7..e6a19e8b5db 100644 --- a/GUI/View/Plotter/ColorMap.cpp +++ b/GUI/View/Plotter/ColorMap.cpp @@ -222,20 +222,6 @@ void ColorMap::onYaxisRangeChanged(QCPRange range) gDoc->setModified(); } -//! Schedule replot for later execution by onTimeReplot() slot. - -void ColorMap::replot() -{ - m_update_timer->scheduleUpdate(); -} - -//! Replots ColorMap. - -void ColorMap::onTimeToReplot() -{ - m_qcp->replot(); -} - //! Connects/disconnects signals related to ColorMap's X,Y axes rectangle change. void ColorMap::setAxesRangeConnected(bool isConnected) diff --git a/GUI/View/Plotter/ColorMap.h b/GUI/View/Plotter/ColorMap.h index a3421487207..de234d4b39f 100644 --- a/GUI/View/Plotter/ColorMap.h +++ b/GUI/View/Plotter/ColorMap.h @@ -57,8 +57,6 @@ private: void onDataRangeChanged(QCPRange range); void onXaxisRangeChanged(QCPRange range); void onYaxisRangeChanged(QCPRange range); - void replot(); - void onTimeToReplot(); void marginsChangedNotify(); void setAxesRangeConnected(bool isConnected); diff --git a/GUI/View/Plotter/ScientificPlot.cpp b/GUI/View/Plotter/ScientificPlot.cpp index c9e3eea89a5..60c43e2a32d 100644 --- a/GUI/View/Plotter/ScientificPlot.cpp +++ b/GUI/View/Plotter/ScientificPlot.cpp @@ -77,3 +77,13 @@ qreal ScientificPlot::fromSceneY(qreal p) const { return m_qcp->yAxis->pixelToCoord(p); } + +void ScientificPlot::replot() +{ + m_update_timer->scheduleUpdate(); +} + +void ScientificPlot::onTimeToReplot() +{ + m_qcp->replot(); +} diff --git a/GUI/View/Plotter/ScientificPlot.h b/GUI/View/Plotter/ScientificPlot.h index d9a5ebe4155..ad9b077cd6c 100644 --- a/GUI/View/Plotter/ScientificPlot.h +++ b/GUI/View/Plotter/ScientificPlot.h @@ -61,6 +61,9 @@ signals: void statusString(const QString& text); protected: + void replot(); + void onTimeToReplot(); + QCustomPlot* m_qcp; UpdateTimer* m_update_timer; diff --git a/GUI/View/Plotter/SpecularPlot.cpp b/GUI/View/Plotter/SpecularPlot.cpp index 59fc7a7b61e..aa8afbb3667 100644 --- a/GUI/View/Plotter/SpecularPlot.cpp +++ b/GUI/View/Plotter/SpecularPlot.cpp @@ -119,11 +119,6 @@ void SpecularPlot::onYaxisRangeChanged(QCPRange range) const emit currentData1DItem()->updateOtherPlots(currentData1DItem()); } -void SpecularPlot::onTimeToReplot() -{ - m_qcp->replot(); -} - void SpecularPlot::connectItems() { // data @@ -281,11 +276,6 @@ void SpecularPlot::setDataFromItem(Data1DItem* item) } } -void SpecularPlot::replot() -{ - m_update_timer->scheduleUpdate(); -} - namespace { int bin(double x, const QCPGraph* graph) diff --git a/GUI/View/Plotter/SpecularPlot.h b/GUI/View/Plotter/SpecularPlot.h index ba47c8605dd..355b627fba8 100644 --- a/GUI/View/Plotter/SpecularPlot.h +++ b/GUI/View/Plotter/SpecularPlot.h @@ -55,9 +55,6 @@ private: //! Propagate ymin, ymax back to Data2DItem void onYaxisRangeChanged(QCPRange range) const; - //! Replots SpecularPlot. - void onTimeToReplot(); - void connectItems(); //! creates and initializes the color map @@ -85,9 +82,6 @@ private: //! Sets the data values to SpecularPlot. void setDataFromItem(Data1DItem* item); - //! Schedule replot for later execution by onTimeReplot() slot. - void replot(); - QList<Data1DItem*> m_data_items; QMap<Data1DItem*, QCPGraph*> m_graph_map; -- GitLab