SoTrackballDragger — striped ball you can rotate or scale uniformly by dragging with the mouse
Contents
Catalog Parts
┌──────────────────────────────────────────────────────────────┐
│ Allparts │
│ NULLby │
│ PartNamePartTypeDefaultTypeDefault │
│ │
│ callbackList NodeKitListPart -- yes │
│ surroundScale SurroundScale -- yes │
│ antiSquish AntiSquish -- no │
│ rotator Separator -- yes │
│ rotatorActive Separator -- yes │
│ XRotator Separator -- yes │
│ XRotatorActive Separator -- yes │
│ YRotator Separator -- yes │
│ YRotatorActive Separator -- yes │
│ ZRotator Separator -- yes │
│ ZRotatorActive Separator -- yes │
│ userAxis Separator -- yes │
│ userAxisActive Separator -- yes │
│ userRotator Separator -- yes │
│ userRotatorActive Separator -- yes │
│ │
└──────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────┐
│ Extrainformationforlistpartsfromabovetable │
│ │
│ PartNameContainerTypePermissibleTypes │
│ │
│ callbackList Separator Callback, EventCallback │
│ │
└────────────────────────────────────────────────────────────────┘
Description
SoTrackballDragger is a ball wrapped in three circular stripes. The stripes are oriented like wheels that
spin around the x, y, and z axes. Drag the stripes to rotate the trackball around those axes. You do not
have to hit the lines; pick anywhere within the stripe's outline. To rotate the trackball freely in 3
dimensions, click the area between the stripes and then drag. An invisible but pickable sphere initiates
this dragging. If the mouse is still moving when you release it, the trackball will continue to spin.
Press the <Control> key to scale the trackball uniformly instead of rotating.
Press the <Shift> key and the useraxis appears; this is a draggable axis with an extra stripe around it.
Moving the mouse along the surface of the sphere drags the 'pole' of the axis. Release the <Shift> key
and the user axis remains; drag the new stripe for constrained rotation around the user axis. To make the
user axis disappear, press <Shift> and drag the pole to where two of other stripes intersect. This aligns
the user axis with a primary axis, at which point the user axis disappears.
As you drag the trackball, it updates its rotation field, or its scaleFactor field if the <Control> key
is down. As with all draggers, if you change the fields the dragger moves in response.
Remember: This is not an SoTransform!. If you want to move other objects with this dragger, you can
either:
[a] Use an SoTrackballManip, which is subclassed from SoTransform. The manipulator creates one of these
draggers and uses it as the interface to edit the manipulator's fields. (see the SoTrackballManip
reference page).
[b] Use field-to-field connections to connect the fields of this dragger to those of any SoTransformation
node.
You can change the parts in any instance of this dragger using setPart(). The default part geometries are
defined as resources for this SoTrackballDragger class. They are detailed in the Dragger Resources
section of the online reference page for this class. You can make your program use different default
resources for the parts by copying the file /usr/share/data/draggerDefaults/trackballDragger.iv into your
own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to
that directory.
Dragger Resources
.in 0n+.5i
Resource: trackballRotator
.in 0n+.5i
Part: rotator
Appearance: Invisible but pickable sphere
Description: Initiates unconstrained 3D rotation. Slightly smaller radius than the stripes, so you
must pick between the stripes to use it.
.in 0n+.5i
Resource: trackballRotatorActive
.in 0n+.5i
Part: rotatorActive
Appearance: Invisible sphere
Description: Displayed during unconstrained 3D rotation.
.in 0n+.5i
Resource: trackballXRotator
.in 0n+.5i
Part: XRotator
Appearance: White outline of a stripe aligned with the X axis.
Description: Pick this to initiate constrained rotation about the X axis.
.in 0n+.5i
Resource: trackballXRotatorActive
.in 0n+.5i
Part: XRotatorActive
Appearance: Yellow version of the regular XRotator
Description: Displayed during constrained rotation about the X axis.
.in 0n+.5i
Resource: trackballYRotator
.in 0n+.5i
Part: YRotator
Appearance: White outline of a stripe aligned with the Y axis.
Description: Pick this to initiate constrained rotation about the Y axis.
.in 0n+.5i
Resource: trackballYRotatorActive
.in 0n+.5i
Part: YRotatorActive
Appearance: Yellow version of the regular YRotator
Description: Displayed during constrained rotation about the Y axis.
.in 0n+.5i
Resource: trackballZRotator
.in 0n+.5i
Part: ZRotator
Appearance: White outline of a stripe aligned with the Z axis.
Description: Pick this to initiate constrained rotation about the Z axis.
.in 0n+.5i
Resource: trackballZRotatorActive
.in 0n+.5i
Part: ZRotatorActive
Appearance: Yellow version of the regular ZRotator
Description: Displayed during constrained rotation about the Z axis.
.in 0n+.5i
Resource: trackballUserAxis
.in 0n+.5i
Part: userAxis
Appearance: Thin purple line
Description: Displays the user axis. Dragging the userRotator rotates about this line.
.in 0n+.5i
Resource: trackballUserAxisActive
.in 0n+.5i
Part: userAxisActive
Appearance: Thin purple line
Description: Displays the user axis. Dragging the userRotator rotates about this line.
.in 0n+.5i
Resource: trackballUserRotator
.in 0n+.5i
Part: userRotator
Appearance: Transparent green stripe circling the user axis.
Description: Pick to initiate constrained rotation about the user axis.
.in 0n+.5i
Resource: trackballUserRotatorActive
.in 0n+.5i
Part: userRotatorActive
Appearance: Brighter green version of the regular userRotator
Description: Displayed during constrained rotation about the user axis.
Fields
SoSFVec3fscaleFactor
Scale of the dragger.
SoSFRotationrotation
Orientation of the dragger.
File Format/Defaults
TrackballDragger{renderCachingAUTOboundingBoxCachingAUTOrenderCullingAUTOpickCullingAUTOisActiveFALSErotation0010scaleFactor111callbackListNULLsurroundScaleNULLantiSquishAntiSquish{sizingLONGEST_DIAGONAL}rotator<trackballRotatorresource>rotatorActive<trackballRotatorActiveresource>XRotator<trackballXRotatorresource>XRotatorActive<trackballXRotatorActiveresource>YRotator<trackballYRotatorresource>YRotatorActive<trackballYRotatorActiveresource>ZRotator<trackballZRotatorresource>ZRotatorActive<trackballZRotatorActiveresource>userAxis<trackballUserAxisresource>userAxisActive<trackballUserAxisActiveresource>userRotator<trackballUserRotatorresource>userRotatorActive<trackballUserRotatorActiveresource>}Inherits From
SoBase > SoFieldContainer > SoNode > SoBaseKit > SoInteractionKit > SoDragger > SoTrackballDragger
Methods
SoTrackballDragger()
Constructor.
SbBoolisAnimationEnabled()voidsetAnimationEnabled(SbBoolnewVal)
If the mouse is moving while you release it, the trackball will continue to spin afterwards. These two
methods will query and set whether this feature is turned on or off. By default, the animation feature
is turned on.
staticconstSoNodekitCatalog*getClassNodekitCatalog()const
Returns an SoNodekitCatalog for this class
staticSoTypegetClassTypeId()
Returns type identifier for this class.
Name
SoTrackballDragger — striped ball you can rotate or scale uniformly by dragging with the mouse
Note
Unlike most multi-function draggers, SoTrackballDragger is not a compound dragger made up of other
draggers that perform its smaller tasks. This is not because it was inappropriate, but because the
trackball was written before implementation of the methods that take care of synchronizing multiple child
draggers. The younger SoCenterballDragger is similar in form to the trackball, but the centerball is a
compound dragger.
See Also
SoInteractionKit,SoDragger,SoCenterballDragger,SoDirectionalLightDragger,SoDragPointDragger,SoHandleBoxDragger,SoJackDragger,SoPointLightDragger,SoRotateCylindricalDragger,SoRotateDiscDragger,SoRotateSphericalDragger,SoScale1Dragger,SoScale2Dragger,SoScale2UniformDragger,SoScaleUniformDragger,SoSpotLightDragger,SoTabBoxDragger,SoTabPlaneDragger,SoTransformBoxDragger,SoTransformerDragger,SoTranslate1Dragger,SoTranslate2DraggerSoTrackballDragger(3IV)()
Synopsis
#include<Inventor/draggers/SoTrackballDragger.h>
Fields from class SoTrackballDragger:
SoSFVec3fscaleFactorSoSFRotationrotation
Fields from class SoDragger:
SoSFBoolisActive
Fields from class SoInteractionKit:
SoSFEnumrenderCachingSoSFEnumboundingBoxCachingSoSFEnumrenderCullingSoSFEnumpickCulling
Parts from class SoBaseKit:
(SoNodeKitListPart)callbackList
Methods from class SoTrackballDragger:
SoTrackballDragger()SbBoolisAnimationEnabled()voidsetAnimationEnabled(SbBoolnewVal)staticconstSoNodekitCatalog*getClassNodekitCatalog()conststaticSoTypegetClassTypeId()
Methods from class SoDragger:
voidaddStartCallback(SoDraggerCB*f,void*userData=NULL)voidremoveStartCallback(SoDraggerCB*f,void*userData=NULL)voidaddMotionCallback(SoDraggerCB*f,void*userData=NULL)voidremoveMotionCallback(SoDraggerCB*f,void*userData=NULL)voidaddFinishCallback(SoDraggerCB*f,void*userData=NULL)voidremoveFinishCallback(SoDraggerCB*f,void*userData=NULL)voidaddValueChangedCallback(SoDraggerCB*f,void*userData=NULL)voidremoveValueChangedCallback(SoDraggerCB*f,void*userData=NULL)SbBoolenableValueChangedCallbacks()voidsetMinGesture(intpixels)intgetMinGesture()conststaticvoidsetMinScale(floatnewMinScale)staticfloatgetMinScale()
Methods from class SoInteractionKit:
virtualSbBoolsetPartAsPath(constSbName&partName,SoPath*surrogatePath)
Methods from class SoBaseKit:
virtualconstSoNodekitCatalog*getNodekitCatalog()constvirtualSoNode*getPart(constSbName&partName,SbBoolmakeIfNeeded)SbStringgetPartString(constSoBase*part)virtualSoNodeKitPath*createPathToPart(constSbName&partName,SbBoolmakeIfNeeded,constSoPath*pathToExtend=NULL)virtualSbBoolsetPart(constSbName&partName,SoNode*newPart)SbBoolset(char*partName,char*parameters)SbBoolset(char*nameValuePairs)staticSbBoolisSearchingChildren()staticvoidsetSearchingChildren(SbBoolnewVal)
Methods from class SoNode:
voidsetOverride(SbBoolstate)SbBoolisOverride()constSoNode*copy(SbBoolcopyConnections=FALSE)constvirtualSbBoolaffectsState()conststaticSoNode*getByName(constSbName&name)staticintgetByName(constSbName&name,SoNodeList&list)
Methods from class SoFieldContainer:
voidsetToDefaults()SbBoolhasDefaultValues()constSbBoolfieldsAreEqual(constSoFieldContainer*fc)constvoidcopyFieldValues(constSoFieldContainer*fc,SbBoolcopyConnections=FALSE)voidget(SbString&fieldDataString)virtualintgetFields(SoFieldList&resultList)constvirtualSoField*getField(constSbName&fieldName)constSbBoolgetFieldName(constSoField*field,SbName&fieldName)constSbBoolisNotifyEnabled()constSbBoolenableNotify(SbBoolflag)
Methods from class SoBase:
voidref()voidunref()constvoidunrefNoDelete()constvoidtouch()virtualSoTypegetTypeId()constSbBoolisOfType(SoTypetype)constvirtualvoidsetName(constSbName&name)virtualSbNamegetName()const
Macros from class SoBaseKit:
SO_GET_PART(kit,partName,partClass)SO_CHECK_PART(kit,partName,partClass)