| 1 |
NAME SoTranslate2Dragger SoXlate2Drag "" { object you can translate within a plane by dragging with the mouse } |
| 2 |
|
| 3 |
INCLUDE draggers/SoTranslate2Dragger.h |
| 4 |
|
| 5 |
DESC { \cSoTranslate2Dragger\. |
| 6 |
is a simple dragger that translates |
| 7 |
in two dimensions when dragged with the mouse. |
| 8 |
It moves within the x-y plane of its local space, determined by its |
| 9 |
location in the scene graph. |
| 10 |
Transformation nodes placed before it will |
| 11 |
affect both the dragger and the direction of motion. |
| 12 |
\p |
| 13 |
Pressing the \k<Shift>\. key allows you to constrain motion to either the |
| 14 |
x axis or the y axis. The direction is determined by your initial |
| 15 |
mouse gesture after pressing the key. Releasing the key removes the constraint. |
| 16 |
\p |
| 17 |
This node has a \vtranslation\. field |
| 18 |
which always reflects |
| 19 |
its position in local space. |
| 20 |
If you set the field, the dragger will move accordingly. |
| 21 |
You can also connect fields of other nodes or engines from |
| 22 |
this one |
| 23 |
to make them follow the dragger's motion. |
| 24 |
\p |
| 25 |
This dragger contains six parts, \etranslator\., \etranslatorActive\., |
| 26 |
\efeedback\., \efeedbackActive\., \exAxisFeedback\., and \eyAxisFeedback\.. |
| 27 |
The last two parts are only displayed during motion, and only when their |
| 28 |
direction of motion is enabled. (Pressing the \k<Shift>\. key and then |
| 29 |
dragging disables one of the two directions.) |
| 30 |
\p |
| 31 |
Each of these is set by default from |
| 32 |
a resource described in the \kDragger Resources\. section of the online |
| 33 |
reference page for this class. You |
| 34 |
can change the parts in any instance of this dragger using |
| 35 |
\m\+setPart()\.\-SoDraggerSetPart()\.\.. |
| 36 |
\p |
| 37 |
You can make your program use different default resources for the parts |
| 38 |
by copying the file |
| 39 |
\v/usr/share/data/draggerDefaults/translate2Dragger.iv\. |
| 40 |
into your own directory, editing the file, and then |
| 41 |
setting the environment variable \vSO_DRAGGER_DIR\. to be a path to that directory. |
| 42 |
} |
| 43 |
|
| 44 |
METHOD "" SoTranslate2Dragger() { |
| 45 |
Constructor. |
| 46 |
} |
| 47 |
|
| 48 |
METHOD getClassNkitCat static |
| 49 |
const SoNodekitCatalog *getClassNodekitCatalog() const |
| 50 |
{ Returns an \cSoNodekitCatalog\. for this class } |
| 51 |
|
| 52 |
METHOD "" static SoType getClassTypeId() { |
| 53 |
Returns type identifier for this class. |
| 54 |
} |
| 55 |
|
| 56 |
FIELD translation { Position of the dragger. } |
| 57 |
|
| 58 |
DRAGGER_RESOURCE { |
| 59 |
translate2Translator, |
| 60 |
translator, |
| 61 |
"pair of white crossing arrows", |
| 62 |
"picking this initiates translation" |
| 63 |
} |
| 64 |
|
| 65 |
DRAGGER_RESOURCE { |
| 66 |
translate2TranslatorActive, |
| 67 |
translatorActive, |
| 68 |
"pair of yellow crossing arrows", |
| 69 |
"displayed during translation instead of the translator" |
| 70 |
} |
| 71 |
|
| 72 |
DRAGGER_RESOURCE { |
| 73 |
translate2Feedback, |
| 74 |
feedback, |
| 75 |
"empty Separator by default", |
| 76 |
"feedback displayed when not moving" |
| 77 |
} |
| 78 |
|
| 79 |
DRAGGER_RESOURCE { |
| 80 |
translate2FeedbackActive, |
| 81 |
feedbackActive, |
| 82 |
"empty Separator by default", |
| 83 |
"feedback displayed when moving " |
| 84 |
} |
| 85 |
|
| 86 |
DRAGGER_RESOURCE { |
| 87 |
translate2XAxisFeedback, |
| 88 |
xAxisFeedback, |
| 89 |
"thin purple line", |
| 90 |
"Only shown if dragger is moving and the axis is a |
| 91 |
permissable direction of motion. |
| 92 |
When pressing <shift>, motion is constrained, and this is |
| 93 |
displayed only if the primary motion is in the x direction." |
| 94 |
} |
| 95 |
|
| 96 |
DRAGGER_RESOURCE { |
| 97 |
translate2YAxisFeedback, |
| 98 |
yAxisFeedback, |
| 99 |
"thin purple line", |
| 100 |
"Only shown if dragger is moving and the axis is a |
| 101 |
permissable direction of motion. |
| 102 |
When pressing <shift>, motion is constrained, and this is |
| 103 |
displayed only if the primary motion is in the y direction." |
| 104 |
} |
| 105 |
|
| 106 |
ALSO { |
| 107 |
SoInteractionKit, |
| 108 |
SoDragger, |
| 109 |
SoCenterballDragger, |
| 110 |
SoDirectionalLightDragger, |
| 111 |
SoDragPointDragger, |
| 112 |
SoHandleBoxDragger, |
| 113 |
SoJackDragger, |
| 114 |
SoPointLightDragger, |
| 115 |
SoRotateCylindricalDragger, |
| 116 |
SoRotateDiscDragger, |
| 117 |
SoRotateSphericalDragger, |
| 118 |
SoScale1Dragger, |
| 119 |
SoScale2Dragger, |
| 120 |
SoScale2UniformDragger, |
| 121 |
SoScaleUniformDragger, |
| 122 |
SoSpotLightDragger, |
| 123 |
SoTabBoxDragger, |
| 124 |
SoTabPlaneDragger, |
| 125 |
SoTrackballDragger, |
| 126 |
SoTransformBoxDragger, |
| 127 |
SoTransformerDragger, |
| 128 |
SoTranslate1Dragger |
| 129 |
} |
| 130 |
|