Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoCenterballDragger Class Reference

Striped ball you rotate and re-center by dragging with the mouse. More...

#include <Inventor/draggers/SoCenterballDragger.h>

+ Inheritance diagram for SoCenterballDragger:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
virtual const SoNodekitCataloggetNodekitCatalog () const
 Returns the SoNodekitCatalog for this instance.
 
 SoCenterballDragger ()
 Constructor.
 
- Public Member Functions inherited from SoDragger
void addStartCallback (SoDraggerCB *f, void *userData=NULL)
 Adds start callback.
 
void removeStartCallback (SoDraggerCB *f, void *userData=NULL)
 Removes start callback.
 
void addMotionCallback (SoDraggerCB *f, void *userData=NULL)
 Adds motion callback.
 
void removeMotionCallback (SoDraggerCB *f, void *userData=NULL)
 Removes motion callback.
 
void addFinishCallback (SoDraggerCB *f, void *userData=NULL)
 Adds finish callback.
 
void removeFinishCallback (SoDraggerCB *f, void *userData=NULL)
 Removes finish callback.
 
void addValueChangedCallback (SoDraggerCB *f, void *userData=NULL)
 Adds value-changed callback.
 
void removeValueChangedCallback (SoDraggerCB *f, void *userData=NULL)
 Removes value-changed callback.
 
void setMinGesture (int pixels)
 Sets the number of pixels of movement required to initiate a constraint gesture.
 
void setMinGesture (float pixels)
 Float version of setMinGesture.
 
int getMinGesture () const
 Gets the number of pixels of movement required to initiate a constraint gesture.
 
float getMinGestureFloat () const
 Float version of getMinGesture.
 
SbBool enableValueChangedCallbacks (SbBool newVal)
 You can temporarily disable a dragger's valueChangedCallbacks.
 
void setTrackerDirectMode (TrackerDirectMode mode=DEFAULT)
 Sets the tracker direct mode for this dragger (see description above).
 
TrackerDirectMode getTrackerDirectMode () const
 Get the current tracker direct mode for this dragger.
 
void setMotionMatrix (const SbMatrix &newMatrix)
 Set the motion matrix.
 
const SbMatrixgetMotionMatrix ()
 Get the motion matrix.
 
- Public Member Functions inherited from SoInteractionKit
virtual SbBool setPartAsPath (const SbName &partName, SoPath *surrogatePath)
 Sets any public part in the interaction kit as a "surrogate" path instead.
 
virtual SbBool affectsState () const
 Returns TRUE if a node has an effect on the state during traversal.
 
- Public Member Functions inherited from SoBaseKit
 SoBaseKit ()
 Constructor.
 
virtual SoNodegetPart (const SbName &partName, SbBool makeIfNeeded)
 Searches the nodekit catalog (and those of all nested nodekits) for the part named partName.
 
template<typename PartType >
PartType * getPart (const SbName &partName)
 Like getPart(const SbName&,SbBool) but casts the returned part to the specified type and sets the makeIfNeeded parameter to TRUE.
 
template<typename PartType >
PartType * checkPart (const SbName &partName)
 Like getPart(const SbName&,SbBool) but casts the returned part to the specified type and sets the makeIfNeeded parameter to FALSE.
 
SbString getPartString (const SoBase *part)
 Given a node or a path to a node, checks if the part exists in the nodekit, in a nested nodekit, or an element of a list part.
 
virtual SoNodeKitPathcreatePathToPart (const SbName &partName, SbBool makeIfNeeded, const SoPath *pathToExtend=NULL)
 Returns a path that begins at this nodekit and ends at partName.
 
virtual SbBool setPart (const SbName &partName, SoNode *newPart)
 Inserts the given node (not a copy) as the new part specified by partName.
 
SoNONUNICODE SbBool set (char *nameValuePairListString)
 This function allows field values of parts (nodes) to be set in several different parts simultaneously.
 
SbBool set (const SbString &nameValuePairListString)
 This function allows field values of parts (nodes) to be set in several different parts simultaneously.
 
