The TranslationYWidget JavaScript class. A translatable arrow in the y axis. More...
Signals | |
void | valueChanged (float y) |
valueChanged signal called when the y translation value has been modified by the Transform tool. More... | |
Signals inherited from WidgetBase | |
void | dragStarted (QScriptValue dragContext) |
signal called on mouse down when picking this widget with the Transform tool More... | |
void | drag (QScriptValue dragContext) |
signal called when this widget is dragged with the Transform tool More... | |
void | dragEnded () |
signal called on mouse up after having manipulated this widget with the Transform tool More... | |
Additional Inherited Members | |
Public Slots inherited from WidgetBase | |
Attribute * | data (int index=0) |
void | updateProperties (QScriptValue properties) |
The TranslationYWidget JavaScript class. A translatable arrow in the y axis.
A translation along the y axis script widget. This widget offers an arrow manipulators that can be dragged in the Camera view while using the Transform tool. Dragging the arrow will generate a translation in the y axis. If no attribute is given at the construction of this object, the object will generate a double floating point attribute.
The following properties are supported by the widget:
Property | Type | Default Value | Description |
---|---|---|---|
data | String | - | The name of the automatically generated double floating point attribute (if none is provided) |
data | Attribute | - | An attribute of double (floating point) type that can be shared with another widget or node. |
radius | float | 0.15 | The radius of the base of the arrow manipulator in field. |
length | float | 1.0 | The lenght of the stick of the arrow manipulator in field. |
color | ColorRGBA | green | The colour of the arrow manipulator. |
selection_color | ColorRGBA | light green | The colour of the arrow manipulator when selected. |
The following components constitute the widget:
Component | Type |
---|---|
attribute | DOUBLE |
drag_manipulator | TRANSLATION_Y |
painter | ARROW_Y |
picker | MONO |
local_transformation | TRANSLATION_Y |
Connect to this scriptWidget valueChanged signal to be notified when a modification has been applied to the widget. In the callback function, transfer the widget value into an action (like modifying a peg attribute value).
The previous example demonstrates how to instantiate a new widget and register it in the Controller global object.
This example shows how to apply the difference in translation of a translation widget on an arbitrary peg in the scene.
|
signal |
valueChanged signal called when the y translation value has been modified by the Transform tool.
y | the new y translation value |