Open Inventor Reference
|
Box-like object you scale, rotate, and translate by dragging with the mouse. More...
#include <Inventor/draggers/SoTransformBoxDragger.h>
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 | |
SoFieldSensor * | rotFieldSensor |
SoFieldSensor * | translFieldSensor |
SoFieldSensor * | scaleFieldSensor |
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.
TransformBoxDragger { renderCaching AUTO boundingBoxCaching AUTO renderCulling AUTO pickCulling AUTO isActive FALSE rotation 0 0 1 0 translation 0 0 0 scaleFactor 1 1 1 }
Definition at line 174 of file SoTransformBoxDragger.h.
SoTransformBoxDragger::SoTransformBoxDragger | ( | ) |
virtual SoTransformBoxDragger::~SoTransformBoxDragger | ( | ) | [protected, virtual] |
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] |
Definition at line 217 of file SoTransformBoxDragger.h.
SoFieldSensor* SoTransformBoxDragger::rotFieldSensor [protected] |
Definition at line 226 of file SoTransformBoxDragger.h.
Definition at line 219 of file SoTransformBoxDragger.h.
SoFieldSensor* SoTransformBoxDragger::scaleFieldSensor [protected] |
Definition at line 228 of file SoTransformBoxDragger.h.
Definition at line 218 of file SoTransformBoxDragger.h.
SoFieldSensor* SoTransformBoxDragger::translFieldSensor [protected] |
Definition at line 227 of file SoTransformBoxDragger.h.