From 2ef88a343443774e24154d5757f3c17b515db2f5 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 26 May 2016 13:27:29 +0200 Subject: spline-widget: move more from header --- spline-widget/functionconfig.cpp | 31 +++++++++++++++++++++++++++++++ spline-widget/functionconfig.h | 18 +++++------------- 2 files changed, 36 insertions(+), 13 deletions(-) (limited to 'spline-widget') diff --git a/spline-widget/functionconfig.cpp b/spline-widget/functionconfig.cpp index 5390e9bd..5c5740d2 100644 --- a/spline-widget/functionconfig.cpp +++ b/spline-widget/functionconfig.cpp @@ -27,6 +27,37 @@ Map::Map() : Map(0, 0) { } +void Map::removeAllPoints() +{ + QMutexLocker foo(&_mutex); + cur.input.clear(); + reload(); +} + +void Map::setMaxInput(double max_input) +{ + QMutexLocker l(&_mutex); + max_x = max_input; +} + +void Map::setMaxOutput(double max_output) +{ + QMutexLocker l(&_mutex); + max_y = max_output; +} + +double Map::maxInput() const +{ + QMutexLocker l(&_mutex); + return max_x; +} + +double Map::maxOutput() const +{ + QMutexLocker l(&_mutex); + return max_y; +} + Map::Map(double maxx, double maxy) : _mutex(QMutex::Recursive), max_x(0), diff --git a/spline-widget/functionconfig.h b/spline-widget/functionconfig.h index cac3c65c..4db24b84 100644 --- a/spline-widget/functionconfig.h +++ b/spline-widget/functionconfig.h @@ -44,29 +44,21 @@ private: volatile bool activep; State cur, saved; public: - double maxInput() const { return max_x; } - double maxOutput() const { return max_y; } + double maxInput() const; + double maxOutput() const; Map(); Map(double maxx, double maxy); float getValue(float x); bool getLastPoint(QPointF& point); void removePoint(int i); - void removeAllPoints() { - QMutexLocker foo(&_mutex); - cur.input.clear(); - reload(); - } + void removeAllPoints(); void addPoint(QPointF pt); void movePoint(int idx, QPointF pt); const QList getPoints(); - void setMaxInput(double MaxInput) { - max_x = MaxInput; - } - void setMaxOutput(double MaxOutput) { - max_y = MaxOutput; - } + void setMaxInput(double MaxInput); + void setMaxOutput(double MaxOutput); void saveSettings(QSettings& settings, const QString& title); void loadSettings(QSettings& settings, const QString& title); -- cgit v1.2.3