Open Inventor Reference
SoDragPointDragger Class Reference

Object you can translate in 3D by dragging with the mouse. More...

#include <Inventor/draggers/SoDragPointDragger.h>

Inheritance diagram for SoDragPointDragger:
SoDragger SoInteractionKit SoBaseKit SoNode SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoDragPointDragger ()
 Constructor.
void setJumpLimit (float limit)
 Set the point at which the feedback axes will jump to a new position.
float getJumpLimit () const
 Get the point at which the feedback axes will jump to a new position.
void showNextDraggerSet ()
 The dragPoint dragger contains three pairs of draggers, each containing a plane dragger and a line dragger (see the Description above).

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 void setDefaultOnNonWritingFields ()
 Called by the SoBaseKit::write() method.
virtual ~SoDragPointDragger ()

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 *)

Protected Attributes

SoFieldSensorfieldSensor
 This sensor will watch the topSeparator part.

Detailed Description

SoDragPointDragger is a compound dragger that translates in all three dimensions when dragged with the mouse.

It is made up of six smaller draggers, which it displays two at a time. Each pair has one plane dragger and one line dragger. The line dragger is oriented perpendicular to the plane, so together the plane/line pair lets you move through all of 3-space.

DragPoint has a total of three such pairs, oriented along the x, y, and z axes of its local space. You can cycle through the three pairs by hitting the <Control> key with the cursor over the dragger. (You need not press the mouse button.)

The line draggers are SoTranslate1Draggers and the plane draggers are SoTranslate2Draggers. So you can use the <Shift> key to constrain the motion of a plane dragger along one of the two axes within the plane, as described in the SoTranslate2Draggers man page.

DragPoint adds extra feedback parts to provide a more intuitive idea of where you are placed in three-space. There are three feedback planes and three feedback axes; each corresponds to one of the plane or line draggers, but spans a much greater distance. When you drag along a line, that line's larger feedback axis is displayed, and remains anchored in space while the dragger slides along it. This helps establish the motion of the dragger relative to the rest of the scene. Similarly, when you drag within a plane, the larger (but transparent) feedback plane establishes a ground plane for you to move upon. The location of the dragger within the plane is pinpointed by two intersecting axes that always cross below the cursor and extend to the edges of the plane. When you move dragPoint to the edge of the feedback plane (or line), the feedback will jump to a new location in that direction, so that the dragger never leaves the feedback behind.

The primary directions of motion are given by the local space of the dragger. Transforms earlier in the scene will affect the dragger, its children, and the orientation of its directions of motion.

This node has a translation field which always reflects its position in local space. Setting the field moves the dragger to that point. You can also connect fields of other nodes or engines from this one to make them follow the dragger's motion.

Although the child draggers each have their own resources defining default part geometries, the dragPoint dragger overrides these with a new set of resources. It also defines resources for the feedback parts that it adds. These are detailed 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/dragPointDragger.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, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger

Definition at line 195 of file SoDragPointDragger.h.


Constructor & Destructor Documentation

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

Member Function Documentation

void SoDragPointDragger::drag ( ) [protected]
void SoDragPointDragger::dragFinish ( ) [protected]
void SoDragPointDragger::dragStart ( ) [protected]
static void SoDragPointDragger::fieldSensorCB ( void *  ,
SoSensor  
) [static, protected]

Reimplemented from SoInteractionKit.

static void SoDragPointDragger::finishCB ( void *  ,
SoDragger  
) [static, protected]
float SoDragPointDragger::getJumpLimit ( ) const [inline]

Definition at line 260 of file SoDragPointDragger.h.

static void SoDragPointDragger::initClass ( ) [static]

Reimplemented from SoDragger.

static void SoDragPointDragger::metaKeyChangeCB ( void *  ,
SoDragger  
) [static, protected]
static void SoDragPointDragger::motionCB ( void *  ,
SoDragger  
) [static, protected]
virtual void SoDragPointDragger::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.

void SoDragPointDragger::setJumpLimit ( float  limit) [inline]

For example, if set to .1 (the default), the feedback axes will jump when the dragger gets within 10% of the end of the axis.

Definition at line 257 of file SoDragPointDragger.h.

virtual SbBool SoDragPointDragger::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.

void SoDragPointDragger::showNextDraggerSet ( )

The dragger starts with the (y-line/xz-plane) pair displayed. Calling this method will cycle next through the (z-line/xy-plane), then the (x-line/yz-plane).

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

Member Data Documentation

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 278 of file SoDragPointDragger.h.


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