From 0b07159f32b28f775771ea37a4fa48fa94ef2d9e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 5 Sep 2016 17:13:43 +0200 Subject: spline-widget: add point count getter --- spline-widget/spline.cpp | 6 ++++++ spline-widget/spline.hpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spline-widget/spline.cpp b/spline-widget/spline.cpp index 4f60181e..7d0c8412 100644 --- a/spline-widget/spline.cpp +++ b/spline-widget/spline.cpp @@ -269,6 +269,12 @@ QList spline::getPoints() const return s->points; } +int spline::get_point_count() const +{ + QMutexLocker foo(&_mutex); + return s->points.get().size(); +} + void spline::reload() { QMutexLocker foo(&_mutex); diff --git a/spline-widget/spline.hpp b/spline-widget/spline.hpp index 75a9e95e..299c7636 100644 --- a/spline-widget/spline.hpp +++ b/spline-widget/spline.hpp @@ -41,7 +41,7 @@ signals: class OPENTRACK_SPLINE_EXPORT spline final { - int precision(const QList& points) const; + double precision(const QList& points) const; void update_interp_data(); float getValueInternal(int x); void add_lone_point(); @@ -98,4 +98,5 @@ public: mem get_settings() const; using points_t = decltype(s->points.get()); + int get_point_count() const; }; -- cgit v1.2.3