Open Inventor Reference
|
Object you rotate along a cylindrical surface by dragging with the mouse. More...
#include <Inventor/draggers/SoRotateCylindricalDragger.h>
Public Member Functions | |
SoRotateCylindricalDragger () | |
Constructor. | |
void | setProjector (SbCylinderProjector *p) |
Set a different cylinder projector. | |
const SbCylinderProjector * | getProjector () const |
Get cylinder 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 | ~SoRotateCylindricalDragger () |
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 | |
SbCylinderProjector * | cylinderProj |
Cylinder projector to use. | |
SbBool | userProj |
using a user defined projector? | |
SoFieldSensor * | fieldSensor |
This sensor will watch the topSeparator part. |
SoRotateCylindricalDragger is a simple dragger that rotates about the y axis of its local space. The feel of the rotation is as if you were spinning a cylinder about its axis of rotation. The local space is determined by its 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/rotateCylindricalDragger.iv into your own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to that directory.
RotateCylindricalDragger { renderCaching AUTO boundingBoxCaching AUTO renderCulling AUTO pickCulling AUTO isActive FALSE rotation 0 0 1 0 }
Definition at line 146 of file SoRotateCylindricalDragger.h.
SoRotateCylindricalDragger::SoRotateCylindricalDragger | ( | ) |
virtual SoRotateCylindricalDragger::~SoRotateCylindricalDragger | ( | ) | [protected, virtual] |
virtual void SoRotateCylindricalDragger::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 SoRotateCylindricalDragger::doneCB | ( | void * | , |
SoDragger * | |||
) | [static, protected] |
void SoRotateCylindricalDragger::drag | ( | ) | [protected] |
void SoRotateCylindricalDragger::dragFinish | ( | ) | [protected] |
void SoRotateCylindricalDragger::dragStart | ( | ) | [protected] |
static void SoRotateCylindricalDragger::fieldSensorCB | ( | void * | , |
SoSensor * | |||
) | [static, protected] |
Reimplemented from SoInteractionKit.
const SbCylinderProjector* SoRotateCylindricalDragger::getProjector | ( | ) | const [inline] |
Definition at line 177 of file SoRotateCylindricalDragger.h.
static void SoRotateCylindricalDragger::initClass | ( | ) | [static] |
Reimplemented from SoDragger.
static void SoRotateCylindricalDragger::motionCB | ( | void * | , |
SoDragger * | |||
) | [static, protected] |
void SoRotateCylindricalDragger::setProjector | ( | SbCylinderProjector * | p | ) |
See the SbCylinderProjector man pages to find out how each kind affects the feel of your dragger's motion. The default uses an SbCylinderPlaneProjector.
Passing in NULL will cause this 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 axis and radius of the cylinder are determined by the dragger, based on the y-axis in local space and how far the initial mouse click occured from the center of rotation.
virtual SbBool SoRotateCylindricalDragger::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 SoRotateCylindricalDragger::startCB | ( | void * | , |
SoDragger * | |||
) | [static, protected] |
static void SoRotateCylindricalDragger::valueChangedCB | ( | void * | , |
SoDragger * | |||
) | [static, protected] |
Definition at line 184 of file SoRotateCylindricalDragger.h.
SoFieldSensor* SoRotateCylindricalDragger::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 196 of file SoRotateCylindricalDragger.h.
Definition at line 162 of file SoRotateCylindricalDragger.h.
SbBool SoRotateCylindricalDragger::userProj [protected] |
Definition at line 185 of file SoRotateCylindricalDragger.h.