Open Inventor Reference
|
Object you can rotate about a spherical surface by dragging with the mouse. More...
#include <Inventor/draggers/SoRotateSphericalDragger.h>
Public Member Functions | |
SoRotateSphericalDragger () | |
Constructor. | |
void | setProjector (SbSphereProjector *p) |
Set a different sphere projector. | |
const SbSphereProjector * | getProjector () 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 | |
SbSphereProjector * | sphereProj |
Sphere projector to use. | |
SbBool | userProj |
using a user defined projector? | |
SoFieldSensor * | fieldSensor |
This sensor will watch the topSeparator part. |
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.
RotateSphericalDragger { renderCaching AUTO boundingBoxCaching AUTO renderCulling AUTO pickCulling AUTO isActive FALSE rotation 0 0 1 0 }
Definition at line 148 of file SoRotateSphericalDragger.h.
SoRotateSphericalDragger::SoRotateSphericalDragger | ( | ) |
virtual SoRotateSphericalDragger::~SoRotateSphericalDragger | ( | ) | [protected, virtual] |
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] |
SoFieldSensor* SoRotateSphericalDragger::fieldSensor [protected] |
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.
SbMatrix SoRotateSphericalDragger::prevMotionMatrix [protected] |
Definition at line 188 of file SoRotateSphericalDragger.h.
SbVec3f SoRotateSphericalDragger::prevWorldHitPt [protected] |
Definition at line 189 of file SoRotateSphericalDragger.h.
Definition at line 164 of file SoRotateSphericalDragger.h.
SbSphereProjector* SoRotateSphericalDragger::sphereProj [protected] |
Definition at line 190 of file SoRotateSphericalDragger.h.
SbBool SoRotateSphericalDragger::userProj [protected] |
Definition at line 191 of file SoRotateSphericalDragger.h.