Open Inventor Release 2023.2.2
 
Loading...
Searching...
No Matches
SoTransformBoxDragger Class Reference

Box-like object you scale, rotate, and translate by dragging with the mouse. More...

#include <Inventor/draggers/SoTransformBoxDragger.h>

+ Inheritance diagram for SoTransformBoxDragger:

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.
 
 SoTransformBoxDragger ()
 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 dragger.
 
SoSFVec3f translation
 Position of the dragger.
 
SoSFVec3f scaleFactor
 Scale 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
SoDEPRECATED SoSFEnum renderCaching
 Set render caching mode.
 
SoSFEnum boundingBoxCaching
 Set bounding box caching mode.
 
SoSFEnum renderCulling
 Set render culling mode.
 
SoSFEnum pickCulling
 Set pick 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...
 
- Public Types inherited from SoInteractionKit
enum  CacheEnabled {
  OFF ,
  ON ,
  AUTO
}
 Possible values for caching. More...
 

Detailed Description

Box-like object you scale, rotate, and translate by dragging with the mouse.

SoTransformBoxDragger is a composite dragger shaped like a box with small cubes at the corners. Click and drag any of these cubes to scale the box uniformly. Drag any edge of the box to rotate the whole dragger about its center, along an axis parallel to that edge. Pick any face of the box for 2D translation in the plane of that face.

Although the box looks just about like a wireframe cube, it is composed of many different simple draggers arranged in a composite assembly. When one part is dragged, the transformBox makes sure they all move together. Each of the parts of the box is a different dragger with the default geometry changed. The faces of the box are SoTranslate2Draggers, the edges are SoRotateCylindricalDraggers, and the cubes are an SoScaleUniformDragger. Drag them and the dragger will update its translation, rotation and scaleFactor fields to reflect the changes. As with all draggers, if you change the fields the dragger will move to match the new settings.

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

