SoTransformerDragger¶
-
InventorModule
¶ genre InventorDraggers
author Silicon Graphics Inc
package MeVisLab/Standard
definition inventor.def
Purpose¶
SoTransformerDragger
is a dragger shaped like a box. It has small cubes at the corners and small balls sticking out of the middle of each face. Click and drag any face of the box for 2D translation in the plane of that face. Drag any corner-cube to scale the box uniformly. Pick any of the mid-face balls to rotate the whole dragger about its center.
The SoTransformerDragger
uses locate highlighting, so you can tell which part you are about to select before pressing the mouse button. By default, the locate highlight color is gold.
Click-drag any face to translate the dragger within the plane of that face. The face you selected will highlight in yellow. While you drag, yellow feedback arrows display the two directions of motion. Press the key and the arrows turn orange; you may now pick between these two directions to constrain the motion. The direction you move the cursor in will determine which direction is chosen. Press the key and the dragger will translate perpendicular to that plane. The translation field is modified as the face is dragged.
Click a corner to scale the dragger. The corner you selected will turn yellow and radial lines will indicate that you may move toward and away from the center of the box. Drag radially and you will perform uniform scale. Press the key to scale about the opposite corner instead of the center of the box.
To stretch the dragger non-uniformly, press when you drag the corner cube. Now you will see three orange arrows indicating that your gesture will determine which direction to choose. Move the cursor and the selected arrow will turn yellow while the others disappear. Now the dragger will stretch only in the direction you selected. Pressing at the same time as allows you to stretch the dragger while keeping the opposite side pinned in place. When you drag a corner, this modifies the Scale Factor
and possibly the translation field of the dragger.
Click one of the spherical knobs to rotate the dragger. When you first click, you will see two orange lines and two purple circles. The purple circles indicate the two ways you can rotate. The orange lines are, once again, the two choices for your mouse gesture. Each line begins you moving around one of the two circles. Once you move the cursor far enough, the selected line turns yellow and you begin rotating the dragger about the selected circle. The other circle and line will disappear.
To perform unconstrained (“free”) rotation, just press while you drag the spherical knob. There will be no choices; instead all three purple circles will be displayed, forming a ball that you can roll around. Regardless of how you rotate, dragging the spherical knobs will modify the Rotation
field of the dragger. Depending on how it is centered and what transforms precede it in the scene graph, rotation is likely to affect the Translation
and Scale Factor
fields as well.
Pressing the key will change the center of rotation in both the constrained and unconstrained () case. By default, rotation occurs about the center of the bounding box. With depressed, rotation occurs about the middle of the opposite side of the bounding box. The purple feedback will change to illustrate this; the feedback circles increase in size and purple crosshairs sprout at the new rotational center.
Ordinarily, the knobs of the dragger are unsquished upon reading from file and when the mouse button is released at the end of a drag. If you want this to happen more often, then you should call the method unsquishKnobs()
.
As with all draggers, if you change the fields the dragger will move to match the new settings.
Remember: This is not an SoTransform
! If you want to move other objects with this dragger, you can either:
- Use a
SoTransformerManip
, which is subclassed fromSoTransform
. It creates one of these draggers and uses it as the interface to change its fields. - Use field-to-field connections to connect the fields of this dragger to those of any
SoTransform
node.
You can change the parts in any instance of this dragger using setPart()
. The default part geometries are defined as resources for this SoTransformerDragger class. They are detailed in the Dragger Resources section of the online reference page for this class. You can make your program use different default resources for the parts by copying the file /usr/share/data/draggerDefaults/transformerDragger.iv
into your own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to that directory.
Parameter Fields¶
Field Index¶
enable : Bool |
Is Active : Bool |
Min Disc Rot Dot : Float |
Rotation : Rotation |
Scale Factor : Vector3 |
Translation : Vector3 |
Visible Fields¶
Is Active¶
-
name:
isActive
, type:
Bool
, persistent:
no
¶ TRUE when mouse is down and dragging, else FALSE.
Min Disc Rot Dot¶
-
name:
minDiscRotDot
, type:
Float
, default:
0.025
¶ Specifies the minimum dot product between eyeDir and rotPlane normal before switching from record-player-type rotation to rolling-pin- type rotation. This transition is made so that rotations do not get screwy when the circle is edge-on. Lies in range [0-1]. Best to leave this alone.