Open Inventor Reference
SoJackDragger Class Reference

Jack-shaped object you rotate, translate, or scale by dragging with the mouse. More...

#include <Inventor/draggers/SoJackDragger.h>

Inheritance diagram for SoJackDragger:
SoDragger SoInteractionKit SoBaseKit SoNode SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoJackDragger ()
 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 any sensors, callbacks, and/or field connections.
virtual void setDefaultOnNonWritingFields ()
 Called by the SoBaseKit::write() method.
virtual ~SoJackDragger ()

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

SoJackDragger is a composite dragger in the shape of a jack from the children's game jacks. Three lines along the x, y, and z axes form the central star shape, which you can drag with the mouse to rotate the jack. Dragging any of the small cubes mounted at the end of the axes will scale the jack uniformly in all 3 dimensions. At the core of the jack is an SoDragPointDragger for translating the jack.

Each of these shapes is a different dragger with the default geometry changed. All of them are parts of the jack dragger, which keeps them moving together. The star is an SoRotateSphericalDragger, and dragging it updates the rotation field of the jack dragger. The small cubes are an SoScaleUniformDragger, tied to the scaleFactor field. The position of the SoDragPointDragger is given by the translation field. 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 SoJackManip, which is subclassed from SoTransform. It creates one of these draggers and uses it as the interface to change its fields. (see the SoJackManip 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 SoJackDragger 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/jackDragger.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, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger

Definition at line 197 of file SoJackDragger.h.


Constructor & Destructor Documentation

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

Member Function Documentation

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

Reimplemented from SoInteractionKit.

static void SoJackDragger::initClass ( ) [static]

Reimplemented from SoDragger.

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

Member Data Documentation

Definition at line 224 of file SoJackDragger.h.

Definition at line 226 of file SoJackDragger.h.

Definition at line 225 of file SoJackDragger.h.


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