Open Inventor Reference
|
Cubic object you can translate and scale by dragging with the mouse. More...
#include <Inventor/draggers/SoTabBoxDragger.h>
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 | |
SoFieldSensor * | translFieldSensor |
SoFieldSensor * | scaleFieldSensor |
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.
TabBoxDragger { renderCaching AUTO boundingBoxCaching AUTO renderCulling AUTO pickCulling AUTO isActive FALSE translation 0 0 0 scaleFactor 1 1 1 }
Definition at line 157 of file SoTabBoxDragger.h.
SoTabBoxDragger::SoTabBoxDragger | ( | ) |
virtual SoTabBoxDragger::~SoTabBoxDragger | ( | ) | [protected, virtual] |
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] |
Definition at line 191 of file SoTabBoxDragger.h.
SoFieldSensor* SoTabBoxDragger::scaleFieldSensor [protected] |
Definition at line 206 of file SoTabBoxDragger.h.
Definition at line 190 of file SoTabBoxDragger.h.
SoFieldSensor* SoTabBoxDragger::translFieldSensor [protected] |
Definition at line 205 of file SoTabBoxDragger.h.