Open Inventor Reference
SoTabBoxDragger Class Reference

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 SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoTabBoxDragger ()
 Constructor.
void adjustScaleTabSize ()
 Cause the scale tab sizes to be re-adjusted on all 6 SoTabPlaneDraggers so that they remain a near constant screen space size.

Static Public Member Functions

static void initClass ()
 initialize the class

Public Attributes

SoSFVec3f translation
SoSFVec3f scaleFactor

Protected Member Functions

virtual SbBool setUpConnections (SbBool onOff, SbBool doItAlways=FALSE)
 detach/attach any sensors, callbacks, and/or field connections.
virtual void setDefaultOnNonWritingFields ()
 Called by the SoBaseKit::write() method.
virtual ~SoTabBoxDragger ()

Static Protected Member Functions

static void fieldSensorCB (void *, SoSensor *)
static void valueChangedCB (void *, SoDragger *)
static void invalidateSurroundScaleCB (void *, SoDragger *)
static void adjustScaleTabSizeCB (void *, SoDragger *)

Protected Attributes

SoFieldSensortranslFieldSensor
SoFieldSensorscaleFieldSensor

Detailed Description

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 local space, the dragger may be easily translated or scaled in any direction.

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

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 either:

[a] Use an SoTabBoxManip, which is subclassed from SoTransform. It creates one of these draggers and uses it as the interface to change its fields. (see the SoTabBoxManip man page).

[b] Use field-to-field connections to connect the fields of this dragger to those of any SoTransformation node.

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 /usr/share/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.

File Format/Default
See Also
SoInteractionKit, SoDragger, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger

Definition at line 157 of file SoTabBoxDragger.h.


Constructor & Destructor Documentation

SoTabBoxDragger::SoTabBoxDragger ( )
virtual SoTabBoxDragger::~SoTabBoxDragger ( ) [protected, virtual]

Member Function Documentation

void SoTabBoxDragger::adjustScaleTabSize ( )

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 void SoTabBoxDragger::adjustScaleTabSizeCB ( void *  ,
SoDragger  
) [static, protected]
static void SoTabBoxDragger::fieldSensorCB ( void *  ,
SoSensor  
) [static, protected]

Reimplemented from SoInteractionKit.

static void SoTabBoxDragger::initClass ( ) [static]

Reimplemented from SoDragger.

static void SoTabBoxDragger::invalidateSurroundScaleCB ( void *  ,
SoDragger  
) [static, protected]
virtual void SoTabBoxDragger::setDefaultOnNonWritingFields ( ) [protected, virtual]

Draggers don't want to write out fields if they have default vals.

sets isActive to default if default and not connected.

Looks for fields named: 'rotation' with value SbRotation::identity() 'translation' with value (0,0,0) 'center' with value (0,0,0) 'scaleFactor' with value (1,1,1) and sets them to default if they are not connected from a field. (most draggers are missing at least some of these, but thats okay)

Then calls the method for SoInteractionKit.

NOTE: Parts which are set to default may still wind up writing to file if, for example, they lie on a path.

Reimplemented from SoDragger.

virtual SbBool SoTabBoxDragger::setUpConnections ( SbBool  onOff,
SbBool  doItAlways = FALSE 
) [protected, virtual]

Also set geometry of childDraggers to be our default instead of their regular default, using our resources. Called by: start/end of SoBaseKit::readInstance and on new copy by: start/end of SoBaseKit::copy. Classes that redefine must call setUpConnections(TRUE,TRUE) at end of constructor. Returns the state of the node when this was called.

Reimplemented from SoInteractionKit.

static void SoTabBoxDragger::valueChangedCB ( void *  ,
SoDragger  
) [static, protected]

Member Data Documentation

Definition at line 206 of file SoTabBoxDragger.h.

Definition at line 205 of file SoTabBoxDragger.h.


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