SoNONUNICODE SbBool set (const char *partNameString, const char *parameterString)
 This function allows field values of parts (nodes) to be set.
 
SbBool set (const SbString &partNameString, const SbString &parameterString)
 This function allows field values of parts (nodes) to be set.
 
- Public Member Functions inherited from SoNode
virtual void setOverride (const SbBool state)
 Turns the override flag on or off.
 
virtual SbBool isOverride () const
 Returns the state of the override flag.
 
virtual SoNodecopy (SbBool copyConnections=FALSE) const
 Creates and returns an exact copy of the node.
 
virtual void touch ()
 Marks an instance as modified, simulating a change to it.
 
- Public Member Functions inherited from SoFieldContainer
void setToDefaults ()
 Sets all fields in this object to their default values.
 
SbBool hasDefaultValues () const
 Returns TRUE if all of the object's fields have their default values.
 
SbBool fieldsAreEqual (const SoFieldContainer *fc) const
 Returns TRUE if this object's fields are exactly equal to fc's fields.
 
void copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE)
 Copies the contents of fc's fields into this object's fields.
 
SoNONUNICODE SbBool set (const char *fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
SbBool set (const SbString &fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
void get (SbString &fieldDataString)
 Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.
 
virtual int getFields (SoFieldList &list) const
 Appends references to all of this object's fields to resultList, and returns the number of fields appended.
 
virtual int getAllFields (SoFieldList &list) const
 Returns a list of fields, including the eventIn's and eventOut's.
 
virtual SoFieldgetField (const SbName &fieldName) const
 Returns a the field of this object whose name is fieldName.
 
virtual SoFieldgetEventIn (const SbName &fieldName) const
 Returns a the eventIn with the given name.
 
virtual SoFieldgetEventOut (const SbName &fieldName) const
 Returns the eventOut with the given name.
 
SbBool getFieldName (const SoField *field, SbName &fieldName) const
 Returns the name of the given field in the fieldName argument.
 
SbBool enableNotify (SbBool flag)
 Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE).
 
SbBool isNotifyEnabled () const
 Notification is the process of telling interested objects that this object has changed.
 
virtual void setUserData (void *data)
 Sets application data.
 
void * getUserData (void) const
 Gets user application data.
 
- Public Member Functions inherited from SoBase
virtual SbName getName () const
 Returns the name of an instance.
 
virtual void setName (const SbName &name)
 Sets the name of an instance.
 
void setSynchronizable (const bool b)
 Sets this to be a ScaleViz synchronizable object.
 
bool isSynchronizable () const
 Gets the ScaleViz synchronizable state of this object.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 
- Public Member Functions inherited from SoGetView
 SoGetView ()
 Default constructor.
 
virtual ~SoGetView ()
 
virtual SbBool getViewportIsEnabled () const
 Returns TRUE if SoGetView functionalities are enabled, FALSE otherwise.
 
virtual const SbVec2f getViewportOrigin () const
 Returns SbViewportRegion origin.
 
virtual const SbVec2f getViewportSize () const
 Returns SbViewportRegion size.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static const SoNodekitCataloggetClassNodekitCatalog ()
 Returns the SoNodekitCatalog for this class.
 
- Static Public Member Functions inherited from SoDragger
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static const SoNodekitCataloggetClassNodekitCatalog ()
 Returns the SoNodekitCatalog for this class.
 
static void setMinScale (float newMinScale)
 Sets the smallest scale that any dragger will write.
 
static float getMinScale ()
 Gets the smallest scale that any dragger will write.
 
static void setInitialTrackerDirectMode (TrackerDirectMode mode=DEFAULT)
 Set the initial tracker direct mode for draggers not yet created.
 
static TrackerDirectMode getInitialTrackerDirectMode ()
 Get the initial tracker direct mode.
 
- Static Public Member Functions inherited from SoInteractionKit
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static const SoNodekitCataloggetClassNodekitCatalog ()
 Returns the SoNodekitCatalog for this class.
 
- Static Public Member Functions inherited from SoBaseKit
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static const SoNodekitCataloggetClassNodekitCatalog ()
 Returns the SoNodekitCatalog for the class SoBaseKit.
 
static void setSearchingChildren (SbBool newVal)
 Sets if nodekit children are searched during SoSearchAction traversal.
 
static SbBool isSearchingChildren ()
 Returns TRUE if nodekit children are searched during SoSearchAction traversal.
 
- Static Public Member Functions inherited from SoNode
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static SoNodegetByName (const SbName &name)
 A node's name can be set using SoBase::setName().
 
static int getByName (const SbName &name, SoNodeList &list)
 A node's name can be set using SoBase::setName().
 
- Static Public Member Functions inherited from SoFieldContainer
static SoType getClassTypeId ()
 Returns the type of this class.
 
- Static Public Member Functions inherited from SoBase
static SoType getClassTypeId ()
 Returns type identifier for this class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Public Attributes

SoSFRotation rotation
 Orientation of the centerball dragger.
 
SoSFVec3f center
 Center of rotation and scale of the centerball dragger.
 
- Public Attributes inherited from SoDragger
SoSFBool isActive
 TRUE when mouse is down and dragging, else FALSE.
 
SoSFBool enableCallbacks
 If set to FALSE, motion, start and finish callbacks are disabled.
 
- Public Attributes inherited from SoInteractionKit
SoSFEnum boundingBoxCaching
 Set bounding box caching mode.
 
SoSFEnum renderCulling
 Set render culling mode.
 
SoSFEnum pickCulling
 Set pick caching mode.
 
SoDEPRECATED SoSFEnum renderCaching
 Set render caching mode.
 
- Public Attributes inherited from SoBaseKit
SoSFBool boundingBoxIgnoring
 Whether to ignore this node during bounding box traversal.
 

Additional Inherited Members

- Public Types inherited from SoDragger
enum  TrackerDirectMode {
  NONE ,
  MOVE ,
  ROTATE ,
  FREE ,
  DEFAULT
}
 Tracker direct mode. More...
 
typedef void SoDraggerCB(void *userData, SoDragger *dragger)
 Used in defining the callback function lists.
 
- Public Types inherited from SoInteractionKit
enum  CacheEnabled {
  OFF ,
  ON ,
  AUTO
}
 Possible values for caching. More...
 

Detailed Description

Striped ball you rotate and re-center by dragging with the mouse.

SoCenterballDragger is a composite dragger. Its shape is a sphere defined by three intersecting circles. Where the circles intersect (at the ends of the x, y and z axes) there are sets of small green crosshairs. Dragging a pair of crosshairs translates the entire centerball within the plane of the crosshairs. The interface of the sphere and circles is just like SoTrackballDragger. Dragging a circle rotates about a constrained axis and dragging the areas between them rotates the sphere freely about the center. An invisible but pickable sphere initiates the free-rotation dragging.

When you drag the crosshairs, the center field is updated; there is no translation field. Dragging other parts of the centerball updates the rotation field. As with all draggers, if you change the fields the dragger moves in response.

The draggers used for the crosshair parts are SoTranslate2Draggers, so pressing the <Shift> key allows you to constrain motion to slide along either the local x axis or y axis of that crosshair. The direction is determined by your initial mouse gesture after pressing the key. Releasing the key removes the constraint.

Remember: This is not an SoTransform! If you want to move other objects with this dragger, you can either:

  • Use an SoCenterballManip, 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 SoCenterballManip reference page.)
  • 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 SoCenterballDragger 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 $OIVHOME/data/draggerDefaults/centerballDragger.iv into your own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to that directory.

