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

SoTransformerDragger Class Reference
[Draggers]

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

Public Methods

 SoTransformerDragger (void)
State getCurrentState (void)

Static Public Methods

void initClass (void)

Public Attributes

SoSFRotation rotation
SoSFVec3f translation
SoSFVec3f scaleFactor

Protected Methods

 ~SoTransformerDragger ()
virtual SbBool setUpConnections (SbBool onoff, SbBool doitalways=FALSE)
virtual void setDefaultOnNonWritingFields (void)
void dragStart (void)
void drag (void)
void dragFinish (void)
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.

Here's how the dragger looks with it's default geometry in the inactive state:

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 SoTransformerManip, which wraps the SoTransformerDragger 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.

Node kit structure (new entries versus parent class marked with arrow prefix):

  CLASS SoTransformerDragger
  -->"this"
        "callbackList"
        "topSeparator"
           "motionMatrix"
  -->      "surroundScale"
  -->      "overallStyle"
           "geomSeparator"
  -->         "axisFeedbackSep"
  -->            "axisFeedbackLocation"
  -->            "xAxisFeedbackSwitch"
  -->               "xAxisFeedbackActive"
  -->               "xAxisFeedbackSelect"
  -->               "xCrosshairFeedback"
  -->            "yAxisFeedbackSwitch"
  -->               "yAxisFeedbackActive"
  -->               "yAxisFeedbackSelect"
  -->               "yCrosshairFeedback"
  -->            "zAxisFeedbackSwitch"
  -->               "zAxisFeedbackActive"
  -->               "zAxisFeedbackSelect"
  -->               "zCrosshairFeedback"
  -->         "translateBoxFeedbackSep"
  -->            "translateBoxFeedbackSwitch"
  -->               "translateBoxFeedbackRotation"
  -->               "translateBoxFeedback"
  -->         "scaleBoxFeedbackSwitch"
  -->            "scaleBoxFeedback"
  -->         "posXWallFeedbackSwitch"
  -->            "posXWallFeedback"
  -->            "posXRoundWallFeedback"
  -->         "posYWallFeedbackSwitch"
  -->            "posYWallFeedback"
  -->            "posYRoundWallFeedback"
  -->         "posZWallFeedbackSwitch"
  -->            "posZWallFeedback"
  -->            "posZRoundWallFeedback"
  -->         "negXWallFeedbackSwitch"
  -->            "negXWallFeedback"
  -->            "negXRoundWallFeedback"
  -->         "negYWallFeedbackSwitch"
  -->            "negYWallFeedback"
  -->            "negYRoundWallFeedback"
  -->         "negZWallFeedbackSwitch"
  -->            "negZWallFeedback"
  -->            "negZRoundWallFeedback"
  -->         "radialFeedbackSwitch"
  -->            "radialFeedback"
  -->      "translatorSep"
  -->         "translator1Switch"
  -->            "translator1LocateGroup"
  -->               "translator1"
  -->            "translator1Active"
  -->         "translator2Switch"
  -->            "translator2LocateGroup"
  -->               "translator2"
  -->            "translator2Active"
  -->         "translator3Switch"
  -->            "translator3LocateGroup"
  -->               "translator3"
  -->            "translator3Active"
  -->         "translator4Switch"
  -->            "translator4LocateGroup"
  -->               "translator4"
  -->            "translator4Active"
  -->         "translator5Switch"
  -->            "translator5LocateGroup"
  -->               "translator5"
  -->            "translator5Active"
  -->         "translator6Switch"
  -->            "translator6LocateGroup"
  -->               "translator6"
  -->            "translator6Active"
  -->      "rotatorSep"
  -->         "rotator1Switch"
  -->            "rotator1LocateGroup"
  -->               "rotator1"
  -->            "rotator1Active"
  -->         "rotator2Switch"
  -->            "rotator2LocateGroup"
  -->               "rotator2"
  -->            "rotator2Active"
  -->         "rotator3Switch"
  -->            "rotator3LocateGroup"
  -->               "rotator3"
  -->            "rotator3Active"
  -->         "rotator4Switch"
  -->            "rotator4LocateGroup"
  -->               "rotator4"
  -->            "rotator4Active"
  -->         "rotator5Switch"
  -->            "rotator5LocateGroup"
  -->               "rotator5"
  -->            "rotator5Active"
  -->         "rotator6Switch"
  -->            "rotator6LocateGroup"
  -->               "rotator6"
  -->            "rotator6Active"
  -->      "scaleSep"
  -->         "scale1Switch"
  -->            "scale1LocateGroup"
  -->               "scale1"
  -->            "scale1Active"
  -->         "scale2Switch"
  -->            "scale2LocateGroup"
  -->               "scale2"
  -->            "scale2Active"
  -->         "scale3Switch"
  -->            "scale3LocateGroup"
  -->               "scale3"
  -->            "scale3Active"
  -->         "scale4Switch"
  -->            "scale4LocateGroup"
  -->               "scale4"
  -->            "scale4Active"
  -->         "scale5Switch"
  -->            "scale5LocateGroup"
  -->               "scale5"
  -->            "scale5Active"
  -->         "scale6Switch"
  -->            "scale6LocateGroup"
  -->               "scale6"
  -->            "scale6Active"
  -->         "scale7Switch"
  -->            "scale7LocateGroup"
  -->               "scale7"
  -->            "scale7Active"
  -->         "scale8Switch"
  -->            "scale8LocateGroup"
  -->               "scale8"
  -->            "scale8Active"
  -->      "circleFeedbackSep"
  -->         "circleFeedbackTransformSwitch"
  -->            "circleFeedbackAntiSquish"
  -->            "circleFeedbackTransform"
  -->         "xCircleFeedbackSwitch"
  -->            "xCircleFeedback"
  -->         "yCircleFeedbackSwitch"
  -->            "yCircleFeedback"
  -->         "zCircleFeedbackSwitch"
  -->            "zCircleFeedback"
  

