SoTabBoxDragger Class Reference
[Draggers]

Cubic object you can translate and scale by dragging with the mouse. More...

#include <Inventor/draggers/SoTabBoxDragger.h>

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

List of all members.

Public Member Functions

virtual SoType getTypeId () const
virtual const SoNodekitCataloggetNodekitCatalog () const
 SoTabBoxDragger ()
void adjustScaleTabSize ()

Static Public Member Functions

static SoType getClassTypeId ()
static const SoNodekitCataloggetClassNodekitCatalog ()

Public Attributes

SoSFVec3f translation
SoSFVec3f scaleFactor
SoSFBool resizeHandles
SoSFInt32 tabPixelSize
SoSFBool privateStyle
SoSFColor highlightColor
SoSFBool enableHighlight

Detailed Description

Cubic object you can translate and scale by dragging with the mouse.

SoTabBoxDragger is a composite dragger shaped like a box. Inside it are six SoTabPlaneDraggers which the dragger positions and orients to form a cube. The operations available in an SoTabPlaneDragger (translation, 1D scaling and 2D scaling) are available on each face of the cube. Since they each move in their own local space, the dragger may be easily translated or scaled in any direction.

Clicking and dragging a corner tab does a 2D scaling in the plane of the tab by scaling, centered on the opposite corner of that face of the dragger, meaning that the opposite corner is the only corner that won't move.
Note: Holding the SHIFT key while dragging a corner tab forces uniform scaling.

Clicking and dragging an edge tab does 1D scaling about the opposite edge of that face.

Clicking and dragging a face does translation within the plane of the face. Although the face of the dragger is invisible (using the default dragger geometry) it is pickable.
Note: Holding the SHIFT key while dragging a face forces axis constrained dragging. The drag axis is determined by the initial drag direction.

As a composite dragger, this class makes sure that when one plane is dragged, the entire box moves together.

Each SoTabPlaneDragger tries to keep the small tabs a constant size in screen space. Every time a drag begins or ends, the size is automatically recalculated based on the viewing and modeling matrix. When the resizeHandles field is set to TRUE (the default), the tab size is also recalculated during the render traversal if the view matrix has changed (usually because the camera position and/or orientation changed). The application can also force the tab size to be recomputed by calling the adjustScaleTabSize() method.

If the dragger becomes too small in one dimension to contain all three tabs (two corner tabs plus the edge tab), the middle (edge) tab will not be drawn. If the dragger becomes very small (or flat) in one dimension, it may not be possible for the user to resize using the tabs. One solution for this is to provide a "reset dragger" button in the application.

When dragging the translator part, press the <Shift> key and you can constrain motion to either the local x axis or the y axis . The direction is determined by your initial mouse gesture after pressing the key. Releasing the key removes the constraint.

As each sub-dragger is moved, the SoTabBoxDragger updates its scaleFactor and translation fields. As with all draggers, if you change a field 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:

You can change the parts in any instance of this dragger using setPart(). The default part geometries are defined as resources for this SoTabBoxDragger class. They are detailed below 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/tabBoxDragger.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
SoTabBoxDragger.png
SoTabBoxDraggerWYSIWYG.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

SoTabBoxManip, SoROIManip, SoInteractionKit, SoDragger, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger, SceneOrbiter, SceneExaminer

See related examples:

AmplitudeVelocity, RoiManip


Constructor & Destructor Documentation

SoTabBoxDragger::SoTabBoxDragger (  ) 

Constructor.


Member Function Documentation

void SoTabBoxDragger::adjustScaleTabSize (  ) 

Causes the scale tab sizes to be re-adjusted on all 6 SoTabPlaneDraggers so that they remain a near constant screen space size.

This happens automatically upon dragger finish. Call this to adjust the scale tab sizes at other times, for instance after the camera has changed in a viewer finish callback .

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

Returns the SoNodekitCatalog for this class.

Reimplemented from SoDragger.

static SoType SoTabBoxDragger::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoDragger.

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

Returns the SoNodekitCatalog for this instance.

Reimplemented from SoDragger.

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

Returns the type identifier for this specific instance.

Reimplemented from SoDragger.


Member Data Documentation

Enables highlighting for tabs and faces.

When this field is true, during a mousemove event, once the cursor moves over a tab or a face of the dragger, this element is highlighted according to the highlightColor. This element is no longer highlighted once the cursor is no longer over it. Default is true.

Specifies the highlight color.

See also enableHighlight. The default color is yellow (1,1,0).

Controls whether this instance of SoTabBoxDragger shares or does not share parts, e.g.

tabBoxTranslator, tabBoxScaleTabMaterial and tabBoxScaleTabHints with all other existing instances of SoTabBoxDragger. Default is false, meaning parts are shared. Set this field to true if your application needs to change these parts without affecting other draggers in the scene graph. (Indeed, the default was true prior to version 9.6.1)

NOTE: field available since Open Inventor 9.6.1

If set to TRUE, handles will be resized at each camera motion.

Default is TRUE.

NOTE: field available since Open Inventor 7.0

Scale of the dragger.

Default is 1,1,1.

Specifies the size of the green tabs in pixels.

Default is 8

NOTE: field available since Open Inventor 9.2

Position of the dragger.

Default is 0,0,0.


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

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/