This dragger has both a default and a WYSIWYG version:

Default Dragger WYSIWYG Dragger

See SoDragger for more information about using and customizing draggers, including code examples, using draggers in an immersive VR environment and using WYSIWYG draggers.

FILE FORMAT/DEFAULT

    CenterballDragger {
    boundingBoxCaching AUTO
    renderCulling AUTO
    pickCulling AUTO
    isActive FALSE
    rotation 0 0 1 0
    center 0 0 0
    callbackList NULL
    translateToCenter MatrixTransform {
    matrix
    1 0 0 0
    0 1 0 0
    0 0 1 0
    0 0 0 1
    }
    surroundScale NULL
    antiSquish AntiSquish {
    sizing LONGEST_DIAGONAL
    }
    lightModel LightModel {
    model PHONG
    }
    XAxis <centerballXAxis resource>
    YAxis <centerballYAxis resource>
    ZAxis <centerballZAxis resource>
    rotator RotateSphericalDragger {
    }
    YRotator RotateCylindricalDragger {
    }
    ZCenterChanger Translate2Dragger {
    }
    ZRotator RotateCylindricalDragger {
    }
    YCenterChanger Translate2Dragger {
    }
    XCenterChanger Translate2Dragger {
    }
    XRotator RotateCylindricalDragger {
    }
    rotator.rotator <centerballRotator resource>
    rotator.rotatorActive <centerballRotatorActive resource>
    XRotator.rotator <centerballStripe resource>
    YRotator.rotator <centerballStripe resource>
    ZRotator.rotator <centerballStripe resource>
    XRotator.rotatorActive <centerballStripeActive resource>
    YRotator.rotatorActive <centerballStripeActive resource>
    ZRotator.rotatorActive <centerballStripeActive resource>
    XCenterChanger.translator <centerballCenterChanger resource>
    YCenterChanger.translator <centerballCenterChanger resource>
    ZCenterChanger.translator <centerballCenterChanger resource>
    XCenterChanger.translatorActive <centerballCenterChangerActive resource>
    YCenterChanger.translatorActive <centerballCenterChangerActive resource>
    ZCenterChanger.translatorActive <centerballCenterChangerActive resource>
    XCenterChanger.xAxisFeedback <centerballCenterXAxisFeedback resource>
    YCenterChanger.xAxisFeedback <centerballCenterXAxisFeedback resource>
    ZCenterChanger.xAxisFeedback <centerballCenterXAxisFeedback resource>
    XCenterChanger.yAxisFeedback <centerballCenterYAxisFeedback resource>
    YCenterChanger.yAxisFeedback <centerballCenterYAxisFeedback resource>
    ZCenterChanger.yAxisFeedback <centerballCenterYAxisFeedback resource>
    }