(See SoBaseKit::printDiagram() for information about the output formatting.)

Detailed information on catalog parts:

  CLASS SoTransformerDragger
  PVT   "this",  SoTransformerDragger  --- 
        "callbackList",  SoNodeKitListPart [ SoCallback, SoEventCallback ] 
  PVT   "topSeparator",  SoSeparator  --- 
  PVT   "motionMatrix",  SoMatrixTransform  --- 
        "surroundScale",  SoSurroundScale  --- 
  PVT   "overallStyle",  SoGroup  --- 
  PVT   "geomSeparator",  SoSeparator  --- 
  PVT   "translatorSep",  SoSeparator  --- 
  PVT   "translator1Switch",  SoSwitch  --- 
  PVT   "translator1LocateGroup",  SoLocateHighlight  --- 
        "translator1",  SoSeparator  --- 
        "translator1Active",  SoSeparator  --- 
  PVT   "translator2Switch",  SoSwitch  --- 
  PVT   "translator2LocateGroup",  SoLocateHighlight  --- 
        "translator2",  SoSeparator  --- 
        "translator2Active",  SoSeparator  --- 
  PVT   "translator3Switch",  SoSwitch  --- 
  PVT   "translator3LocateGroup",  SoLocateHighlight  --- 
        "translator3",  SoSeparator  --- 
        "translator3Active",  SoSeparator  --- 
  PVT   "translator4Switch",  SoSwitch  --- 
  PVT   "translator4LocateGroup",  SoLocateHighlight  --- 
        "translator4",  SoSeparator  --- 
        "translator4Active",  SoSeparator  --- 
  PVT   "translator5Switch",  SoSwitch  --- 
  PVT   "translator5LocateGroup",  SoLocateHighlight  --- 
        "translator5",  SoSeparator  --- 
        "translator5Active",  SoSeparator  --- 
  PVT   "translator6Switch",  SoSwitch  --- 
  PVT   "translator6LocateGroup",  SoLocateHighlight  --- 
        "translator6",  SoSeparator  --- 
        "translator6Active",  SoSeparator  --- 
  PVT   "rotatorSep",  SoSeparator  --- 
  PVT   "rotator1Switch",  SoSwitch  --- 
  PVT   "rotator1LocateGroup",  SoLocateHighlight  --- 
        "rotator1",  SoSeparator  --- 
        "rotator1Active",  SoSeparator  --- 
  PVT   "rotator2Switch",  SoSwitch  --- 
  PVT   "rotator2LocateGroup",  SoLocateHighlight  --- 
        "rotator2",  SoSeparator  --- 
        "rotator2Active",  SoSeparator  --- 
  PVT   "rotator3Switch",  SoSwitch  --- 
  PVT   "rotator3LocateGroup",  SoLocateHighlight  --- 
        "rotator3",  SoSeparator  --- 
        "rotator3Active",  SoSeparator  --- 
  PVT   "rotator4Switch",  SoSwitch  --- 
  PVT   "rotator4LocateGroup",  SoLocateHighlight  --- 
        "rotator4",  SoSeparator  --- 
        "rotator4Active",  SoSeparator  --- 
  PVT   "rotator5Switch",  SoSwitch  --- 
  PVT   "rotator5LocateGroup",  SoLocateHighlight  --- 
        "rotator5",  SoSeparator  --- 
        "rotator5Active",  SoSeparator  --- 
  PVT   "rotator6Switch",  SoSwitch  --- 
  PVT   "rotator6LocateGroup",  SoLocateHighlight  --- 
        "rotator6",  SoSeparator  --- 
        "rotator6Active",  SoSeparator  --- 
  PVT   "scaleSep",  SoSeparator  --- 
  PVT   "scale1Switch",  SoSwitch  --- 
  PVT   "scale1LocateGroup",  SoLocateHighlight  --- 
        "scale1",  SoSeparator  --- 
        "scale1Active",  SoSeparator  --- 
  PVT   "scale2Switch",  SoSwitch  --- 
  PVT   "scale2LocateGroup",  SoLocateHighlight  --- 
        "scale2",  SoSeparator  --- 
        "scale2Active",  SoSeparator  --- 
  PVT   "scale3Switch",  SoSwitch  --- 
  PVT   "scale3LocateGroup",  SoLocateHighlight  --- 
        "scale3",  SoSeparator  --- 
        "scale3Active",  SoSeparator  --- 
  PVT   "scale4Switch",  SoSwitch  --- 
  PVT   "scale4LocateGroup",  SoLocateHighlight  --- 
        "scale4",  SoSeparator  --- 
        "scale4Active",  SoSeparator  --- 
  PVT   "scale5Switch",  SoSwitch  --- 
  PVT   "scale5LocateGroup",  SoLocateHighlight  --- 
        "scale5",  SoSeparator  --- 
        "scale5Active",  SoSeparator  --- 
  PVT   "scale6Switch",  SoSwitch  --- 
  PVT   "scale6LocateGroup",  SoLocateHighlight  --- 
        "scale6",  SoSeparator  --- 
        "scale6Active",  SoSeparator  --- 
  PVT   "scale7Switch",  SoSwitch  --- 
  PVT   "scale7LocateGroup",  SoLocateHighlight  --- 
        "scale7",  SoSeparator  --- 
        "scale7Active",  SoSeparator  --- 
  PVT   "scale8Switch",  SoSwitch  --- 
  PVT   "scale8LocateGroup",  SoLocateHighlight  --- 
        "scale8",  SoSeparator  --- 
        "scale8Active",  SoSeparator  --- 
  PVT   "circleFeedbackSep",  SoSeparator  --- 
  PVT   "circleFeedbackTransformSwitch",  SoSwitch  --- 
  PVT   "circleFeedbackAntiSquish",  SoAntiSquish  --- 
  PVT   "circleFeedbackTransform",  SoTransform  --- 
  PVT   "xCircleFeedbackSwitch",  SoSwitch  --- 
        "xCircleFeedback",  SoSeparator  --- 
  PVT   "yCircleFeedbackSwitch",  SoSwitch  --- 
        "yCircleFeedback",  SoSeparator  --- 
  PVT   "zCircleFeedbackSwitch",  SoSwitch  --- 
        "zCircleFeedback",  SoSeparator  --- 
  PVT   "axisFeedbackSep",  SoSeparator  --- 
  PVT   "axisFeedbackLocation",  SoTranslation  --- 
  PVT   "xAxisFeedbackSwitch",  SoSwitch  --- 
        "xAxisFeedbackActive",  SoSeparator  --- 
        "xAxisFeedbackSelect",  SoSeparator  --- 
        "xCrosshairFeedback",  SoSeparator  --- 
  PVT   "yAxisFeedbackSwitch",  SoSwitch  --- 
        "yAxisFeedbackActive",  SoSeparator  --- 
        "yAxisFeedbackSelect",  SoSeparator  --- 
        "yCrosshairFeedback",  SoSeparator  --- 
  PVT   "zAxisFeedbackSwitch",  SoSwitch  --- 
        "zAxisFeedbackActive",  SoSeparator  --- 
        "zAxisFeedbackSelect",  SoSeparator  --- 
        "zCrosshairFeedback",  SoSeparator  --- 
  PVT   "translateBoxFeedbackSep",  SoSeparator  --- 
  PVT   "translateBoxFeedbackSwitch",  SoSwitch  --- 
  PVT   "translateBoxFeedbackRotation",  SoRotation  --- 
        "translateBoxFeedback",  SoSeparator  --- 
  PVT   "scaleBoxFeedbackSwitch",  SoSwitch  --- 
        "scaleBoxFeedback",  SoSeparator  --- 
  PVT   "posXWallFeedbackSwitch",  SoSwitch  --- 
        "posXWallFeedback",  SoSeparator  --- 
        "posXRoundWallFeedback",  SoSeparator  --- 
  PVT   "posYWallFeedbackSwitch",  SoSwitch  --- 
        "posYWallFeedback",  SoSeparator  --- 
        "posYRoundWallFeedback",  SoSeparator  --- 
  PVT   "posZWallFeedbackSwitch",  SoSwitch  --- 
        "posZWallFeedback",  SoSeparator  --- 
        "posZRoundWallFeedback",  SoSeparator  --- 
  PVT   "negXWallFeedbackSwitch",  SoSwitch  --- 
        "negXWallFeedback",  SoSeparator  --- 
        "negXRoundWallFeedback",  SoSeparator  --- 
  PVT   "negYWallFeedbackSwitch",  SoSwitch  --- 
        "negYWallFeedback",  SoSeparator  --- 
        "negYRoundWallFeedback",  SoSeparator  --- 
  PVT   "negZWallFeedbackSwitch",  SoSwitch  --- 
        "negZWallFeedback",  SoSeparator  --- 
        "negZRoundWallFeedback",  SoSeparator  --- 
  PVT   "radialFeedbackSwitch",  SoSwitch  --- 
        "radialFeedback",  SoSeparator  --- 
  

(See SoBaseKit::printTable() for information about the output formatting.)

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::init().

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]
 

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

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

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

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

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

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

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

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

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

Reimplemented from SoInteractionKit.

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

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

void SoTransformerDragger::dragStart void    [protected]
 

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

Called when dragger is selected (picked) by the user.

void SoTransformerDragger::drag void    [protected]
 

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

Called when user drags the mouse after picking the dragger.

void SoTransformerDragger::dragFinish void    [protected]
 

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

Called when mouse button is released after picking and interacting with the dragger.

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]
 

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

SoFieldSensor * SoTransformerDragger::scaleFieldSensor [protected]
 

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

SoFieldSensor * SoTransformerDragger::rotateFieldSensor [protected]
 

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

SoNodeList SoTransformerDragger::antiSquishList [protected]
 

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.


The documentation for this class was generated from the following files:
Generated on Sat May 24 22:39:50 2003 for Coin by doxygen1.2.18