Open Inventor Reference
SoTransformBoxDragger Class Reference

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

#include <Inventor/draggers/SoTransformBoxDragger.h>

Inheritance diagram for SoTransformBoxDragger:
SoDragger SoInteractionKit SoBaseKit SoNode SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoTransformBoxDragger ()
 Constructor.

Static Public Member Functions

static void initClass ()
 initialize the class

Public Attributes

SoSFRotation rotation
SoSFVec3f translation
SoSFVec3f scaleFactor

Protected Member Functions

virtual SbBool setUpConnections (SbBool onOff, SbBool doItAlways=FALSE)
 detach/attach callbacks to child draggers.
virtual void setDefaultOnNonWritingFields ()
 Called by the SoBaseKit::write() method.
virtual ~SoTransformBoxDragger ()

Static Protected Member Functions

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

Protected Attributes

SoFieldSensorrotFieldSensor
SoFieldSensortranslFieldSensor
SoFieldSensorscaleFieldSensor

Detailed Description

SoTransformBoxDragger is a composite dragger shaped like a box with small cubes at the corners. Click and drag any of these cubes to scale the box uniformly. Drag any edge of the box to rotate the whole dragger about its center, along an axis parallel to that edge. Pick any face of the box for 2D translation in the plane of that face.

Although the box looks just about like a wireframe cube, it is composed of many different simple draggers arranged in a composite assembly. When one part is dragged, the transformBox makes sure they all move together. Each of the parts of the box is a different dragger with the default geometry changed. The faces of the box are SoTranslate2Draggers, the edges are SoRotateCylindricalDraggers, and the cubes are an SoScaleUniformDragger. Drag them and the dragger will update its translation , rotation and scaleFactor fields to reflect the changes. 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:

[a] Use an SoTransformBoxManip, which is subclassed from SoTransform. It creates one of these draggers and uses it as the interface to change its fields. (see the SoTransformBoxManip 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 SoTransformBoxDragger 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/transformBoxDragger.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, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger

Definition at line 174 of file SoTransformBoxDragger.h.


Constructor & Destructor Documentation

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

Member Function Documentation

static void SoTransformBoxDragger::fieldSensorCB ( void *  ,
SoSensor  
) [static, protected]

Reimplemented from SoInteractionKit.

static void SoTransformBoxDragger::initClass ( ) [static]

Reimplemented from SoDragger.

static void SoTransformBoxDragger::invalidateSurroundScaleCB ( void *  ,
SoDragger  
) [static, protected]
virtual void SoTransformBoxDragger::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 SoTransformBoxDragger::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 SoTransformBoxDragger::valueChangedCB ( void *  ,
SoDragger  
) [static, protected]

Member Data Documentation


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