SOTABBOXDRAGGER(3iv)

πŸ’– SoTabBoxDragger(3IV) πŸ’–

okay bestie, pull up a chair because today we're talking about SoTabBoxDragger(3IV) β€” the dragger that's shaped like a little cube and lets you translate AND scale stuff by grabbing it with your mouse. it's giving ✨ hands-on ✨ and honestly? obsessed. let's get into it. πŸŽ€


🌸 NAME 🌸

SoTabBoxDragger β€” a cubic object you can translate and scale by dragging with the mouse. yes, literally a box you can grab. slay. πŸ’…


πŸ¦‹ INHERITS FROM πŸ¦‹

this thing is deep in the family tree, no cap:

SoBase > SoFieldContainer > SoNode > SoBaseKit > SoInteractionKit > SoDragger > SoTabBoxDragger

✨ SYNOPSIS ✨

first things first, you gotta include the header:

#include <Inventor/draggers/SoTabBoxDragger.h>

🌟 Fields from class SoTabBoxDragger 🌟

SoSFVec3f           scaleFactor
SoSFVec3f           translation

🌟 Fields from class SoDragger 🌟

SoSFBool            isActive

🌟 Fields from class SoInteractionKit 🌟

SoSFEnum            renderCaching
SoSFEnum            boundingBoxCaching
SoSFEnum            renderCulling
SoSFEnum            pickCulling

🌟 Parts from class SoBaseKit 🌟

(SoNodeKitListPart)  callbackList

🌟 Methods from class SoTabBoxDragger 🌟

                     SoTabBoxDragger()
void                adjustScaleTabSize()
static const SoNodekitCatalog *
                     getClassNodekitCatalog() const
static SoType       getClassTypeId()

🌟 Methods from class SoDragger 🌟

void                addStartCallback(SoDraggerCB *f, void *userData =
                         NULL)
void                removeStartCallback(SoDraggerCB *f, void *userData =
                         NULL)
void                addMotionCallback(SoDraggerCB *f, void *userData =
                         NULL)
void                removeMotionCallback(SoDraggerCB *f, void *userData =
                         NULL)
void                addFinishCallback(SoDraggerCB *f, void *userData =
                         NULL)
void                removeFinishCallback(SoDraggerCB *f, void *userData =
                         NULL)
void                addValueChangedCallback(SoDraggerCB *f, void *userData
                         = NULL)
void                removeValueChangedCallback(SoDraggerCB *f, void
                         *userData = NULL)
SbBool              enableValueChangedCallbacks()
void                setMinGesture(int pixels)
int                 getMinGesture() const
static void         setMinScale(float newMinScale)
static float        getMinScale()

🌟 Methods from class SoInteractionKit 🌟

virtual SbBool      setPartAsPath(const SbName &partName, SoPath
                         *surrogatePath )

🌟 Methods from class SoBaseKit 🌟

virtual const SoNodekitCatalog *
                         getNodekitCatalog() const
virtual SoNode *         getPart(const SbName &partName, SbBool
                              makeIfNeeded)
SbString                 getPartString(const SoBase *part)
virtual SoNodeKitPath *  createPathToPart(const SbName &partName, SbBool
                              makeIfNeeded, const SoPath *pathToExtend =
                              NULL)
virtual SbBool           setPart(const SbName &partName, SoNode *newPart)
SbBool                   set(char *partName, char *parameters)
SbBool                   set(char *nameValuePairs)
static SbBool            isSearchingChildren()
static void              setSearchingChildren(SbBool newVal)

🌟 Methods from class SoNode 🌟

void                setOverride(SbBool state)
SbBool              isOverride() const
SoNode *            copy(SbBool copyConnections = FALSE) const
virtual SbBool      affectsState() const
static SoNode *     getByName(const SbName &name)
static int          getByName(const SbName &name, SoNodeList &list)

🌟 Methods from class SoFieldContainer 🌟

void                setToDefaults()
SbBool              hasDefaultValues() const
SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
void                copyFieldValues(const SoFieldContainer *fc, SbBool
                         copyConnections = FALSE)
void                get(SbString &fieldDataString)
virtual int         getFields(SoFieldList &resultList) const
virtual SoField *   getField(const SbName &fieldName) const
SbBool              getFieldName(const SoField *field, SbName &fieldName)
                         const
SbBool              isNotifyEnabled() const
SbBool              enableNotify(SbBool flag)

🌟 Methods from class SoBase 🌟

void                ref()
void                unref() const
void                unrefNoDelete() const
void                touch()
virtual SoType      getTypeId() const
SbBool              isOfType(SoType type) const
virtual void        setName(const SbName &name)
virtual SbName      getName() const

🌟 Macros from class SoBaseKit 🌟

SO_GET_PART(kit, partName, partClass)
SO_CHECK_PART(kit, partName, partClass)

πŸŽ€ DESCRIPTION πŸŽ€

okay so SoTabBoxDragger is a composite dragger shaped like a box. inside it? there are six SoTabPlaneDraggers that the dragger positions and orients so they form a cube. 🧊 each face of that cube gets everything an SoTabPlaneDragger can do: translation, 1D scaling, and 2D scaling. and because each one moves in its own local space, you can easily translate or scale the whole dragger in any direction. periodt.

as a composite dragger, this class makes sure that when one plane gets dragged, the ENTIRE box moves together. no rogue faces, bestie. 🫢

as each sub-dragger moves, the SoTabBoxDragger updates its scaleFactor and translation fields. and like all draggers β€” if you change a field, the dragger moves to match the new settings. it's reactive. it's main character energy. ✨

