Open Inventor Reference
SoRotateSphericalDragger Class Reference

Object you can rotate about a spherical surface by dragging with the mouse. More...

#include <Inventor/draggers/SoRotateSphericalDragger.h>

Inheritance diagram for SoRotateSphericalDragger:
SoDragger SoInteractionKit SoBaseKit SoNode SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoRotateSphericalDragger ()
 Constructor.
void setProjector (SbSphereProjector *p)
 Set a different sphere projector.
const SbSphereProjectorgetProjector () const
 Get the projector.

Static Public Member Functions

static void initClass ()
 initialize the class

Public Attributes

SoSFRotation rotation

Protected Member Functions

virtual void copyContents (const SoFieldContainer *fromFC, SbBool copyConnections)
 Redefines this to also copy the projector.
void dragStart ()
void drag ()
void dragFinish ()
virtual SbBool setUpConnections (SbBool onOff, SbBool doItAlways=FALSE)
 detach/attach any sensors, callbacks, and/or field connections.
virtual ~SoRotateSphericalDragger ()

Static Protected Member Functions

static void startCB (void *, SoDragger *)
static void motionCB (void *, SoDragger *)
static void doneCB (void *, SoDragger *)
static void fieldSensorCB (void *, SoSensor *)
static void valueChangedCB (void *, SoDragger *)

Protected Attributes

SbMatrix prevMotionMatrix
 used during interaction
SbVec3f prevWorldHitPt
 used during interaction
SbSphereProjectorsphereProj
 Sphere projector to use.
SbBool userProj
 using a user defined projector?
SoFieldSensorfieldSensor
 This sensor will watch the topSeparator part.

Detailed Description

SoRotateSphericalDragger is a simple dragger that rotates freely in all directions. The feel of the rotation is as if you were rolling a ball. The center of rotation is the origin of the local space, determined by the dragger's location in the scene graph. Transformation nodes placed before it will affect both the dragger and the direction of motion.

This node has a rotation field which always reflects its orientation in local space. If you set the field, the dragger will rotate accordingly. You can also connect fields of other nodes or engines from this one to make them follow the dragger's orientation.

This dragger contains four parts, rotator, rotatorActive, feedback, and feedbackActive.

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/rotateSphericalDragger.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, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger

Definition at line 148 of file SoRotateSphericalDragger.h.


Constructor & Destructor Documentation

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

Member Function Documentation

virtual void SoRotateSphericalDragger::copyContents ( const SoFieldContainer fromFC,
SbBool  copyConnections 
) [protected, virtual]

The projector needs to be copied since the user can set it.

Reimplemented from SoInteractionKit.

static void SoRotateSphericalDragger::doneCB ( void *  ,
SoDragger  
) [static, protected]
void SoRotateSphericalDragger::drag ( ) [protected]
void SoRotateSphericalDragger::dragFinish ( ) [protected]
void SoRotateSphericalDragger::dragStart ( ) [protected]
static void SoRotateSphericalDragger::fieldSensorCB ( void *  ,
SoSensor  
) [static, protected]

Reimplemented from SoInteractionKit.

const SbSphereProjector* SoRotateSphericalDragger::getProjector ( ) const [inline]

Definition at line 181 of file SoRotateSphericalDragger.h.

static void SoRotateSphericalDragger::initClass ( ) [static]

Reimplemented from SoDragger.

static void SoRotateSphericalDragger::motionCB ( void *  ,
SoDragger  
) [static, protected]
void SoRotateSphericalDragger::setProjector ( SbSphereProjector p)

See the SbSphereProjector man pages to find out how each kind affects the feel of your dragger's motion. The default uses an SbSpherePlaneProjector.

Passing in NULL will cause the default type of projector to be used. Any projector you pass in will be deleted by this dragger when this dragger is deleted. Note that the center and radius of the sphere are determined by the dragger, based on the origin of the local space and the distance between the initial mouse click and that origin.

virtual SbBool SoRotateSphericalDragger::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 SoRotateSphericalDragger::startCB ( void *  ,
SoDragger  
) [static, protected]
static void SoRotateSphericalDragger::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 202 of file SoRotateSphericalDragger.h.


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