summaryrefslogtreecommitdiffhomepage
path: root/spline/axis-opts.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-10-20 17:53:21 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-10-20 17:53:21 +0200
commit39e209983bd1f04fb0beefef754d7430c8b7fb9f (patch)
treeec41545dda2d33d316adc6466f21138a280db6a8 /spline/axis-opts.hpp
parent092e2910ae8f6c2e188e930b9540d58e145c9142 (diff)
logic, spline: more spline work/fixes
- mapping window clamps are now value<max_clamp> in spline - clamp won't mess up saved spline content - clean up artifacts on spline widget
Diffstat (limited to 'spline/axis-opts.hpp')
-rw-r--r--spline/axis-opts.hpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/spline/axis-opts.hpp b/spline/axis-opts.hpp
new file mode 100644
index 00000000..ad94236c
--- /dev/null
+++ b/spline/axis-opts.hpp
@@ -0,0 +1,53 @@
+#pragma once
+
+#include "options/options.hpp"
+using namespace options;
+#include "api/plugin-api.hpp"
+
+#include "export.hpp"
+
+struct OTR_SPLINE_EXPORT axis_opts final
+{
+ enum max_clamp
+ {
+ r180 = 180,
+ r90 = 90,
+ r60 = 60,
+ r45 = 45,
+ r30 = 30,
+ r25 = 25,
+ r20 = 20,
+ r15 = 15,
+ r10 = 10,
+
+ t100 = 100,
+ t30 = 30,
+ t20 = 20,
+ t15 = 15,
+ t10 = 10,
+
+ o_r180 = -180,
+ o_r90 = -90,
+ o_t75 = -75,
+
+ x1000 = 1000,
+ };
+
+ // note, these two bundles can be the same value with no issues
+ bundle b_settings_window, b_mapping_window;
+ value<double> zero;
+ value<int> src;
+ value<bool> invert, altp;
+ value<max_clamp> clamp_x_, clamp_y_;
+ double max_clamp_x() const { return std::fabs(clamp_x_.to<double>()); }
+ double max_clamp_y() const { return std::fabs(clamp_y_.to<double>()); }
+ axis_opts(QString pfx, Axis idx);
+
+ QString const& prefix() const;
+ Axis axis() const;
+private:
+ static inline QString n(QString pfx, QString name);
+
+ QString prefix_;
+ Axis axis_;
+};