Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoTransformerDragger Class Reference

The SoTransformerDragger provides geometry for translation, scaling and rotations. More...

#include <Inventor/draggers/SoTransformerDragger.h>

Inheritance diagram for SoTransformerDragger::

SoDragger SoInteractionKit SoBaseKit SoNode SoFieldContainer SoBase List of all members.

Public Types

enum  State {
  INACTIVE, RIT_X_ROTATE, TOP_Y_ROTATE, FNT_Z_ROTATE,
  LFT_X_ROTATE, BOT_Y_ROTATE, BAK_Z_ROTATE, PX_PY_PZ_3D_SCALE,
  PX_PY_NZ_3D_SCALE, PX_NY_PZ_3D_SCALE, PX_NY_NZ_3D_SCALE, NX_PY_PZ_3D_SCALE,
  NX_PY_NZ_3D_SCALE, NX_NY_PZ_3D_SCALE, NX_NY_NZ_3D_SCALE, RIT_TRANSLATE,
  TOP_TRANSLATE, FNT_TRANSLATE, LFT_TRANSLATE, BOT_TRANSLATE,
  BAK_TRANSLATE
}

Public Methods

 SoTransformerDragger (void)
State getCurrentState (void)
void unsquishKnobs (void)
SbBool isLocateHighlighting (void)
void setLocateHighlighting (SbBool onoff)
SbVec3f getBoxPointInWorldSpace (const SbVec3f &pointonunitbox)
SbVec3f getBoxDirInWorldSpace (const SbVec3f &dironunitbox)
SbVec3f getWorldPointInBoxSpace (const SbVec3f &pointinworldspace)
SbVec2f getWorldPointInPixelSpace (const SbVec3f &thepoint)
SbVec3f getInteractiveCenterInBoxSpace (void)

Static Public Methods

void initClass (void)
void setColinearThreshold (int newval)
int getColinearThreshold (void)

Public Attributes

SoSFRotation rotation
SoSFVec3f translation
SoSFVec3f scaleFactor
SoSFFloat minDiscRotDot

Protected Methods

 ~SoTransformerDragger ()
virtual SbBool setUpConnections (SbBool onoff, SbBool doitalways=FALSE)
virtual void setDefaultOnNonWritingFields (void)
void dragStart (void)
void drag (void)
void dragFinish (void)
void updateAntiSquishList (void)
void setAllPartSwitches (int scalewhich, int rotatewhich, int translatewhich)
int getMouseGestureDirection (SbBool x_ok, SbBool y_ok, SbBool z_ok)

Static Protected Methods

void startCB (void *f, SoDragger *d)
void motionCB (void *f, SoDragger *d)
void finishCB (void *f, SoDragger *d)
void metaKeyChangeCB (void *, SoDragger *)
void fieldSensorCB (void *f, SoSensor *s)
void valueChangedCB (void *f, SoDragger *d)
int getIgnoreAxis (SbVec2f axis[3][2], SbBool x_ok, SbBool y_ok, SbBool z_ok)
void makeMinorAxisPerpendicularIfColinear (SbVec2f origin, SbVec2f axisends[3][2], int index_a, int index_b)
SbBool isColinear (SbVec2f a1[2], SbVec2f a2[2], int pixels)

Protected Attributes

SoFieldSensortranslFieldSensor
SoFieldSensorscaleFieldSensor
SoFieldSensorrotateFieldSensor
SoNodeList antiSquishList

Detailed Description

The SoTransformerDragger provides geometry for translation, scaling and rotations.

Translate the dragger by clicking and dragging any of the (invisible) sides. Translation will default be done in the plane of the side the end-user selected. The user can hold down a SHIFT key to lock translation to a single of the axes in the plane. By holding down a CTRL key instead, translation can be done along the plane's normal vector.

Scaling is done by dragging the corner cubes. By default, uniform scaling will be done. Hold down SHIFT before selecting any of the corners to do non-uniform scaling. Uniform scaling towards a corner-point can be accomplished by holding down CTRL before clicking and dragging one of the cubes.

Rotation is done by dragging any of the 6 end-markers of the axis cross. The initial drag direction decides which orientation the rotation will be done in. Hold down SHIFT to do free-form rotation around the sphere instead.

This is a big and complex dragger which needs a fair amount of proper documentation when provided in end-user applications. If what you are trying to accomplish in your application does not really demand most of the features of this dragger, you are advised to investigate whether or not any of the less complex draggers can fulfill your requirements -- so you can provide an as simple as possible user interface to your end-users.

For the application programmer's convenience, the Coin library also provides a manipulator class called SoTransformBoxManip, which wraps the SoTransformBoxDragger into the necessary mechanisms for making direct insertion of this dragger into a scenegraph possible with very little effort.

See also:
SoTransformerManip


Member Enumeration Documentation

enum SoTransformerDragger::State
 

The various possible states the dragger might be in at any given time. That is: either SoTransformerDragger::INACTIVE if there's no interaction, or any of the other values to indicate what operation the end-user is currently executing.