DRAGGER RESOURCES

    Resource: centerballRotator
    Part: rotator.rotator
    Appearance: Invisible but pickable sphere
    Description: When picked, initiates free rotation about the center point. Slightly smaller radius than the stripes, so you must pick between the stripes to use it.

    Resource: centerballRotatorActive
    Part: rotator.rotatorActive
    Appearance: Invisible sphere
    Description: Displayed during unconstrained 3D rotation instead of centerballRotator.

    Resource: centerballStripe
    Parts: XRotator.rotator<BR> YRotator.rotator<BR> ZRotator.rotator
    Appearance: White circle aligned with rotation axis.
    Description: When picked, initiates constrained rotation. Each rotator rotates locally about its Y axis. The centerball contains private transform parts that orient the draggers along three different axes.

    Resource: centerballStripeActive
    Parts: XRotator.rotatorActive<BR> YRotator.rotatorActive<BR> ZRotator.rotatorActive
    Appearance: White circle aligned with the rotation axis.
    Description: Displayed during constrained rotation instead of the rotator part. The centerball orients the draggers along three different axes.

    Resource: centerballCenterChanger
    Parts: XCenterChanger.translator<BR> YCenterChanger.translator<BR> ZCenterChanger.translator
    Appearance: Two sets of small green crosshairs, one located at each intersection of axis and ball.
    Description: When picked, initiates 2D translation of ball through space. Edits the center field, which becomes center for subsequent rotations. Each translator works locally in its X-Y plane. The centerball containsprivate transform parts that place the draggers along three different axes.

    Resource: centerballCenterChangerActive
    Parts: XCenterChanger.translatorActive<BR> YCenterChanger.translatorActive<BR> ZCenterChanger.translatorActive
    Appearance: Yellow version of centerballCenterChanger.
    Description: Displayed during 2D translation instead of regular translator part. The centerball places the draggers along three different axes.

    Resource: centerballCenterXAxisFeedback
    Parts: XCenterChanger.xAxisFeedback<BR> YCenterChanger.xAxisFeedback<BR> ZCenterChanger.xAxisFeedback
    Appearance: Double-headed purple arrows, one located at each intersection of axis and ball. Located atop X axis of crosshair.
    Description: Only shown if dragger is moving and the axis is a permitted direction of motion. When pressing <shift>, motion is constrained, and this is displayed only if the primary motion is in the X direction of the child dragger's local space. The centerball places the draggers along three different axes; so not all of these parts aligns with the X axis in centerball space.

    Resource: centerballCenterYAxisFeedback
    Parts: XCenterChanger.yAxisFeedback<BR> YCenterChanger.yAxisFeedback<BR> ZCenterChanger.yAxisFeedback
    Appearance: Double-headed purple arrows, one located at each intersection of axis and ball. Located atop Y axis of crosshair.
    Description: Only shown if dragger is moving and the axis is a permitted direction of motion. When pressing <shift>, motion is constrained, and this is displayed only if the primary motion is in the Y direction of the child dragger's local space. The centerball places the draggers along three different axes; so not all of these parts aligns with the Y axis in centerball space.

    Resource: centerballXAxis
    Part: XAxis
    Appearance: Thin yellow line connecting left and right crosshairs.
    Description: Feedback shown alone during rotation about X axis; displayed with centerballYAxis and centerballZAxis while center is dragged.

    Resource: centerballYAxis
    Part: YAxis
    Appearance: Thin yellow line connecting lower and upper crosshairs.
    Description: Feedback shown alone during rotation about Y axis; displayed with centerballXAxis and centerballZAxis while center is dragged.

    Resource: centerballZAxis
    Part: ZAxis
    Appearance: Thin yellow line connecting near and far crosshairs.
    Description: Feedback shown alone during rotation about Z axis; displayed with centerballXAxis and centerballYAxis while center is dragged.

