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

Cubic object you can translate and scale by dragging with the mouse. More...

#include <Inventor/draggers/SoTabBoxDragger.h>

+ Inheritance diagram for SoTabBoxDragger:

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.
 
 SoTabBoxDragger ()
 Constructor.
 
void adjustScaleTabSize ()
 Causes the scale tab sizes to be re-adjusted on all 6 SoTabPlaneDraggers so that they remain a near constant screen space size.
 
- 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.
 
SoSFVec3f scaleFactor
 Scale of the dragger.
 
SoSFBool resizeHandles
 If set to TRUE, handles will be resized at each camera motion.
 
SoSFInt32 tabPixelSize
 Specifies the size of the green tabs in pixels.
 
SoSFBool privateStyle
 Controls whether this instance of SoTabBoxDragger shares or does not share parts, e.g.
 
SoSFColor highlightColor
 Specifies the highlight color.
 
SoSFBool enableHighlight
 Enables highlighting for tabs and faces.
 
- 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

Cubic object you can translate and scale by dragging with the mouse.

SoTabBoxDragger is a composite dragger shaped like a box. Inside it are six SoTabPlaneDraggers which the dragger positions and orients to form a cube. The operations available in an SoTabPlaneDragger (translation, 1D scaling and 2D scaling) are available on each face of the cube. Since they each move in their own local space, the dragger may be easily translated or scaled in any direction.

Clicking and dragging a corner tab does a 2D scaling in the plane of the tab by scaling, centered on the opposite corner of that face of the dragger, meaning that the opposite corner is the only corner that won't move.
Note: Holding the SHIFT key while dragging a corner tab forces uniform scaling.

Clicking and dragging an edge tab does 1D scaling about the opposite edge of that face.

Clicking and dragging a face does translation within the plane of the face. Although the face of the dragger is invisible (using the default dragger geometry) it is pickable.
Note: Holding the SHIFT key while dragging a face forces axis constrained dragging. The drag axis is determined by the initial drag direction.

As a composite dragger, this class makes sure that when one plane is dragged, the entire box moves together.

Each SoTabPlaneDragger tries to keep the small tabs a constant size in screen space. Every time a drag begins or ends, the size is automatically recalculated based on the viewing and modeling matrix. When the resizeHandles field is set to TRUE (the default), the tab size is also recalculated during the render traversal if the view matrix has changed (usually because the camera position and/or orientation changed). The application can also force the tab size to be recomputed by calling the adjustScaleTabSize() method.

If the dragger becomes too small in one dimension to contain all three tabs (two corner tabs plus the edge tab), the middle (edge) tab will not be drawn. If the dragger becomes very small (or flat) in one dimension, it may not be possible for the user to resize using the tabs. One solution for this is to provide a "reset dragger" button in the application.

When dragging the translator part, press the <Shift> key and you can constrain motion to either the local x axis or the y axis . The direction is determined by your initial mouse gesture after pressing the key. Releasing the key removes the constraint.

As each sub-dragger is moved, the SoTabBoxDragger updates its scaleFactor and translation fields. As with all draggers, if you change a field 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:

  • Use an SoTabBoxManip, which is subclassed from SoTransform. It creates one of these draggers and uses it as the interface to change its fields.
  • Use an SoROIManip, which is subclassed from SoROI, if your goal is to do volume rendering and interact with a region-of-interest. This is commonly used for medical volume data and seismic volume data.
  • Use field-to-field connections to connect the fields of this dragger to those of any SoTransformation node.
  • Use the standard dragger callbacks, see for example SoDragger::addValueChangedCallback.

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

    TabBoxDragger {
    boundingBoxCaching AUTO
    renderCulling AUTO
    pickCulling AUTO
    isActive FALSE
    resizeHandles TRUE
    translation 0 0 0
    scaleFactor 1 1 1
    tabPixelSize 8
    callbackList NULL
    surroundScale NULL
    privateStyle FALSE
    highlightColor 1.0 1.0 0.0
    enableHighlight TRUE
    tabPlane1 TabPlaneDragger {
    }
    tabPlane2 TabPlaneDragger {
    }
    tabPlane3 TabPlaneDragger {
    }
    tabPlane4 TabPlaneDragger {
    }
    tabPlane5 TabPlaneDragger {
    }
    tabPlane6 TabPlaneDragger {
    }
    boxGeom <tabBoxBoxGeom resource>
    tabPlane1.translator <tabBoxTranslator resource>
    tabPlane2.translator <tabBoxTranslator resource>
    tabPlane3.translator <tabBoxTranslator resource>
    tabPlane4.translator <tabBoxTranslator resource>
    tabPlane5.translator <tabBoxTranslator resource>
    tabPlane6.translator <tabBoxTranslator resource>
    tabPlane1.scaleTabMaterial <tabBoxScaleTabMaterial resource>
    tabPlane2.scaleTabMaterial <tabBoxScaleTabMaterial resource>
    tabPlane3.scaleTabMaterial <tabBoxScaleTabMaterial resource>
    tabPlane4.scaleTabMaterial <tabBoxScaleTabMaterial resource>
    tabPlane5.scaleTabMaterial <tabBoxScaleTabMaterial resource>
    tabPlane6.scaleTabMaterial <tabBoxScaleTabMaterial resource>
    tabPlane1.scaleTabHints <tabBoxScaleTabHints resource>
    tabPlane2.scaleTabHints <tabBoxScaleTabHints resource>
    tabPlane3.scaleTabHints <tabBoxScaleTabHints resource>
    tabPlane4.scaleTabHints <tabBoxScaleTabHints resource>
    tabPlane5.scaleTabHints <tabBoxScaleTabHints resource>
    tabPlane6.scaleTabHints <tabBoxScaleTabHints resource>
    }

