| 1 |
NAME SoTransformBoxDragger SoXfBoxDrag "" { box-like object you scale, rotate, and translate by dragging with the mouse } |
| 2 |
|
| 3 |
INCLUDE draggers/SoTransformBoxDragger.h |
| 4 |
|
| 5 |
DESC { \cSoTransformBoxDragger\. |
| 6 |
is a composite dragger shaped like a box with small cubes at the corners. |
| 7 |
Click and drag any of these cubes to scale the box uniformly. |
| 8 |
Drag any edge of the box to rotate the whole dragger about |
| 9 |
its center, along an axis parallel to that edge. Pick any face of the |
| 10 |
box for 2D translation in the plane of that face. |
| 11 |
\p |
| 12 |
Although the box looks just about like a wireframe cube, |
| 13 |
it is composed of many different simple draggers arranged in a composite |
| 14 |
assembly. When one part is dragged, the transformBox makes sure they all |
| 15 |
move together. |
| 16 |
Each of the parts of the box is a different dragger with the default geometry |
| 17 |
changed. |
| 18 |
The faces of the box are \cSoTranslate2Draggers\., the edges are |
| 19 |
\cSoRotateCylindricalDraggers\., and the cubes are an |
| 20 |
\cSoScaleUniformDragger\.. Drag them and the dragger will update |
| 21 |
its \vtranslation\., \vrotation\. and \vscaleFactor\. fields |
| 22 |
to reflect the changes. |
| 23 |
As with all draggers, if you change the fields the dragger will |
| 24 |
move to match the new settings. |
| 25 |
\p |
| 26 |
\aRemember:\. This is \enot\. an \cSoTransform!\.. |
| 27 |
If you want to move other objects with this dragger, you can either: |
| 28 |
\p |
| 29 |
[a] Use an \cSoTransformBoxManip\., which is subclassed from \cSoTransform\.. |
| 30 |
It creates one of |
| 31 |
these draggers and uses it as the interface to change its fields. |
| 32 |
(see the \cSoTransformBoxManip\. man page). |
| 33 |
\p |
| 34 |
[b] Use field-to-field connections to connect the fields of this dragger to |
| 35 |
those of any \cSoTransformation\. node. |
| 36 |
\p |
| 37 |
You can change the parts in any instance of this dragger using |
| 38 |
\m\+setPart()\.\-SoDraggerSetPart()\.\.. |
| 39 |
The default part geometries are defined as resources for this |
| 40 |
\cSoTransformBoxDragger\. class. They are detailed in the |
| 41 |
Dragger Resources section of the online reference page for this class. |
| 42 |
You can make your program use different default resources for the parts |
| 43 |
by copying the file |
| 44 |
\v/usr/share/data/draggerDefaults/transformBoxDragger.iv\. |
| 45 |
into your own directory, editing the file, and then |
| 46 |
setting the environment variable \vSO_DRAGGER_DIR\. to be a path to that directory. |
| 47 |
} |
| 48 |
|
| 49 |
METHOD "" SoTransformBoxDragger() { |
| 50 |
Constructor. |
| 51 |
} |
| 52 |
|
| 53 |
METHOD getClassNkitCat static |
| 54 |
const SoNodekitCatalog *getClassNodekitCatalog() const |
| 55 |
{ Returns an \cSoNodekitCatalog\. for this class } |
| 56 |
|
| 57 |
METHOD "" static SoType getClassTypeId() { |
| 58 |
Returns type identifier for this class. |
| 59 |
} |
| 60 |
|
| 61 |
FIELD rotation { Orientation of the dragger. } |
| 62 |
FIELD translation { Position of the dragger. } |
| 63 |
FIELD scaleFactor { Scale of the dragger. } |
| 64 |
|
| 65 |
DRAGGER_RESOURCE { |
| 66 |
transformBoxScalerScaler, |
| 67 |
scaler.scaler, |
| 68 |
"Eight small white cubes at the corners of the box", |
| 69 |
"Picking this initiates uniform 3D scaling of the |
| 70 |
dragger." |
| 71 |
} |
| 72 |
DRAGGER_RESOURCE { |
| 73 |
transformBoxScalerScalerActive, |
| 74 |
scaler.scalerActive, |
| 75 |
"Yellow version of the regular scaler part", |
| 76 |
"Displayed while the dragger is being scaled." |
| 77 |
} |
| 78 |
|
| 79 |
DRAGGER_RESOURCE { |
| 80 |
transformBoxScalerFeedback, |
| 81 |
scaler.feedback, |
| 82 |
"Empty separator", |
| 83 |
"Removes any feedback geometry created in the constructor of the |
| 84 |
\cSoScaleUniformDragger\.." |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
DRAGGER_RESOURCE { |
| 90 |
transformBoxScalerFeedbackActive, |
| 91 |
scaler.feedbackActive, |
| 92 |
"Empty separator", |
| 93 |
"Removes any feedbackActive geometry created in the constructor of the |
| 94 |
\cSoScaleUniformDragger\.." |
| 95 |
} |
| 96 |
|
| 97 |
DRAGGER_RESOURCE { |
| 98 |
transformBoxRotatorRotator, |
| 99 |
rotator1.rotator |
| 100 |
rotator2.rotator |
| 101 |
rotator3.rotator, |
| 102 |
"Four white lines along the edges of the box", |
| 103 |
"Picking this begins rotational dragging. |
| 104 |
In each of the three rotateCylindrical draggers, the lines of the |
| 105 |
rotator part are oriented parallel to the axis of rotation. " |
| 106 |
} |
| 107 |
|
| 108 |
DRAGGER_RESOURCE { |
| 109 |
transformBoxRotatorRotatorActive, |
| 110 |
rotator1.rotatorActive |
| 111 |
rotator2.rotatorActive |
| 112 |
rotator3.rotatorActive, |
| 113 |
"Four yellow lines along the edges of the box", |
| 114 |
"Displayed while the dragger is being rotated" |
| 115 |
} |
| 116 |
|
| 117 |
DRAGGER_RESOURCE { |
| 118 |
transformBoxRotatorFeedback, |
| 119 |
rotator1.feedback |
| 120 |
rotator2.feedback |
| 121 |
rotator3.feedback, |
| 122 |
"Empty separator", |
| 123 |
"Removes any feedback geometry created in the constructor of the |
| 124 |
\cSoRotateCylindricalDragger\.." |
| 125 |
} |
| 126 |
|
| 127 |
DRAGGER_RESOURCE { |
| 128 |
transformBoxRotatorFeedbackActive, |
| 129 |
rotator1.feedbackActive |
| 130 |
rotator2.feedbackActive |
| 131 |
rotator3.feedbackActive, |
| 132 |
"Thin purple line through center of box", |
| 133 |
"Displayed to show axis of rotation during rotational dragging." |
| 134 |
} |
| 135 |
|
| 136 |
DRAGGER_RESOURCE { |
| 137 |
transformBoxTranslatorTranslator, |
| 138 |
translator1.translator |
| 139 |
translator2.translator |
| 140 |
translator3.translator |
| 141 |
translator4.translator |
| 142 |
translator5.translator |
| 143 |
translator6.translator, |
| 144 |
"Invisible but pickable square surface", |
| 145 |
"Picking these begins 2-D translational dragging within the plane of one of |
| 146 |
the sides of the box. The invisible squares of the six translate2Draggers |
| 147 |
are arranged |
| 148 |
to form the sides of the box. The squares are easy to discern, although |
| 149 |
rendered as invisible; they are bounded by |
| 150 |
the lines of the rotational dragger parts." |
| 151 |
} |
| 152 |
|
| 153 |
DRAGGER_RESOURCE { |
| 154 |
transformBoxTranslatorTranslatorActive, |
| 155 |
translator1.translatorActive |
| 156 |
translator2.translatorActive |
| 157 |
translator3.translatorActive |
| 158 |
translator4.translatorActive |
| 159 |
translator5.translatorActive |
| 160 |
translator6.translatorActive, |
| 161 |
"Invisible square surface", |
| 162 |
"Shown during 2-D translational dragging." |
| 163 |
} |
| 164 |
|
| 165 |
DRAGGER_RESOURCE { |
| 166 |
transformBoxTranslatorXAxisFeedback, |
| 167 |
translator1.xAxisFeedback |
| 168 |
translator2.xAxisFeedback |
| 169 |
translator3.xAxisFeedback |
| 170 |
translator4.xAxisFeedback |
| 171 |
translator5.xAxisFeedback |
| 172 |
translator6.xAxisFeedback, |
| 173 |
"Short thin purple line", |
| 174 |
"Only shown if dragger is moving and the axis is a |
| 175 |
permissable direction of motion. |
| 176 |
When pressing <shift>, motion is constrained, and this is |
| 177 |
displayed only if the primary motion is in the X direction." |
| 178 |
} |
| 179 |
|
| 180 |
DRAGGER_RESOURCE { |
| 181 |
transformBoxTranslatorYAxisFeedback, |
| 182 |
translator1.yAxisFeedback |
| 183 |
translator2.yAxisFeedback |
| 184 |
translator3.yAxisFeedback |
| 185 |
translator4.yAxisFeedback |
| 186 |
translator5.yAxisFeedback |
| 187 |
translator6.yAxisFeedback, |
| 188 |
"Short thin purple line", |
| 189 |
"Only shown if dragger is moving and the axis is a |
| 190 |
permissable direction of motion. |
| 191 |
When pressing <shift>, motion is constrained, and this is |
| 192 |
displayed only if the primary motion is in the Y direction." |
| 193 |
} |
| 194 |
|
| 195 |
ALSO { |
| 196 |
SoInteractionKit, |
| 197 |
SoDragger, |
| 198 |
SoCenterballDragger, |
| 199 |
SoDirectionalLightDragger, |
| 200 |
SoDragPointDragger, |
| 201 |
SoHandleBoxDragger, |
| 202 |
SoJackDragger, |
| 203 |
SoPointLightDragger, |
| 204 |
SoRotateCylindricalDragger, |
| 205 |
SoRotateDiscDragger, |
| 206 |
SoRotateSphericalDragger, |
| 207 |
SoScale1Dragger, |
| 208 |
SoScale2Dragger, |
| 209 |
SoScale2UniformDragger, |
| 210 |
SoScaleUniformDragger, |
| 211 |
SoSpotLightDragger, |
| 212 |
SoTabBoxDragger, |
| 213 |
SoTabPlaneDragger, |
| 214 |
SoTrackballDragger, |
| 215 |
SoTransformerDragger, |
| 216 |
SoTranslate1Dragger, |
| 217 |
SoTranslate2Dragger |
| 218 |
} |
| 219 |
|
| 220 |
|