| 1 |
NAME SoTrackballDragger SoTballDrag "" { striped ball you can rotate or scale uniformly by dragging with the mouse } |
| 2 |
|
| 3 |
INCLUDE draggers/SoTrackballDragger.h |
| 4 |
|
| 5 |
DESC { \cSoTrackballDragger\. |
| 6 |
is a ball wrapped in three circular stripes. The stripes are oriented |
| 7 |
like wheels that spin around the x, y, and z axes. Drag the stripes |
| 8 |
to rotate the trackball around those axes. You do not have to hit the lines; |
| 9 |
pick anywhere within the stripe's outline. To rotate the trackball |
| 10 |
freely in 3 dimensions, click the area |
| 11 |
between the stripes and then drag. An invisible but |
| 12 |
pickable sphere initiates this dragging. If the mouse is still moving when |
| 13 |
you release it, the trackball will continue to spin. |
| 14 |
\p |
| 15 |
Press the \k<Control>\. key to scale the trackball uniformly instead of |
| 16 |
rotating. |
| 17 |
\p |
| 18 |
Press the \k<Shift>\. key and the \euser axis\. appears; this is a |
| 19 |
draggable axis with an extra stripe around it. |
| 20 |
Moving the mouse along the surface of the sphere drags the |
| 21 |
'pole' of the axis. |
| 22 |
Release the \k<Shift>\. key and the user axis remains; drag the |
| 23 |
new stripe for constrained rotation around the user axis. |
| 24 |
To make the user axis disappear, press \k<Shift>\. and drag the pole to |
| 25 |
where two of other stripes intersect. This aligns the user axis with |
| 26 |
a primary axis, at which point the user axis disappears. |
| 27 |
\p |
| 28 |
As you drag the trackball, it updates its |
| 29 |
\vrotation\. field, or its \vscaleFactor\. field if |
| 30 |
the \k<Control>\. key is down. As with all draggers, if you change the |
| 31 |
fields the dragger moves in response. |
| 32 |
\p |
| 33 |
\aRemember:\. This is \enot\. an \cSoTransform!\.. |
| 34 |
If you want to move other objects with this dragger, you can either: |
| 35 |
\p |
| 36 |
[a] Use an \cSoTrackballManip\., which is subclassed from \cSoTransform\.. |
| 37 |
The manipulator creates one of |
| 38 |
these draggers and uses it as the interface to edit the manipulator's fields. |
| 39 |
(see the \cSoTrackballManip\. reference page). |
| 40 |
\p |
| 41 |
[b] Use field-to-field connections to connect the fields of this dragger to |
| 42 |
those of any \cSoTransformation\. node. |
| 43 |
\p |
| 44 |
You can change the parts in any instance of this dragger using |
| 45 |
\m\+setPart()\.\-SoDraggerSetPart()\.\.. |
| 46 |
The default part geometries are defined as resources for this |
| 47 |
\cSoTrackballDragger\. class. They are detailed in the |
| 48 |
Dragger Resources section of the online reference page for this class. |
| 49 |
You can make your program use different default resources for the parts |
| 50 |
by copying the file |
| 51 |
\v/usr/share/data/draggerDefaults/trackballDragger.iv\. |
| 52 |
into your own directory, editing the file, and then |
| 53 |
setting the environment variable \vSO_DRAGGER_DIR\. to be a path to that directory. |
| 54 |
} |
| 55 |
|
| 56 |
MISC NOTE { Unlike most multi-function draggers, \cSoTrackballDragger\. is |
| 57 |
not a compound dragger made up of other draggers that |
| 58 |
perform its smaller tasks. This is |
| 59 |
not because it was inappropriate, but because |
| 60 |
the trackball was written before implementation of the methods that |
| 61 |
take care of synchronizing multiple child draggers. The younger |
| 62 |
\cSoCenterballDragger\. is similar in form to the trackball, but |
| 63 |
the centerball \eis\. a compound dragger. } |
| 64 |
|
| 65 |
METHOD "" SoTrackballDragger() { |
| 66 |
Constructor. |
| 67 |
} |
| 68 |
|
| 69 |
METHOD "isAnimEnabled" SbBool isAnimationEnabled() {} |
| 70 |
METHOD "setAnimEnabled" void setAnimationEnabled(SbBool newVal) { |
| 71 |
If the mouse is moving while you release it, the |
| 72 |
trackball will continue to spin afterwards. |
| 73 |
These two methods will query and set whether this |
| 74 |
feature is turned on or off. By default, the animation feature is turned on. |
| 75 |
} |
| 76 |
|
| 77 |
METHOD getClassNkitCat static |
| 78 |
const SoNodekitCatalog *getClassNodekitCatalog() const |
| 79 |
{ Returns an \cSoNodekitCatalog\. for this class } |
| 80 |
|
| 81 |
METHOD "" static SoType getClassTypeId() { |
| 82 |
Returns type identifier for this class. |
| 83 |
} |
| 84 |
|
| 85 |
FIELD scaleFactor { Scale of the dragger. } |
| 86 |
FIELD rotation { Orientation of the dragger. } |
| 87 |
|
| 88 |
DRAGGER_RESOURCE { |
| 89 |
trackballRotator, |
| 90 |
rotator, |
| 91 |
"Invisible but pickable sphere", |
| 92 |
"Initiates unconstrained 3D rotation. Slightly smaller radius than the |
| 93 |
stripes, so you must pick between the stripes to use it." |
| 94 |
} |
| 95 |
|
| 96 |
DRAGGER_RESOURCE { |
| 97 |
trackballRotatorActive, |
| 98 |
rotatorActive, |
| 99 |
"Invisible sphere", |
| 100 |
"Displayed during unconstrained 3D rotation." |
| 101 |
} |
| 102 |
|
| 103 |
DRAGGER_RESOURCE { |
| 104 |
trackballXRotator, |
| 105 |
XRotator, |
| 106 |
"White outline of a stripe aligned with the X axis.", |
| 107 |
"Pick this to initiate constrained rotation about the X axis." |
| 108 |
} |
| 109 |
|
| 110 |
DRAGGER_RESOURCE { |
| 111 |
trackballXRotatorActive, |
| 112 |
XRotatorActive, |
| 113 |
"Yellow version of the regular XRotator", |
| 114 |
"Displayed during constrained rotation about the X axis." |
| 115 |
} |
| 116 |
|
| 117 |
DRAGGER_RESOURCE { |
| 118 |
trackballYRotator, |
| 119 |
YRotator, |
| 120 |
"White outline of a stripe aligned with the Y axis.", |
| 121 |
"Pick this to initiate constrained rotation about the Y axis." |
| 122 |
} |
| 123 |
|
| 124 |
DRAGGER_RESOURCE { |
| 125 |
trackballYRotatorActive, |
| 126 |
YRotatorActive, |
| 127 |
"Yellow version of the regular YRotator", |
| 128 |
"Displayed during constrained rotation about the Y axis." |
| 129 |
} |
| 130 |
|
| 131 |
DRAGGER_RESOURCE { |
| 132 |
trackballZRotator, |
| 133 |
ZRotator, |
| 134 |
"White outline of a stripe aligned with the Z axis.", |
| 135 |
"Pick this to initiate constrained rotation about the Z axis." |
| 136 |
} |
| 137 |
|
| 138 |
DRAGGER_RESOURCE { |
| 139 |
trackballZRotatorActive, |
| 140 |
ZRotatorActive, |
| 141 |
"Yellow version of the regular ZRotator", |
| 142 |
"Displayed during constrained rotation about the Z axis." |
| 143 |
} |
| 144 |
|
| 145 |
DRAGGER_RESOURCE { |
| 146 |
trackballUserAxis, |
| 147 |
userAxis, |
| 148 |
"Thin purple line", |
| 149 |
"Displays the user axis. Dragging the \vuserRotator\. |
| 150 |
rotates about this line." |
| 151 |
} |
| 152 |
|
| 153 |
DRAGGER_RESOURCE { |
| 154 |
trackballUserAxisActive, |
| 155 |
userAxisActive, |
| 156 |
"Thin purple line", |
| 157 |
"Displays the user axis. Dragging the \vuserRotator\. |
| 158 |
rotates about this line." |
| 159 |
} |
| 160 |
|
| 161 |
DRAGGER_RESOURCE { |
| 162 |
trackballUserRotator, |
| 163 |
userRotator, |
| 164 |
"Transparent green stripe circling the user axis.", |
| 165 |
"Pick to initiate constrained rotation about the user axis." |
| 166 |
} |
| 167 |
|
| 168 |
DRAGGER_RESOURCE { |
| 169 |
trackballUserRotatorActive, |
| 170 |
userRotatorActive, |
| 171 |
"Brighter green version of the regular userRotator", |
| 172 |
"Displayed during constrained rotation about the user axis." |
| 173 |
} |
| 174 |
|
| 175 |
ALSO { |
| 176 |
SoInteractionKit, |
| 177 |
SoDragger, |
| 178 |
SoCenterballDragger, |
| 179 |
SoDirectionalLightDragger, |
| 180 |
SoDragPointDragger, |
| 181 |
SoHandleBoxDragger, |
| 182 |
SoJackDragger, |
| 183 |
SoPointLightDragger, |
| 184 |
SoRotateCylindricalDragger, |
| 185 |
SoRotateDiscDragger, |
| 186 |
SoRotateSphericalDragger, |
| 187 |
SoScale1Dragger, |
| 188 |
SoScale2Dragger, |
| 189 |
SoScale2UniformDragger, |
| 190 |
SoScaleUniformDragger, |
| 191 |
SoSpotLightDragger, |
| 192 |
SoTabBoxDragger, |
| 193 |
SoTabPlaneDragger, |
| 194 |
SoTransformBoxDragger, |
| 195 |
SoTransformerDragger, |
| 196 |
SoTranslate1Dragger, |
| 197 |
SoTranslate2Dragger |
| 198 |
} |