remember: this is not an SoTransform! do not come for it. if you want to move other objects with this dragger, you've got two options, pick your fighter:
  • [a] use an SoTabBoxManip, which is subclassed from SoTransform. it creates one of these draggers and uses it as the interface to change its fields. (see the SoTabBoxManip man page πŸ‘€)
  • [b] use field-to-field connections to connect the fields of this dragger to those of any SoTransformation node.

you can change the parts in any instance of this dragger using setPart(). πŸ’… the default part geometries are defined as resources for this SoTabBoxDragger class, and they're 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 /usr/share/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. yes, really β€” go off. πŸ“βœ¨


πŸ“ FIELDS πŸ“

  • SoSFVec3f scaleFactor β€” scale of the dragger. how big it is, basically. the whole vibe check of its size. πŸ“
  • SoSFVec3f translation β€” position of the dragger. where it's at. literally. πŸ“

πŸ’œ METHODS πŸ’œ

  • SoTabBoxDragger() β€” the constructor. baby's first dragger. 🍼
  • void adjustScaleTabSize() β€” makes the scale tab sizes get re-adjusted on all 6 SoTabPlaneDraggers so they stay at a near-constant screen-space size. this happens automatically when the dragger finishes, but you can call it yourself to adjust the scale tab sizes at other times β€” for instance, after the camera has changed in a viewer finish callback. πŸ‘‘ so thoughtful of it.
  • static const SoNodekitCatalog * getClassNodekitCatalog() const β€” returns an SoNodekitCatalog for this class. the full tea on the class structure. πŸ«–
  • static SoType getClassTypeId() β€” returns the type identifier for this class. its little name tag. 🏷️

🌈 CATALOG PARTS 🌈

here's the whole parts list, no gatekeeping, every single one:

All parts:

  • callbackList β€” Part Type: NodeKitListPart β€” Default Type: -- β€” NULL by Default: yes
  • surroundScale β€” Part Type: SurroundScale β€” Default Type: -- β€” NULL by Default: yes
  • tabPlane1 β€” Part Type: TabPlaneDragger β€” Default Type: -- β€” NULL by Default: yes
  • tabPlane2 β€” Part Type: TabPlaneDragger β€” Default Type: -- β€” NULL by Default: yes
  • tabPlane3 β€” Part Type: TabPlaneDragger β€” Default Type: -- β€” NULL by Default: yes
  • tabPlane4 β€” Part Type: TabPlaneDragger β€” Default Type: -- β€” NULL by Default: yes
  • tabPlane5 β€” Part Type: TabPlaneDragger β€” Default Type: -- β€” NULL by Default: yes
  • tabPlane6 β€” Part Type: TabPlaneDragger β€” Default Type: -- β€” NULL by Default: yes
  • boxGeom β€” Part Type: Separator β€” Default Type: -- β€” NULL by Default: yes

Extra information for list parts from above table:

  • callbackList β€” Container Type: Separator β€” Permissible Types: Callback, EventCallback

✨ DRAGGER RESOURCES ✨

okay bestie, this is the part where we meet the lil resource glow-ups that live inside the dragger πŸ’– every one of them gets its own parts, its own look, and its own whole personality:

  • Resource: tabBoxTranslator
    • Parts: tabPlane1.translator, tabPlane2.translator, tabPlane3.translator, tabPlane4.translator, tabPlane5.translator, 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. no cap, the six squares literally assemble themselves into the box vibe ✨

  • Resource: tabBoxScaleTabMaterial
    • Parts: tabPlane1.scaleTabMaterial, tabPlane2.scaleTabMaterial, tabPlane3.scaleTabMaterial, tabPlane4.scaleTabMaterial, tabPlane5.scaleTabMaterial, tabPlane6.scaleTabMaterial
    • Appearance: Green - half diffuse, half emissive. πŸ’š
    • Description: Used as material for scaling tabs. it's giving green, it's giving glow, it's giving scale me 🫢

  • Resource: tabBoxScaleTabHints
    • Parts: tabPlane1.scaleTabHints, tabPlane2.scaleTabHints, tabPlane3.scaleTabHints, tabPlane4.scaleTabHints, tabPlane5.scaleTabHints, tabPlane6.scaleTabHints
    • Appearance: shapeHints node:COUNTERCLOCKWISE/SOLID/CONVEX
    • Description: Property for the tab nodes. lowkey just the little settings gremlin for the tabs 🧚

  • Resource: tabBoxBoxGeom
    • Part: boxGeom
    • Appearance: Unpickable grey outline of a box. 🩢
    • Description: Just feedback.. (yes, that's the whole job. iconic. it's not pickable, it's not doing the work, it's just there to show you the box πŸ’…)

πŸ“ FILE FORMAT/DEFAULTS πŸ“

here's the whole default blueprint, bestie, exactly as it ships β€” do not touch, do not improvise, just vibe πŸ¦‹

TabBoxDragger {
   renderCaching               AUTO
   boundingBoxCaching          AUTO
   renderCulling               AUTO
   pickCulling                 AUTO
   isActive                    FALSE
   translation                 0 0 0
   scaleFactor                 1 1 1
   callbackList                NULL
   surroundScale               NULL
   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>
}
note how every single tabPlane gets its own translator, its own scaleTabMaterial, and its own scaleTabHints β€” six of each, no skips, no shortcuts. the box is symmetrical and so is the config ✨

🌈 SEE ALSO 🌈

the whole dragger friend group, fr fr β€” go say hi, they all ate:

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

and that's a wrap on the whole page, bestie πŸ’– this one is filed under SoTabBoxDragger(3IV)() β€” that's the source-and-version tag right there at the bottom, the lil signature of the page. no extra date, just the name and the section marker, and honestly? it's giving minimalist queen πŸ‘‘ you're welcome, now go drag some boxes πŸŽ€βœ¨