Constructor & Destructor Documentation

SoTransformerDragger::SoTransformerDragger void
 

Default constructor, sets up the dragger nodekit catalog with the interaction and feedback geometry.

SoTransformerDragger::~SoTransformerDragger [protected]
 

Protected destructor.

(Dragger classes are derived from SoBase, so they are reference counted and automatically destroyed when their reference count goes to 0.)


Member Function Documentation

void SoTransformerDragger::initClass void [static]
 

Initializes type system for this dragger class.

Application programmers should usually not have to invoke this method, see documentation of SoInteraction::initClass().

Reimplemented from SoDragger.

SoTransformerDragger::State SoTransformerDragger::getCurrentState void
 

Returns an indicator for the current operation executed on the dragger by the end-user -- or SoTransformerDragger::INACTIVE if none.

SbBool SoTransformerDragger::setUpConnections SbBool onoff,
SbBool doitalways = FALSE
[protected, virtual]
 

Sets up all internal connections for instances of this class.

(This method will usually not be of interest to the application programmer, unless you want to extend the library with new custom nodekits or dragger classes. If so, see the SoBaseKit class documentation.)

Reimplemented from SoInteractionKit.

void SoTransformerDragger::setDefaultOnNonWritingFields void [protected, virtual]
 

(Be aware that this method is unlikely to be of interest to the application programmer who does not want to extend the library with new custom nodekits or draggers. If you indeed are writing extensions, see the information in the SoBaseKit class documentation.)

A virtual method that should call SoField::setDefault() with argument TRUE on part fields that should not be written upon scenegraph export operations.

This is typically done when:

  1. field value is NULL and part is NULL by default

  2. it is a leaf SoGroup or SoSeparator node with no children

  3. it is a leaf listpart with no children and a SoGroup or SoSeparator container

  4. it is a non-leaf part and it's of SoGroup type and all fields are at their default values

Subclasses should usually override this to do additional settings for new member fields. From the subclass, do remember to call "upwards" to your superclass' setDefaultOnNonWritingFields() method.

Reimplemented from SoDragger.

void SoTransformerDragger::startCB void * f,
SoDragger * d
[static, protected]
 

For internal use only.

void SoTransformerDragger::motionCB void * f,
SoDragger * d
[static, protected]
 

For internal use only.

void SoTransformerDragger::finishCB void * f,
SoDragger * d
[static, protected]
 

For internal use only.

void SoTransformerDragger::metaKeyChangeCB void * ,
SoDragger * d
[static, protected]
 

For internal use only.

void SoTransformerDragger::fieldSensorCB void * d,
SoSensor * s
[static, protected]
 

For internal use only.

Reimplemented from SoInteractionKit.

void SoTransformerDragger::valueChangedCB void * f,
SoDragger * d
[static, protected]
 

For internal use only.

void SoTransformerDragger::dragStart void [protected]
 

For internal use only.

void SoTransformerDragger::drag void [protected]
 

For internal use only.

void SoTransformerDragger::dragFinish void [protected]
 

For internal use only.

int SoTransformerDragger::getMouseGestureDirection SbBool x_ok,
SbBool y_ok,
SbBool z_ok
[protected]
 

Not implemented in Coin; should probably not have been public in the Open Inventor API. We'll consider to implement it if requested.

int SoTransformerDragger::getIgnoreAxis SbVec2f axis[3][2],
SbBool x_ok,
SbBool y_ok,
SbBool z_ok
[static, protected]
 

Not implemented in Coin; should probably not have been public in the Open Inventor API. We'll consider to implement it if requested.

void SoTransformerDragger::makeMinorAxisPerpendicularIfColinear SbVec2f origin,
SbVec2f axisends[3][2],
int index_a,
int index_b
[static, protected]
 

Not implemented in Coin; should probably not have been public in the Open Inventor API. We'll consider to implement it if requested.

SbBool SoTransformerDragger::isColinear SbVec2f a1[2],
SbVec2f a2[2],
int pixels
[static, protected]
 

Not implemented in Coin; should probably not have been public in the Open Inventor API. We'll consider to implement it if requested.


Member Data Documentation

SoSFRotation SoTransformerDragger::rotation
 

This field is continuously updated to contain the orientation of the dragger.

SoSFVec3f SoTransformerDragger::translation
 

The dragger's offset position from the local origo.

SoSFVec3f SoTransformerDragger::scaleFactor
 

Continuously updated to contain the current vector of scaling along the X, Y and Z axes.

SoFieldSensor * SoTransformerDragger::translFieldSensor [protected]
 

For internal use only.

SoFieldSensor * SoTransformerDragger::scaleFieldSensor [protected]
 

For internal use only.

SoFieldSensor * SoTransformerDragger::rotateFieldSensor [protected]
 

For internal use only.

SoNodeList SoTransformerDragger::antiSquishList [protected]
 

For internal use only.


The documentation for this class was generated from the following files:
Generated at Tue Mar 5 03:31:32 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001