| 1 |
NAME SoHandleBoxDragger SoHBoxDrag "" { box you can scale, stretch and translate by dragging with the mouse } |
| 2 |
|
| 3 |
INCLUDE draggers/SoHandleBoxDragger.h |
| 4 |
|
| 5 |
DESC { \cSoHandleBoxDragger\. |
| 6 |
is a dragger shaped like a wireframe box with small \ecorner cubes\. |
| 7 |
mounted on each corner. |
| 8 |
Click and drag any of these cubes to scale the box uniformly. |
| 9 |
Six other \ecenter cubes\. are centered on the sides of the box; white |
| 10 |
lines connect them to the center of the dragger. |
| 11 |
Drag one of the center cubes along its line to stretch the box |
| 12 |
in that direction. |
| 13 |
Dragging a face of the box translates the dragger within that plane. |
| 14 |
\p |
| 15 |
While you drag a face of the box, purple \efeedback arrows\. display the |
| 16 |
possible directions of motion. Press the \k<Shift>\. key to |
| 17 |
\econstrain\. the motion to one of the two major directions in the |
| 18 |
plane. The constraint direction is chosen based on the next user |
| 19 |
gesture. Press the \k<Control>\. key and the dragger will translate |
| 20 |
\eperpendicular\. to that plane. The \vtranslation\. field is modified |
| 21 |
as the face is dragged. |
| 22 |
\p |
| 23 |
By default, dragging any of the small cubes scales about the center of |
| 24 |
the object. Pressing the \k<Control>\. key changes this: A corner cube |
| 25 |
will scale about its opposite corner. A center cube will scale about |
| 26 |
the center of its opposite face. Dragging one of the small cubes will |
| 27 |
usually result in changes to both the \vscaleFactor\. and |
| 28 |
\vtranslation\. fields. This is because any scale about a point other |
| 29 |
than the origin has a translation element. |
| 30 |
\p |
| 31 |
As with all draggers, if you change the fields the dragger will |
| 32 |
move to match the new settings. |
| 33 |
\p |
| 34 |
\eRemember:\. This is \enot\. an \cSoTransform!\.. |
| 35 |
If you want to move other objects with this dragger, you can either: |
| 36 |
\p |
| 37 |
[a] Use an \cSoHandleBoxManip\., which is subclassed from \cSoTransform\.. |
| 38 |
It creates one of |
| 39 |
these draggers and uses it as the interface to change its fields. |
| 40 |
(see the \cSoHandleBoxManip\. reference page). |
| 41 |
\p |
| 42 |
[b] Use field-to-field connections to connect the fields of this dragger to |
| 43 |
those of any \cSoTransformation\. node. |
| 44 |
\p |
| 45 |
You can change the parts in any instance of this dragger using |
| 46 |
\m\+setPart()\.\-SoDraggerSetPart()\.\.. |
| 47 |
The default part geometries are defined as resources for this |
| 48 |
\cSoHandleBoxDragger\. class. They are detailed in the |
| 49 |
Dragger Resources section of the online reference page for this class. |
| 50 |
You can make your program use different default resources for the parts |
| 51 |
by copying the file |
| 52 |
\v/usr/share/data/draggerDefaults/handleBoxDragger.iv\. |
| 53 |
into your own directory, editing the file, and then |
| 54 |
setting the environment variable \vSO_DRAGGER_DIR\. to be a path to that directory. |
| 55 |
} |
| 56 |
|
| 57 |
|
| 58 |
MISC NOTE { Unlike most multi-function draggers, \cSoHandleBoxDragger\. is |
| 59 |
not a compound dragger made up of other draggers that |
| 60 |
perform its smaller tasks. This is |
| 61 |
not because it was inappropriate, but because |
| 62 |
was written before implementation of the methods that |
| 63 |
synchronize multiple child draggers. The younger |
| 64 |
\cSoTransformBoxDragger\. has similarities to the handle box dragger, but |
| 65 |
the transform box dragger \eis\. a compound dragger. } |
| 66 |
|
| 67 |
METHOD "" SoHandleBoxDragger() { |
| 68 |
Constructor. |
| 69 |
} |
| 70 |
|
| 71 |
METHOD getClassNkitCat static |
| 72 |
const SoNodekitCatalog *getClassNodekitCatalog() const |
| 73 |
{ Returns an \cSoNodekitCatalog\. for this class } |
| 74 |
|
| 75 |
METHOD "" static SoType getClassTypeId() { |
| 76 |
Returns type identifier for this class. |
| 77 |
} |
| 78 |
|
| 79 |
|
| 80 |
FIELD scaleFactor { Scale of the dragger. } |
| 81 |
FIELD translation { Position of the dragger. } |
| 82 |
|
| 83 |
DRAGGER_RESOURCE { |
| 84 |
handleBoxTranslator1, |
| 85 |
translator1, |
| 86 |
"White Line-Style Square", |
| 87 |
"Top face of handleBox. Picking this initiates scaling in x-z plane." |
| 88 |
} |
| 89 |
DRAGGER_RESOURCE { |
| 90 |
handleBoxTranslator2, |
| 91 |
translator2, |
| 92 |
"White Line-Style Square", |
| 93 |
"Bottom face of handleBox. Picking this initiates scaling in x-z plane." |
| 94 |
} |
| 95 |
DRAGGER_RESOURCE { |
| 96 |
handleBoxTranslator3, |
| 97 |
translator3, |
| 98 |
"White Line-Style Square", |
| 99 |
"Left face of handleBox. Picking this initiates scaling in y-z plane." |
| 100 |
} |
| 101 |
DRAGGER_RESOURCE { |
| 102 |
handleBoxTranslator4, |
| 103 |
translator4, |
| 104 |
"White Line-Style Square", |
| 105 |
"Right face of handleBox. Picking this initiates scaling in y-z plane." |
| 106 |
} |
| 107 |
DRAGGER_RESOURCE { |
| 108 |
handleBoxTranslator5, |
| 109 |
translator5, |
| 110 |
"White Line-Style Square", |
| 111 |
"Front face of handleBox. Picking this initiates scaling in x-y plane." |
| 112 |
} |
| 113 |
DRAGGER_RESOURCE { |
| 114 |
handleBoxTranslator6, |
| 115 |
translator6, |
| 116 |
"White Line-Style Square", |
| 117 |
"Back face of handleBox. Picking this initiates scaling in x-y plane." |
| 118 |
} |
| 119 |
|
| 120 |
|
| 121 |
DRAGGER_RESOURCE { |
| 122 |
handleBoxTranslator1Active, |
| 123 |
translator1Active, |
| 124 |
"Yellow version of handleBoxTranslator1", |
| 125 |
"Replaces handleBoxTranslator1 during dragging." |
| 126 |
} |
| 127 |
DRAGGER_RESOURCE { |
| 128 |
handleBoxTranslator2Active, |
| 129 |
translator2Active, |
| 130 |
"Yellow version of handleBoxTranslator2", |
| 131 |
"Replaces handleBoxTranslator2 during dragging." |
| 132 |
} |
| 133 |
DRAGGER_RESOURCE { |
| 134 |
handleBoxTranslator3Active, |
| 135 |
translator3Active, |
| 136 |
"Yellow version of handleBoxTranslator3", |
| 137 |
"Replaces handleBoxTranslator3 during dragging." |
| 138 |
} |
| 139 |
DRAGGER_RESOURCE { |
| 140 |
handleBoxTranslator4Active, |
| 141 |
translator4Active, |
| 142 |
"Yellow version of handleBoxTranslator4", |
| 143 |
"Replaces handleBoxTranslator4 during dragging." |
| 144 |
} |
| 145 |
DRAGGER_RESOURCE { |
| 146 |
handleBoxTranslator5Active, |
| 147 |
translator5Active, |
| 148 |
"Yellow version of handleBoxTranslator5", |
| 149 |
"Replaces handleBoxTranslator5 during dragging." |
| 150 |
} |
| 151 |
DRAGGER_RESOURCE { |
| 152 |
handleBoxTranslator6Active, |
| 153 |
translator6Active, |
| 154 |
"Yellow version of handleBoxTranslator6", |
| 155 |
"Replaces handleBoxTranslator6 during dragging." |
| 156 |
} |
| 157 |
|
| 158 |
DRAGGER_RESOURCE { |
| 159 |
handleBoxExtruder1, |
| 160 |
extruder1, |
| 161 |
"Small white cube at (0,1.25,0) with line to origin", |
| 162 |
"Selecting this part initiates 1-D scaling along Y axis." |
| 163 |
} |
| 164 |
DRAGGER_RESOURCE { |
| 165 |
handleBoxExtruder2, |
| 166 |
extruder2, |
| 167 |
"Small white cube at (0,-1.25,0) with line to origin", |
| 168 |
"Selecting this part initiates 1-D scaling along Y axis." |
| 169 |
} |
| 170 |
DRAGGER_RESOURCE { |
| 171 |
handleBoxExtruder3, |
| 172 |
extruder3, |
| 173 |
"Small white cube at (-1.25,0,0) with line to origin", |
| 174 |
"Selecting this part initiates 1-D scaling along X axis." |
| 175 |
} |
| 176 |
DRAGGER_RESOURCE { |
| 177 |
handleBoxExtruder4, |
| 178 |
extruder4, |
| 179 |
"Small white cube at (1.25,0,0) with line to origin", |
| 180 |
"Selecting this part initiates 1-D scaling along X axis." |
| 181 |
} |
| 182 |
DRAGGER_RESOURCE { |
| 183 |
handleBoxExtruder5, |
| 184 |
extruder5, |
| 185 |
"Small white cube at (0,0,1.25) with line to origin", |
| 186 |
"Selecting this part initiates 1-D scaling along Z axis." |
| 187 |
} |
| 188 |
DRAGGER_RESOURCE { |
| 189 |
handleBoxExtruder6, |
| 190 |
extruder6, |
| 191 |
"Small white cube at (0,0,-1.25) with line to origin", |
| 192 |
"Selecting this part initiates 1-D scaling along Z axis." |
| 193 |
} |
| 194 |
|
| 195 |
DRAGGER_RESOURCE { |
| 196 |
handleBoxExtruder1Active, |
| 197 |
extruder1Active, |
| 198 |
"Yellow version of handleBoxExtruder1", |
| 199 |
"Replaces handleBoxExtruder1 during dragging." |
| 200 |
} |
| 201 |
DRAGGER_RESOURCE { |
| 202 |
handleBoxExtruder2Active, |
| 203 |
extruder2Active, |
| 204 |
"Yellow version of handleBoxExtruder1", |
| 205 |
"Replaces handleBoxExtruder1 during dragging." |
| 206 |
} |
| 207 |
DRAGGER_RESOURCE { |
| 208 |
handleBoxExtruder3Active, |
| 209 |
extruder3Active, |
| 210 |
"Yellow version of handleBoxExtruder3", |
| 211 |
"Replaces handleBoxExtruder3 during dragging." |
| 212 |
} |
| 213 |
DRAGGER_RESOURCE { |
| 214 |
handleBoxExtruder4Active, |
| 215 |
extruder4Active, |
| 216 |
"Yellow version of handleBoxExtruder4", |
| 217 |
"Replaces handleBoxExtruder4 during dragging." |
| 218 |
} |
| 219 |
DRAGGER_RESOURCE { |
| 220 |
handleBoxExtruder5Active, |
| 221 |
extruder5Active, |
| 222 |
"Yellow version of handleBoxExtruder5", |
| 223 |
"Replaces handleBoxExtruder5 during dragging." |
| 224 |
} |
| 225 |
DRAGGER_RESOURCE { |
| 226 |
handleBoxExtruder6Active, |
| 227 |
extruder6Active, |
| 228 |
"Yellow version of handleBoxExtruder6", |
| 229 |
"Replaces handleBoxExtruder6 during dragging." |
| 230 |
} |
| 231 |
|
| 232 |
DRAGGER_RESOURCE { |
| 233 |
handleBoxUniform1, |
| 234 |
uniform1, |
| 235 |
"Small white cube in (+x+y+z) corner of handleBox", |
| 236 |
"Picking this initiates uniform scaling." |
| 237 |
} |
| 238 |
DRAGGER_RESOURCE { |
| 239 |
handleBoxUniform2, |
| 240 |
uniform2, |
| 241 |
"Small white cube in (+x+y-z) corner of handleBox", |
| 242 |
"Picking this initiates uniform scaling." |
| 243 |
} |
| 244 |
DRAGGER_RESOURCE { |
| 245 |
handleBoxUniform3, |
| 246 |
uniform3, |
| 247 |
"Small white cube in (+x-y+z) corner of handleBox", |
| 248 |
"Picking this initiates uniform scaling." |
| 249 |
} |
| 250 |
DRAGGER_RESOURCE { |
| 251 |
handleBoxUniform4, |
| 252 |
uniform4, |
| 253 |
"Small white cube in (+x-y-z) corner of handleBox", |
| 254 |
"Picking this initiates uniform scaling." |
| 255 |
} |
| 256 |
DRAGGER_RESOURCE { |
| 257 |
handleBoxUniform5, |
| 258 |
uniform5, |
| 259 |
"Small white cube in (-x+y+z) corner of handleBox", |
| 260 |
"Picking this initiates uniform scaling." |
| 261 |
} |
| 262 |
DRAGGER_RESOURCE { |
| 263 |
handleBoxUniform6, |
| 264 |
uniform6, |
| 265 |
"Small white cube in (-x+y-z) corner of handleBox", |
| 266 |
"Picking this initiates uniform scaling." |
| 267 |
} |
| 268 |
DRAGGER_RESOURCE { |
| 269 |
handleBoxUniform7, |
| 270 |
uniform7, |
| 271 |
"Small white cube in (-x-y+z) corner of handleBox", |
| 272 |
"Picking this initiates uniform scaling." |
| 273 |
} |
| 274 |
|
| 275 |
DRAGGER_RESOURCE { |
| 276 |
handleBoxUniform8, |
| 277 |
uniform8, |
| 278 |
"Small white cube in (-x-y-z) corner of handleBox", |
| 279 |
"Picking this initiates uniform scaling." |
| 280 |
} |
| 281 |
|
| 282 |
DRAGGER_RESOURCE { |
| 283 |
handleBoxUniform1Active, |
| 284 |
uniform1Active, |
| 285 |
"Yellow version of handleBoxUniform1Active", |
| 286 |
"Replaces handleBoxUniform1Active during dragging." |
| 287 |
} |
| 288 |
DRAGGER_RESOURCE { |
| 289 |
handleBoxUniform2Active, |
| 290 |
uniform2Active, |
| 291 |
"Yellow version of handleBoxUniform1Active", |
| 292 |
"Replaces handleBoxUniform1Active during dragging." |
| 293 |
} |
| 294 |
DRAGGER_RESOURCE { |
| 295 |
handleBoxUniform3Active, |
| 296 |
uniform3Active, |
| 297 |
"Yellow version of handleBoxUniform1Active", |
| 298 |
"Replaces handleBoxUniform1Active during dragging." |
| 299 |
} |
| 300 |
DRAGGER_RESOURCE { |
| 301 |
handleBoxUniform4Active, |
| 302 |
uniform4Active, |
| 303 |
"Yellow version of handleBoxUniform1Active", |
| 304 |
"Replaces handleBoxUniform1Active during dragging." |
| 305 |
} |
| 306 |
DRAGGER_RESOURCE { |
| 307 |
handleBoxUniform5Active, |
| 308 |
uniform5Active, |
| 309 |
"Yellow version of handleBoxUniform1Active", |
| 310 |
"Replaces handleBoxUniform1Active during dragging." |
| 311 |
} |
| 312 |
DRAGGER_RESOURCE { |
| 313 |
handleBoxUniform6Active, |
| 314 |
uniform6Active, |
| 315 |
"Yellow version of handleBoxUniform1Active", |
| 316 |
"Replaces handleBoxUniform1Active during dragging." |
| 317 |
} |
| 318 |
DRAGGER_RESOURCE { |
| 319 |
handleBoxUniform7Active, |
| 320 |
uniform7Active, |
| 321 |
"Yellow version of handleBoxUniform1Active", |
| 322 |
"Replaces handleBoxUniform1Active during dragging." |
| 323 |
} |
| 324 |
DRAGGER_RESOURCE { |
| 325 |
handleBoxUniform8Active, |
| 326 |
uniform8Active, |
| 327 |
"Yellow version of handleBoxUniform1Active", |
| 328 |
"Replaces handleBoxUniform1Active during dragging." |
| 329 |
} |
| 330 |
|
| 331 |
DRAGGER_RESOURCE { |
| 332 |
handleBoxArrow1, |
| 333 |
arrow1, |
| 334 |
"Purple Arrow, pointing up", |
| 335 |
"Displayed when translating if Y direction is permitted." |
| 336 |
} |
| 337 |
DRAGGER_RESOURCE { |
| 338 |
handleBoxArrow2, |
| 339 |
arrow2, |
| 340 |
"Purple Arrow, pointing down", |
| 341 |
"Displayed when translating if Y direction is permitted." |
| 342 |
} |
| 343 |
DRAGGER_RESOURCE { |
| 344 |
handleBoxArrow3, |
| 345 |
arrow3, |
| 346 |
"Purple Arrow, pointing left", |
| 347 |
"Displayed when translating if X direction is permitted." |
| 348 |
} |
| 349 |
DRAGGER_RESOURCE { |
| 350 |
handleBoxArrow4, |
| 351 |
arrow4, |
| 352 |
"Purple Arrow, pointing right", |
| 353 |
"Displayed when translating if X direction is permitted." |
| 354 |
} |
| 355 |
DRAGGER_RESOURCE { |
| 356 |
handleBoxArrow5, |
| 357 |
arrow5, |
| 358 |
"Purple Arrow, pointing forward", |
| 359 |
"Displayed when translating if Z direction is permitted." |
| 360 |
} |
| 361 |
DRAGGER_RESOURCE { |
| 362 |
handleBoxArrow6, |
| 363 |
arrow6, |
| 364 |
"Purple Arrow, pointing backward", |
| 365 |
"Displayed when translating if Z direction is permitted." |
| 366 |
} |
| 367 |
|
| 368 |
ALSO { |
| 369 |
SoInteractionKit, |
| 370 |
SoDragger, |
| 371 |
SoCenterballDragger, |
| 372 |
SoDirectionalLightDragger, |
| 373 |
SoDragPointDragger, |
| 374 |
SoJackDragger, |
| 375 |
SoPointLightDragger, |
| 376 |
SoRotateCylindricalDragger, |
| 377 |
SoRotateDiscDragger, |
| 378 |
SoRotateSphericalDragger, |
| 379 |
SoScale1Dragger, |
| 380 |
SoScale2Dragger, |
| 381 |
SoScale2UniformDragger, |
| 382 |
SoScaleUniformDragger, |
| 383 |
SoSpotLightDragger, |
| 384 |
SoTabBoxDragger, |
| 385 |
SoTabPlaneDragger, |
| 386 |
SoTrackballDragger, |
| 387 |
SoTransformBoxDragger, |
| 388 |
SoTransformerDragger, |
| 389 |
SoTranslate1Dragger, |
| 390 |
SoTranslate2Dragger |
| 391 |
} |