Vuo  2.4.0
VuoInputEditorPoint4d.hh
Go to the documentation of this file.
1
10#pragma once
11
13#include "VuoDoubleSpinBox.hh"
14
15extern "C" {
16#include "VuoPoint4d.h"
17}
18
23{
24 Q_OBJECT
25 Q_PLUGIN_METADATA(IID "org.vuo.inputEditor" FILE "VuoInputEditorPoint4d.json")
26 Q_INTERFACES(VuoInputEditorFactory)
27
28public:
29 virtual VuoInputEditor * newInputEditor(void);
30};
31
52{
53 Q_OBJECT
54
55protected:
56 void setUpDialog(QDialog &dialog, json_object *originalValue, json_object *details);
58
62 virtual bool supportsTabbingBetweenPorts(void) { return true; }
63
64private:
65
66 enum coord
67 {
68 coord_x,
69 coord_y,
70 coord_z,
71 coord_w
72 };
73
74 VuoPoint4d current;
75 map<coord, double> suggestedMinForCoord;
76 map<coord, double> suggestedMaxForCoord;
77 map<coord, double> suggestedStepForCoord;
78
79 map<coord, QSlider*> sliderForCoord;
80 map<coord, VuoDoubleSpinBox*> spinboxForCoord;
81
82 bool getCoordFromQObject(QObject* sender, VuoInputEditorPoint4d::coord* whichCoord) VuoWarnUnusedResult;
83 void setCoord(coord c, double value);
84
85 VuoDoubleSpinBox* initSpinBox(coord whichCoord, QDialog& dialog, double initialValue);
86 QSlider* initSlider(coord whichCoord, QDialog& dialog, double initialValue);
87
88private slots:
89
90 void onSliderUpdate(int sliderValue);
91 void onSpinboxUpdate(QString spinboxValue);
92 void emitValueChanged();
93};