SoTabPlaneDragger Class Reference
[Draggers]

Object you can translate or scale within a plane by dragging with the mouse. More...

#include <Inventor/draggers/SoTabPlaneDragger.h>

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

List of all members.

Public Member Functions

virtual SoType getTypeId () const
virtual const SoNodekitCataloggetNodekitCatalog () const
 SoTabPlaneDragger ()
void adjustScaleTabSize ()
void showEdgeScales (const SbBool show)
void showCornerScales (const SbBool show)

Static Public Member Functions

static SoType getClassTypeId ()
static const SoNodekitCataloggetClassNodekitCatalog ()

Public Attributes

SoSFVec3f translation
SoSFVec3f scaleFactor
SoSFBool resizeHandles
SoSFBool scaleUniform
SoSFBool twoSidedLighting
SoSFFloat lineWidth
SoSFInt32 tabPixelSize

Detailed Description

Object you can translate or scale within a plane by dragging with the mouse.

SoTabPlaneDragger is a dragger which allows the user to interactively translate and scale in a plane. It looks like a square white outline with smaller green squares (or tabs ) set in the corners and along the center of each edge.

Dragging a corner tab scales the dragger in 2D by scaling about the opposite corner. Holding the SHIFT key while while dragging a corner tab forces uniform scaling.

Dragging an edge tab performs 1D scaling about the opposite edge.

Uniform scaling can also be forced by setting the scaleUniform field to TRUE.

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.

The dragger tries to keep the small tabs a constant size in screen space. Before version 7.0, this adjustment was only done when a drag operation started and ended, or when the adjustScaleTabSize method was called. Now as long as the resizeHandles field is set to TRUE (the default), the tab size is automatically recalculated whenever the view matrix changes (normally because the camera position or orientation changed).

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.

When the translator part drags, the dragger updates its translation field. The various scaling parts cause changes to both the scaleFactor and translation field, since scaling about a point other than the center adds translation to the center of the dragger. If you set the field, the dragger will move accordingly. You can also connect fields of other nodes or engines from this one to make them follow the dragger's motion.

You can not change the shape used to draw the tabs. This part is kept privately and may not be changed; the coordinates for the tabs are edited during adjustScaleTabSize().

The SoTabPlaneDragger class does contain three other parts you can change: tabPlaneTranslator , tabPlaneScaleTabMaterial and tabPlaneScaleTabHints .

Each of these is set by default from a resource described in the Dragger Resources section of the online reference page for this class. You can change the parts in any instance of this dragger using setPart().

You can make your program use different default resources for the parts by copying the file $OIVHOME/data/draggerDefaults/tabPlaneDragger.iv into your own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to that directory.

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

SoTabPlaneDragger.png

FILE FORMAT/DEFAULT

DRAGGER RESOURCES

CATALOG PARTS

SEE ALSO

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


Constructor & Destructor Documentation

SoTabPlaneDragger::SoTabPlaneDragger (  ) 

Constructor.


Member Function Documentation

void SoTabPlaneDragger::adjustScaleTabSize (  ) 

Causes the scale tab sizes to be adjusted so that they remain a near constant screen space size.

This happens automatically upon dragger finish. Call this to manually adjust the scale tab sizes at other times, for instance after the camera has changed in a viewer finish callback . Note that (since version 7.0) handles are automatically resized when the camera changes, as long as the resizeHandles field is set to TRUE.

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

Returns the SoNodekitCatalog for this class.

Reimplemented from SoDragger.

Reimplemented in SoEllipsoidDragger.

static SoType SoTabPlaneDragger::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoDragger.

Reimplemented in SoEllipsoidDragger.

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

Returns the SoNodekitCatalog for this instance.

Reimplemented from SoDragger.

Reimplemented in SoEllipsoidDragger.

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

Returns the type identifier for this specific instance.

Reimplemented from SoDragger.

Reimplemented in SoEllipsoidDragger.

void SoTabPlaneDragger::showCornerScales ( const SbBool  show  ) 

show or hide corners

void SoTabPlaneDragger::showEdgeScales ( const SbBool  show  ) 

show or hide edges


Member Data Documentation

Specifies the line width for the outline box.

Default is 1.0

NOTE: field available since Open Inventor 7.1

If set to TRUE, handles will be resized automatically when the view matrix (camera) changes.

Default is TRUE.

NOTE: field available since Open Inventor 7.0

Scale factor affecting the dragger.

Default is (1,1,1).

If set to TRUE, scaling will always be uniform.

Default is FALSE.

NOTE: field available since Open Inventor 7.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).

If set to TRUE, OpenGL two sided lighting will be enabled.

Default is FALSE.

NOTE: field available since Open Inventor 7.1


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

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/