You can change the parts in any instance of this dragger using setPart(). The default part geometries are defined as resources for this SoTransformBoxDragger 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/transformBoxDragger.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

    TransformBoxDragger {
    boundingBoxCaching AUTO
    renderCulling AUTO
    pickCulling AUTO
    isActive FALSE
    rotation 0 0 1 0
    translation 0 0 0
    scaleFactor 1 1 1
    callbackList NULL
    surroundScale NULL
    antiSquish AntiSquish {
    sizing BIGGEST_DIMENSION
    }
    scaler ScaleUniformDragger {
    rotator1 RotateCylindricalDragger {
    rotator2 RotateCylindricalDragger {
    rotator3 RotateCylindricalDragger {
    translator1 Translate2Dragger {
    }
    translator2 Translate2Dragger {
    }
    translator3 Translate2Dragger {
    }
    translator4 Translate2Dragger {
    }
    translator5 Translate2Dragger {
    }
    translator6 Translate2Dragger {
    }
    scaler.scaler <transformBoxScalerScaler resource>
    scaler.scalerActive <transformBoxScalerScalerActive resource>
    scaler.feedback <transformBoxScalerFeedback resource>
    scaler.feedbackActive <transformBoxScalerFeedbackActive resource>
    rotator1.rotator <transformBoxRotatorRotator resource>
    rotator2.rotator <transformBoxRotatorRotator resource>
    rotator3.rotator <transformBoxRotatorRotator resource>
    rotator1.rotatorActive <transformBoxRotatorRotatorActive resource>
    rotator2.rotatorActive <transformBoxRotatorRotatorActive resource>
    rotator3.rotatorActive <transformBoxRotatorRotatorActive resource>
    rotator1.feedback <transformBoxRotatorFeedback resource>
    rotator2.feedback <transformBoxRotatorFeedback resource>
    rotator3.feedback <transformBoxRotatorFeedback resource>
    rotator1.feedbackActive <transformBoxRotatorFeedbackActive resource>
    rotator2.feedbackActive <transformBoxRotatorFeedbackActive resource>
    rotator3.feedbackActive <transformBoxRotatorFeedbackActive resource>
    translator1.translator <transformBoxTranslatorTranslator resource>
    translator2.translator <transformBoxTranslatorTranslator resource>
    translator3.translator <transformBoxTranslatorTranslator resource>
    translator4.translator <transformBoxTranslatorTranslator resource>
    translator5.translator <transformBoxTranslatorTranslator resource>
    translator6.translator <transformBoxTranslatorTranslator resource>
    translator1.translatorActive <transformBoxTranslatorTranslatorActive resource>
    translator2.translatorActive <transformBoxTranslatorTranslatorActive resource>
    translator3.translatorActive <transformBoxTranslatorTranslatorActive resource>
    translator4.translatorActive <transformBoxTranslatorTranslatorActive resource>
    translator5.translatorActive <transformBoxTranslatorTranslatorActive resource>
    translator6.translatorActive <transformBoxTranslatorTranslatorActive resource>
    translator1.xAxisFeedback <transformBoxTranslatorXAxisFeedback resource>
    translator2.xAxisFeedback <transformBoxTranslatorXAxisFeedback resource>
    translator3.xAxisFeedback <transformBoxTranslatorXAxisFeedback resource>
    translator4.xAxisFeedback <transformBoxTranslatorXAxisFeedback resource>
    translator5.xAxisFeedback <transformBoxTranslatorXAxisFeedback resource>
    translator6.xAxisFeedback <transformBoxTranslatorXAxisFeedback resource>
    translator1.yAxisFeedback <transformBoxTranslatorYAxisFeedback resource>
    translator2.yAxisFeedback <transformBoxTranslatorYAxisFeedback resource>
    translator3.yAxisFeedback <transformBoxTranslatorYAxisFeedback resource>
    translator4.yAxisFeedback <transformBoxTranslatorYAxisFeedback resource>
    translator5.yAxisFeedback <transformBoxTranslatorYAxisFeedback resource>
    translator6.yAxisFeedback <transformBoxTranslatorYAxisFeedback resource>
    }

DRAGGER RESOURCES

    Resource: transformBoxScalerScaler
    Part: scaler.scaler
    Appearance: Eight small white cubes at the corners of the box
    Description: Picking this initiates uniform 3D scaling of the dragger.

    Resource: transformBoxScalerScalerActive
    Part: scaler.scalerActive
    Appearance: Yellow version of the regular scaler part
    Description: Displayed while the dragger is being scaled.

    Resource: transformBoxScalerFeedback
    Part: scaler.feedback
    Appearance: Empty separator
    Description: Removes any feedback geometry created in the constructor of the SoScaleUniformDragger.

    Resource: transformBoxScalerFeedbackActive
    Part: scaler.feedbackActive
    Appearance: Empty separator
    Description: Removes any feedbackActive geometry created in the constructor of the SoScaleUniformDragger.

    Resource: transformBoxRotatorRotator
    Parts: rotator1.rotator<BR> rotator2.rotator<BR> rotator3.rotator
    Appearance: Four white lines along the edges of the box
    Description: Picking this begins rotational dragging. In each of the three rotateCylindrical draggers, the lines of the rotator part are oriented parallel to the axis of rotation.

    Resource: transformBoxRotatorRotatorActive
    Parts: rotator1.rotatorActive<BR> rotator2.rotatorActive<BR> rotator3.rotatorActive
    Appearance: Four yellow lines along the edges of the box
    Description: Displayed while the dragger is being rotated

    Resource: transformBoxRotatorFeedback
    Parts: rotator1.feedback<BR> rotator2.feedback<BR> rotator3.feedback
    Appearance: Empty separator
    Description: Removes any feedback geometry created in the constructor of the SoRotateCylindricalDragger.

    Resource: transformBoxRotatorFeedbackActive
    Parts: rotator1.feedbackActive<BR> rotator2.feedbackActive<BR> rotator3.feedbackActive
    Appearance: Thin purple line through center of box
    Description: Displayed to show axis of rotation during rotational dragging.

    Resource: transformBoxTranslatorTranslator
    Parts: translator1.translator<BR> translator2.translator<BR> translator3.translator<BR> translator4.translator<BR> translator5.translator<BR> translator6.translator
    Appearance: Invisible but pickable square surface
    Description: Picking these begins 2-D translational dragging within the plane of one of the sides of the box. The invisible squares of the six translate2Draggers are arranged to form the sides of the box.The squares are easy to discern, although rendered as invisible; they are bounded by the lines of the rotational dragger parts.

    Resource: transformBoxTranslatorTranslatorActive
    Parts: translator1.translatorActive<BR> translator2.translatorActive<BR> translator3.translatorActive<BR> translator4.translatorActive<BR> translator5.translatorActive<BR> translator6.translatorActive
    Appearance: Invisible square surface
    Description: Shown during 2-D translational dragging.

    Resource: transformBoxTranslatorXAxisFeedback
    Parts: translator1.xAxisFeedback<BR> translator2.xAxisFeedback<BR> translator3.xAxisFeedback<BR> translator4.xAxisFeedback<BR> translator5.xAxisFeedback<BR> translator6.xAxisFeedback
    Appearance: Short thin purple line
    Description: Only shown if dragger is moving and the axis is a permissable direction of motion. When pressing <shift>, motion is constrained, and this is displayed only if the primary motion is in the X direction.

    Resource: transformBoxTranslatorYAxisFeedback
    Parts: translator1.yAxisFeedback<BR> translator2.yAxisFeedback<BR> translator3.yAxisFeedback<BR> translator4.yAxisFeedback<BR> translator5.yAxisFeedback<BR> translator6.yAxisFeedback
    Appearance: Short thin purple line
    Description: Only shown if dragger is moving and the axis is a permissable direction of motion. When pressing <shift>, motion is constrained, and this is displayed only if the primary motion is in the Y direction.

CATALOG PARTS

    All Parts
    Part Name Part Type Default Type NULL Default
    callbackList NodeKitListPart yes
    surroundScale SurroundScale yes
    antiSquish AntiSquish no
    scaler ScaleUniformDragger yes
    rotator1 RotateCylindricalDragger yes
    rotator2 RotateCylindricalDragger yes
    rotator3 RotateCylindricalDragger yes
    translator1 Translate2Dragger yes
    translator2 Translate2Dragger yes
    translator3 Translate2Dragger yes
    translator4 Translate2Dragger yes
    translator5 Translate2Dragger yes
    translator6 Translate2Dragger yes

    Extra Information for List Parts from Above Table

    Part Name Container Type Possible Types
    callbackList Separator Callback, EventCallback

SEE ALSO

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

Definition at line 348 of file SoTransformBoxDragger.h.

Constructor & Destructor Documentation

◆ SoTransformBoxDragger()

SoTransformBoxDragger::SoTransformBoxDragger ( )

Constructor.

Member Function Documentation

◆ getClassNodekitCatalog()

static const SoNodekitCatalog * SoTransformBoxDragger::getClassNodekitCatalog ( )
static

Returns the SoNodekitCatalog for this class.

◆ getClassTypeId()

static SoType SoTransformBoxDragger::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getNodekitCatalog()

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

Returns the SoNodekitCatalog for this instance.

Reimplemented from SoDragger.

◆ getTypeId()

virtual SoType SoTransformBoxDragger::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoDragger.

Member Data Documentation

◆ rotation

SoSFRotation SoTransformBoxDragger::rotation

Orientation of the dragger.

Definition at line 396 of file SoTransformBoxDragger.h.

◆ scaleFactor

SoSFVec3f SoTransformBoxDragger::scaleFactor

Scale of the dragger.

Note: The dragger will always scale uniformly in all 3 dimensions, using the highest value in the scaleFactor field. E.g. (10, 1, 1) is equivalent to (10, 10, 10). This behavior is consistent with scaling the dragger in user interactions because the scaling component of the dragger is an SoScaleUniformDragger.

Definition at line 411 of file SoTransformBoxDragger.h.

◆ translation

SoSFVec3f SoTransformBoxDragger::translation

Position of the dragger.

Definition at line 401 of file SoTransformBoxDragger.h.


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