Vuo  2.4.0
VuoInputEditorPoint3d.hh
Go to the documentation of this file.
1
10#pragma once
11
13#include "VuoDoubleSpinBox.hh"
14
15extern "C" {
16#include "VuoPoint3d.h"
17}
18
23{
24 Q_OBJECT
25 Q_PLUGIN_METADATA(IID "org.vuo.inputEditor" FILE "VuoInputEditorPoint3d.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 };
72
73 VuoPoint3d current;
74 map<coord, double> suggestedMinForCoord;
75 map<coord, double> suggestedMaxForCoord;
76 map<coord, double> suggestedStepForCoord;
77
78 map<coord, QSlider*> sliderForCoord;
79 map<coord, VuoDoubleSpinBox*> spinboxForCoord;
80
81 bool getCoordFromQObject(QObject* sender, VuoInputEditorPoint3d::coord* whichCoord) VuoWarnUnusedResult;
82 void setCoord(coord c, double value);
83
84 VuoDoubleSpinBox* initSpinBox(coord whichCoord, QDialog& dialog, double initialValue);
85 QSlider* initSlider(coord whichCoord, QDialog& dialog, double initialValue);
86
87private slots:
88
89 void onSliderUpdate(int sliderValue);
90 void onSpinboxUpdate(QString spinboxValue);
91 void emitValueChanged();
92};