DRAGGER RESOURCES

    Resource: tabBoxTranslator
    Parts: tabPlane1.translator<BR> tabPlane2.translator<BR> tabPlane3.translator<BR> tabPlane4.translator<BR> tabPlane5.translator<BR> tabPlane6.translator
    Appearance: Outline of a Square. The region within is pickable
    Description: Begins translation within the plane. The tabBox places and orients each tabPlane so that these squares form a box.

    Resource: tabBoxScaleTabMaterial
    Parts: tabPlane1.scaleTabMaterial<BR> tabPlane2.scaleTabMaterial<BR> tabPlane3.scaleTabMaterial<BR> tabPlane4.scaleTabMaterial<BR> tabPlane5.scaleTabMaterial<BR> tabPlane6.scaleTabMaterial
    Appearance: Green - half diffuse, half emissive.
    Description: Used as material for scaling tabs.

    Resource: tabBoxScaleTabHints
    Parts: tabPlane1.scaleTabHints<BR> tabPlane2.scaleTabHints<BR> tabPlane3.scaleTabHints<BR> tabPlane4.scaleTabHints<BR> tabPlane5.scaleTabHints<BR> tabPlane6.scaleTabHints
    Appearance: shapeHints node:COUNTERCLOCKWISE/SOLID/CONVEX
    Description: Property for the tab nodes.

    Resource: tabBoxBoxGeom
    Part: boxGeom
    Appearance: Unpickable gray outline of a box.
    Description: Just feedback.

CATALOG PARTS

    All Parts
    Part Name Part Type Default Type NULL Default
    callbackList NodeKitListPart yes
    surroundScale SurroundScale yes
    tabPlane1 TabPlaneDragger yes
    tabPlane2 TabPlaneDragger yes
    tabPlane3 TabPlaneDragger yes
    tabPlane4 TabPlaneDragger yes
    tabPlane5 TabPlaneDragger yes
    tabPlane6 TabPlaneDragger yes
    boxGeom Separator yes

    Extra Information for List Parts from Above Table

    Part Name Container Type Possible Types
    callbackList Separator Callback, EventCallback

SEE ALSO

SoTabBoxManip, SoROIManip, SoInteractionKit, SoDragger, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger, SceneOrbiter, SceneExaminer

Definition at line 293 of file SoTabBoxDragger.h.

Constructor & Destructor Documentation

◆ SoTabBoxDragger()

SoTabBoxDragger::SoTabBoxDragger ( )

Constructor.

Member Function Documentation

◆ adjustScaleTabSize()

void SoTabBoxDragger::adjustScaleTabSize ( )

Causes the scale tab sizes to be re-adjusted on all 6 SoTabPlaneDraggers so that they remain a near constant screen space size.

This happens automatically upon dragger finish. Call this to adjust the scale tab sizes at other times, for instance after the camera has changed in a viewer finish callback .

◆ getClassNodekitCatalog()

static const SoNodekitCatalog * SoTabBoxDragger::getClassNodekitCatalog ( )
static

Returns the SoNodekitCatalog for this class.

◆ getClassTypeId()

static SoType SoTabBoxDragger::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getNodekitCatalog()

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

Returns the SoNodekitCatalog for this instance.

Reimplemented from SoDragger.

◆ getTypeId()

virtual SoType SoTabBoxDragger::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoDragger.

Member Data Documentation

◆ enableHighlight

SoSFBool SoTabBoxDragger::enableHighlight

Enables highlighting for tabs and faces.

When this field is true, during a mousemove event, once the cursor moves over a tab or a face of the dragger, this element is highlighted according to the highlightColor. This element is no longer highlighted once the cursor is no longer over it. Default is true.

Definition at line 376 of file SoTabBoxDragger.h.

◆ highlightColor

SoSFColor SoTabBoxDragger::highlightColor

Specifies the highlight color.

See also enableHighlight. The default color is yellow (1,1,0).

Definition at line 368 of file SoTabBoxDragger.h.

◆ privateStyle

SoSFBool SoTabBoxDragger::privateStyle

Controls whether this instance of SoTabBoxDragger shares or does not share parts, e.g.

tabBoxTranslator, tabBoxScaleTabMaterial and tabBoxScaleTabHints with all other existing instances of SoTabBoxDragger. Default is false, meaning parts are shared. Set this field to true if your application needs to change these parts without affecting other draggers in the scene graph. (Indeed, the default was true prior to version 9.6.1)

NOTE: field available since Open Inventor 9.6.1

Definition at line 362 of file SoTabBoxDragger.h.

◆ resizeHandles

SoSFBool SoTabBoxDragger::resizeHandles

If set to TRUE, handles will be resized at each camera motion.

Default is TRUE.

NOTE: field available since Open Inventor 7.0

Definition at line 342 of file SoTabBoxDragger.h.

◆ scaleFactor

SoSFVec3f SoTabBoxDragger::scaleFactor

Scale of the dragger.

Default is 1,1,1.

Definition at line 335 of file SoTabBoxDragger.h.

◆ tabPixelSize

SoSFInt32 SoTabBoxDragger::tabPixelSize

Specifies the size of the green tabs in pixels.

Default is 8

NOTE: field available since Open Inventor 9.2

Definition at line 349 of file SoTabBoxDragger.h.

◆ translation

SoSFVec3f SoTabBoxDragger::translation

Position of the dragger.

Default is 0,0,0.

Definition at line 330 of file SoTabBoxDragger.h.


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