Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoDragPointDragger Class Reference

Object you can translate in 3D by dragging with the mouse. More...

#include <Inventor/draggers/SoDragPointDragger.h>

+ Inheritance diagram for SoDragPointDragger:

Public Types

enum  DraggerSet {
  X_AXIS ,
  Y_AXIS ,
  Z_AXIS
}
 Dragger set. More...
 
- 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...
 

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.
 
 SoDragPointDragger ()
 Constructor.
 
void setJumpLimit (float limit)
 Sets the point at which the feedback axes will jump to a new position.
 
float getJumpLimit () const
 Gets the point at which the feedback axes will jump to a new position.
 
void showNextDraggerSet ()
 The dragPoint dragger contains three pairs of draggers, each containing a plane dragger and a line dragger (see the Description above).
 
void showDraggerSet (DraggerSet set)
 The dragPoint dragger contains three pairs of draggers, each containing a plane dragger and a line dragger (see the Description above).
 
- 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

SoSFVec3f translation
 Position of the 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.
 

Detailed Description

Object you can translate in 3D by dragging with the mouse.

SoDragPointDragger is a compound dragger that translates in all three dimensions when dragged with the mouse.

It is made up of six smaller draggers, which it displays two at a time. Each pair has one plane dragger and one line dragger. The line dragger is oriented perpendicular to the plane, so together the plane/line pair lets you move through all of 3-space.

DragPoint has a total of three such pairs, oriented along the x, y, and z axes of its local space. You can cycle through the three pairs by hitting the <Control> key with the cursor over the dragger. (You need not press the mouse button.) This behavior may be disabled by setting the environment variable OIV_DISABLE_DRAGGER_CTRL_KEY to true (see SoPreferences). An application can cycle through the pairs by calling the showNextDraggerSet method or display a specific pair by calling the showDraggerSet method. The dragger starts with the Y axis (y-line/xz-plane) pair displayed.

The line draggers are SoTranslate1Draggers and the plane draggers are SoTranslate2Draggers. So you can use the <Shift> key to constrain the motion of a plane dragger along one of the two axes within the plane, as described in the SoTranslate2Draggers reference page.

DragPoint adds extra feedback parts to provide a more intuitive idea of where you are placed in three-space. There are three feedback planes and three feedback axes ; each corresponds to one of the plane or line draggers, but spans a much greater distance. When you drag along a line, that line's larger feedback axis is displayed, and remains anchored in space while the dragger slides along it. This helps establish the motion of the dragger relative to the rest of the scene. Similarly, when you drag within a plane, the larger (but transparent) feedback plane establishes a ground plane for you to move upon. The location of the dragger within the plane is pinpointed by two intersecting axes that always cross below the cursor and extend to the edges of the plane. When you move dragPoint to the edge of the feedback plane (or line), the feedback will jump to a new location in that direction, so that the dragger never leaves the feedback behind.

The primary directions of motion are given by the local space of the dragger. Transforms earlier in the scene will affect the dragger, its children, and the orientation of its directions of motion.

This node has a translation field which always reflects its position in local space. Setting the field moves the dragger to that point. You can also connect fields of other nodes or engines from this one to make them follow the dragger's motion.

Although the child draggers each have their own resources defining default part geometries, the dragPoint dragger overrides these with a new set of resources. It also defines resources for the feedback parts that it adds. These are detailed 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 $OIVHOME/data/draggerDefaults/dragPointDragger.iv into your own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to that directory.

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

    DragPointDragger {
    boundingBoxCaching AUTO
    renderCulling AUTO
    pickCulling AUTO
    isActive FALSE
    translation 0 0 0
    callbackList NULL
    xTranslator Translate1Dragger {
    }
    xyTranslator Translate2Dragger {
    }
    xzTranslator Translate2Dragger {
    }
    zTranslator Translate1Dragger {
    }
    yzTranslator Translate2Dragger {
    }
    yTranslator Translate1Dragger {
    }
    xFeedback <dragPointXFeedback resource>
    yFeedback <dragPointYFeedback resource>
    zFeedback <dragPointZFeedback resource>
    yzFeedback <dragPointYZFeedback resource>
    xzFeedback <dragPointXZFeedback resource>
    xyFeedback <dragPointXYFeedback resource>
    xTranslator.translator <dragPointXTranslatorTranslator resource>
    xTranslator.translatorActive <dragPointXTranslatorTranslatorActive resource>
    yTranslator.translator <dragPointYTranslatorTranslator resource>
    yTranslator.translatorActive <dragPointYTranslatorTranslatorActive resource>
    zTranslator.translator <dragPointZTranslatorTranslator resource>
    zTranslator.translatorActive <dragPointZTranslatorTranslatorActive resource>
    yzTranslator.translator <dragPointYZTranslatorTranslator resource>
    yzTranslator.translatorActive <dragPointYZTranslatorTranslatorActive resource>
    xzTranslator.translator <dragPointXZTranslatorTranslator resource>
    xzTranslator.translatorActive <dragPointXZTranslatorTranslatorActive resource>
    xyTranslator.translator <dragPointXYTranslatorTranslator resource>
    xyTranslator.translatorActive <dragPointXYTranslatorTranslatorActive resource>
    }

