SoTransformerDragger Class Reference
[Draggers]

Box-like object you scale, rotate, and translate by dragging with the mouse. More...

#include <Inventor/draggers/SoTransformerDragger.h>

Inheritance diagram for SoTransformerDragger:
SoDragger SoInteractionKit SoBaseKit SoNode SoGetView SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Member Functions

virtual SoType getTypeId () const
virtual const SoNodekitCataloggetNodekitCatalog () const
 SoTransformerDragger ()
void unsquishKnobs ()
SbBool isLocateHighlighting ()
void setLocateHighlighting (SbBool onOff)

Static Public Member Functions

static SoType getClassTypeId ()
static const SoNodekitCataloggetClassNodekitCatalog ()
static void setColinearThreshold (int newVal)
static int getColinearThreshold ()

Public Attributes

SoSFRotation rotation
SoSFVec3f translation
SoSFVec3f scaleFactor
SoSFFloat minDiscRotDot

Detailed Description

Box-like object you scale, rotate, and translate by dragging with the mouse.

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.
NOTE: Locate highlighting (mouse-over feedback) is disabled by default and the setLocateHighlighting() method has no effect. To enable locate highlighting, use SoPreferences to set the environment variable IV_ALLOW_LOCATE_HIGHLIGHT to true.

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 <Shift> 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 <Control> 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 <Control> key to scale about the opposite corner instead of the center of the box.

The Control key behavior may be disabled by setting the environment variable OIV_DISABLE_DRAGGER_CTRL_KEY to false (see SoPreferences).

To stretch the dragger non-uniformly, press <Shift> 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 <Control> at the same time as <Shift> allows you to stretch the dragger while keeping the opposite side pinned in place. When you drag a corner, this modifies the scaleFactor and possibly the translation field of the dragger.

Click one of the spherical knobs to rotate the dragger. When you first click, you'll 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 <Shift> 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 scaleFactor fields as well.

Pressing the <Control> key will change the center of rotation in both the constrained and unconstrained (<Shift>) case. By default, rotation occurs about the center of the bounding box. With <Control> 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 readin 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:

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 $OIVHOME/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.

This dragger has both a default and a WYSIWYG version:

Default Dragger WYSIWYG Dragger
SoTransformerDragger.png
SoTransformerDraggerWYSIWYG.png

See SoDragger for more information about using and customizing draggers, including code examples, using draggers in an immersive VR environment and using WYSIWYG draggers.

FILE FORMAT/DEFAULT

DRAGGER RESOURCES

CATALOG PARTS

SEE ALSO

SoDragger, SoInteractionKit, SoLocateHighlight, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTranslate1Dragger, SoTranslate2Dragger


Constructor & Destructor Documentation

SoTransformerDragger::SoTransformerDragger (  ) 

Constructor.


Member Function Documentation

static const SoNodekitCatalog* SoTransformerDragger::getClassNodekitCatalog (  )  [static]

Returns the SoNodekitCatalog for this class.

Reimplemented from SoDragger.

static SoType SoTransformerDragger::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoDragger.

static int SoTransformerDragger::getColinearThreshold (  )  [static]

Returns the colinear threshold.

This parameter determines the number of pixels that must separate two axes before they are regarded as distinct.

virtual const SoNodekitCatalog* SoTransformerDragger::getNodekitCatalog (  )  const [virtual]

Returns the SoNodekitCatalog for this instance.

Reimplemented from SoDragger.

virtual SoType SoTransformerDragger::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoDragger.

SbBool SoTransformerDragger::isLocateHighlighting (  )  [inline]

Returns whether or not locate highlighting is used.

static void SoTransformerDragger::setColinearThreshold ( int  newVal  )  [static]

Sets the colinear threshold.

When picking a direction for constraining based on gesture, this parameter determines how many pixels must separate two axes before they are regarded as distinct. If they are deemed "the same" then the shorter of the two will be discarded. Default is 4.

void SoTransformerDragger::setLocateHighlighting ( SbBool  onOff  ) 

Sets whether or not locate highlighting is used.

Default is TRUE.

Note that this method has no effect unless unless locate highlighting is globally enabled by setting the environment variable IV_ALLOW_LOCATE_HIGHLIGHT to true (see SoPreferences).

void SoTransformerDragger::unsquishKnobs (  ) 

Tells the dragger to unsquish its rotation and scale knobs during the next traversal.

Ordinarily, the knobs are only unsquished upon readin 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 this method.


Member Data Documentation

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 don't get screwy when the circle is edge-on. Lies in range [0-1]. Best to leave this alone.

Orientation of the dragger.

Scale of the dragger.

Position of the dragger.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 16 Sep 2021
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/