Open Inventor Reference
|
Object you can translate within a plane by dragging with the mouse. More...
#include <Inventor/draggers/SoTranslate2Dragger.h>
Public Member Functions | |
SoTranslate2Dragger () | |
Constructor. | |
Static Public Member Functions | |
static void | initClass () |
initialize the class | |
Public Attributes | |
SoSFVec3f | translation |
Protected Member Functions | |
void | dragStart () |
void | drag () |
void | dragFinish () |
virtual SbBool | setUpConnections (SbBool onOff, SbBool doItAlways=FALSE) |
detach/attach any sensors, callbacks, and/or field connections. | |
virtual | ~SoTranslate2Dragger () |
Static Protected Member Functions | |
static void | startCB (void *, SoDragger *) |
static void | motionCB (void *, SoDragger *) |
static void | finishCB (void *, SoDragger *) |
static void | fieldSensorCB (void *, SoSensor *) |
static void | valueChangedCB (void *, SoDragger *) |
static void | metaKeyChangeCB (void *, SoDragger *) |
Callback for pressing and releasing the meta keys. | |
Protected Attributes | |
SbVec3f | worldRestartPt |
used if SHIFT key goes down to initiate a new gesture. | |
SbPlaneProjector * | planeProj |
projector for planar scaling | |
SoFieldSensor * | fieldSensor |
This sensor will watch the topSeparator part. |
SoTranslate2Dragger is a simple dragger that translates in two dimensions when dragged with the mouse. It moves within the x-y plane of its local space, determined by its location in the scene graph. Transformation nodes placed before it will affect both the dragger and the direction of motion.
Pressing the <Shift>
key allows you to constrain motion to either the 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.
This node has a translation field which always reflects its position in local space. 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.
This dragger contains six parts, translator, translatorActive, feedback, feedbackActive, xAxisFeedback, and yAxisFeedback. The last two parts are only displayed during motion, and only when their direction of motion is enabled. (Pressing the <Shift>
key and then dragging disables one of the two directions.)
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 /usr/share/data/draggerDefaults/translate2Dragger.iv into your own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to that directory.
Translate2Dragger { renderCaching AUTO boundingBoxCaching AUTO renderCulling AUTO pickCulling AUTO isActive FALSE translation 0 0 0 }
Definition at line 171 of file SoTranslate2Dragger.h.
SoTranslate2Dragger::SoTranslate2Dragger | ( | ) |
virtual SoTranslate2Dragger::~SoTranslate2Dragger | ( | ) | [protected, virtual] |
void SoTranslate2Dragger::drag | ( | ) | [protected] |
void SoTranslate2Dragger::dragFinish | ( | ) | [protected] |
void SoTranslate2Dragger::dragStart | ( | ) | [protected] |
static void SoTranslate2Dragger::fieldSensorCB | ( | void * | , |
SoSensor * | |||
) | [static, protected] |
Reimplemented from SoInteractionKit.
static void SoTranslate2Dragger::finishCB | ( | void * | , |
SoDragger * | |||
) | [static, protected] |
static void SoTranslate2Dragger::initClass | ( | ) | [static] |
Reimplemented from SoDragger.
static void SoTranslate2Dragger::metaKeyChangeCB | ( | void * | , |
SoDragger * | |||
) | [static, protected] |
static void SoTranslate2Dragger::motionCB | ( | void * | , |
SoDragger * | |||
) | [static, protected] |
virtual SbBool SoTranslate2Dragger::setUpConnections | ( | SbBool | onOff, |
SbBool | doItAlways = FALSE |
||
) | [protected, virtual] |
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 SoTranslate2Dragger::startCB | ( | void * | , |
SoDragger * | |||
) | [static, protected] |
static void SoTranslate2Dragger::valueChangedCB | ( | void * | , |
SoDragger * | |||
) | [static, protected] |
SoFieldSensor* SoTranslate2Dragger::fieldSensor [protected] |
If the part changes to a new node, then the fields of the old part will be disconnected and the fields of the new part will be connected. Connections are made from/to the renderCaching, boundingBoxCaching, renderCulling and pickCulling fields. This way, the SoInteractionKit can be treated from the outside just like a regular SoSeparator node. Setting the fields will affect caching and culling, even though the topSeparator takes care of it. oldTopSep keeps track of the part for comparison.
Reimplemented from SoInteractionKit.
Definition at line 205 of file SoTranslate2Dragger.h.
SbPlaneProjector* SoTranslate2Dragger::planeProj [protected] |
Definition at line 199 of file SoTranslate2Dragger.h.
Definition at line 190 of file SoTranslate2Dragger.h.
SbVec3f SoTranslate2Dragger::worldRestartPt [protected] |
Definition at line 197 of file SoTranslate2Dragger.h.