DRAGGER RESOURCES

    Resource: dragPointXTranslatorTranslator
    Part: xTranslator.translator
    Appearance: white cylinder with axis aligned in X direction
    Description: picking this initiates linear motion in X direction

    Resource: dragPointXTranslatorTranslatorActive
    Part: xTranslator.translatorActive
    Appearance: yellow cylinder with axis aligned in X direction
    Description: shown when moving in X direction

    Resource: dragPointYTranslatorTranslator
    Part: yTranslator.translator
    Appearance: white cylinder with axis aligned in Y direction
    Description: picking this initiates linear motion in Y direction

    Resource: dragPointYTranslatorTranslatorActive
    Part: yTranslator.translatorActive
    Appearance: yellow cylinder with axis aligned in Y direction
    Description: shown when moving in Y direction

    Resource: dragPointZTranslatorTranslator
    Part: zTranslator.translator
    Appearance: white cylinder with axis aligned in Z direction
    Description: picking this initiates linear motion in Z direction

    Resource: dragPointZTranslatorTranslatorActive
    Part: zTranslator.translatorActive
    Appearance: yellow cylinder with axis aligned in Z direction
    Description: shown when moving in Z direction

    Resource: dragPointYZTranslatorTranslator
    Part: yzTranslator.translator
    Appearance: white flattened cube within the yz plane of motion
    Description: picking this initiates planar motion in yz plane

    Resource: dragPointYZTranslatorTranslatorActive
    Part: yzTranslator.translatorActive
    Appearance: yellow flattened cube within the yz plane of motion
    Description: shown when moving in yz plane

    Resource: dragPointXZTranslatorTranslator
    Part: xzTranslator.translator
    Appearance: white flattened cube within the xz plane of motion
    Description: picking this initiates planar motion in xz plane

    Resource: dragPointXZTranslatorTranslatorActive
    Part: xzTranslator.translatorActive
    Appearance: yellow flattened cube within the xz plane of motion
    Description: shown when moving in xz plane

    Resource: dragPointXYTranslatorTranslator
    Part: xyTranslator.translator
    Appearance: white flattened cube within the xy plane of motion
    Description: picking this initiates planar motion in xy plane

    Resource: dragPointXYTranslatorTranslatorActive
    Part: xyTranslator.translatorActive
    Appearance: yellow flattened cube within the xy plane of motion
    Description: shown when moving in xy plane

    Resource: dragPointXFeedback
    Part: xFeedback
    Appearance: douple-headed purple arrow
    Description: feedback for motion in x direction

    Resource: dragPointYFeedback
    Part: yFeedback
    Appearance: douple-headed purple arrow
    Description: feedback for motion in y direction

    Resource: dragPointZFeedback
    Part: zFeedback
    Appearance: douple-headed purple arrow
    Description: feedback for motion in z direction

    Resource: dragPointYZFeedback
    Part: yzFeedback
    Appearance: semi-transparent green square in yz plane
    Description: feedback for motion in yz plane

    Resource: dragPointXZFeedback
    Part: xzFeedback
    Appearance: semi-transparent green square in yz plane
    Description: feedback for motion in xz plane

    Resource: dragPointXYFeedback
    Part: xyFeedback
    Appearance: semi-transparent green square in yz plane
    Description: feedback for motion in xy plane

CATALOG PARTS

    All Parts
    Part Name Part Type Default Type NULL Default
    callbackList NodeKitListPart yes
    xTranslator Translate1Dragger yes
    xyTranslator Translate2Dragger yes
    xzTranslator Translate2Dragger yes
    zTranslator Translate1Dragger yes
    yzTranslator Translate2Dragger yes
    yTranslator Translate1Dragger yes
    xFeedback Separator yes
    yFeedback Separator yes
    zFeedback Separator yes
    yzFeedback Separator yes
    xzFeedback Separator yes
    xyFeedback Separator yes

    Extra Information for List Parts from Above Table

    Part Name Container Type Possible Types
    callbackList Separator Callback, EventCallback

SEE ALSO

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

Definition at line 325 of file SoDragPointDragger.h.

Member Enumeration Documentation

◆ DraggerSet

Dragger set.

Enumerator
X_AXIS 
Y_AXIS 
Z_AXIS 

Definition at line 407 of file SoDragPointDragger.h.

Constructor & Destructor Documentation

◆ SoDragPointDragger()

SoDragPointDragger::SoDragPointDragger ( )

Constructor.

Member Function Documentation

◆ getClassNodekitCatalog()

static const SoNodekitCatalog * SoDragPointDragger::getClassNodekitCatalog ( )
static

Returns the SoNodekitCatalog for this class.

◆ getClassTypeId()

static SoType SoDragPointDragger::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getJumpLimit()

float SoDragPointDragger::getJumpLimit ( ) const
inline

Gets the point at which the feedback axes will jump to a new position.

Definition at line 396 of file SoDragPointDragger.h.

◆ getNodekitCatalog()

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

Returns the SoNodekitCatalog for this instance.

Reimplemented from SoDragger.

◆ getTypeId()

virtual SoType SoDragPointDragger::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoDragger.

◆ setJumpLimit()

void SoDragPointDragger::setJumpLimit ( float  limit)
inline

Sets the point at which the feedback axes will jump to a new position.

For example, if set to .1 (the default), the feedback axes will jump when the dragger gets within 10% of the end of the axis.

Definition at line 392 of file SoDragPointDragger.h.

◆ showDraggerSet()

void SoDragPointDragger::showDraggerSet ( DraggerSet  set)

The dragPoint dragger contains three pairs of draggers, each containing a plane dragger and a line dragger (see the Description above).

By default the Y axis (y-line/xz-plane) pair is displayed. Calling this method selects a specific pair.

◆ showNextDraggerSet()

void SoDragPointDragger::showNextDraggerSet ( )

The dragPoint dragger contains three pairs of draggers, each containing a plane dragger and a line dragger (see the Description above).

The dragger starts with the (y-line/xz-plane) pair displayed. Calling this method will cycle next through the (z-line/xy-plane), then the (x-line/yz-plane).

Member Data Documentation

◆ translation

SoSFVec3f SoDragPointDragger::translation

Position of the dragger.

Definition at line 384 of file SoDragPointDragger.h.


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