diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-26 09:29:10 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-26 09:29:10 +0200 |
commit | 52f67dee52a484e8a2eed0c527777c1d341a2294 (patch) | |
tree | 4c8d7cdc7c960782752bd6166ed10250759dc61e /qfunctionconfigurator/functionconfig.h | |
parent | 0f24550bcce54f7b1265605c005c382b5f80fa5f (diff) |
qfc: abstract away internally-used data type
Also, change value_type to more sensible value
Diffstat (limited to 'qfunctionconfigurator/functionconfig.h')
-rw-r--r-- | qfunctionconfigurator/functionconfig.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/qfunctionconfigurator/functionconfig.h b/qfunctionconfigurator/functionconfig.h index a8b46597..446c73ac 100644 --- a/qfunctionconfigurator/functionconfig.h +++ b/qfunctionconfigurator/functionconfig.h @@ -18,16 +18,17 @@ class Map { private: + static constexpr int value_count = 5000; + using num = float; + struct State { QList<QPointF> input; - std::vector<float> data; + std::vector<num> data; }; - static constexpr int value_count = 9001; - int precision() const; void reload(); - float getValueInternal(int x); + num getValueInternal(int x); MyMutex _mutex; QPointF last_input_value; @@ -46,7 +47,7 @@ public: setMaxOutput(maxy); } - float getValue(float x); + num getValue(num x); bool getLastPoint(QPointF& point); void removePoint(int i); void removeAllPoints() { |