CATALOG PARTS

    All Parts
    Part Name Part Type Default Type NULL Default
    callbackList NodeKitListPart yes
    translateToCenter MatrixTransform yes
    surroundScale SurroundScale yes
    antiSquish AntiSquish no
    lightModel LightModel yes
    XAxis Separator yes
    YAxis Separator yes
    ZAxis Separator yes
    rotator RotateSphericalDragger yes
    YRotator RotateCylindricalDragger yes
    ZCenterChanger Translate2Dragger yes
    ZRotator RotateCylindricalDragger yes
    YCenterChanger Translate2Dragger yes
    XCenterChanger Translate2Dragger yes
    XRotator RotateCylindricalDragger yes

    Extra Information for List Parts from Above Table

    Part Name Container Type Possible Types
    callbackList Separator Callback, EventCallback

SEE ALSO

SoInteractionKit, SoDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTranslate1Dragger, SoTranslate2Dragger

Definition at line 337 of file SoCenterballDragger.h.

Constructor & Destructor Documentation

◆ SoCenterballDragger()

SoCenterballDragger::SoCenterballDragger ( )

Constructor.

Member Function Documentation

◆ getClassNodekitCatalog()

static const SoNodekitCatalog * SoCenterballDragger::getClassNodekitCatalog ( )
static

Returns the SoNodekitCatalog for this class.

◆ getClassTypeId()

static SoType SoCenterballDragger::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getNodekitCatalog()

virtual const SoNodekitCatalog * SoCenterballDragger::getNodekitCatalog ( ) const
virtual

Returns the SoNodekitCatalog for this instance.

Reimplemented from SoDragger.

◆ getTypeId()

virtual SoType SoCenterballDragger::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoDragger.

Member Data Documentation

◆ center

SoSFVec3f SoCenterballDragger::center

Center of rotation and scale of the centerball dragger.

Definition at line 390 of file SoCenterballDragger.h.

◆ rotation

SoSFRotation SoCenterballDragger::rotation

Orientation of the centerball dragger.

Definition at line 385 of file SoCenterballDragger.h.


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