SOTRANSLATE1DRAGGER(3iv)

🌸 SoTranslate1Dragger β€” okay so hear me out

bestie we are reading a page straight outta the 3IV manual and it's literally about SoTranslate1Dragger, a little dragger object that slides along a line when you drag it with the mouse. it's giving "drag me, i dare you" energy. let's go πŸ’…


✨ NAME ✨

SoTranslate1Dragger β€” object you can translate along a line by dragging With the mouse πŸ¦‹

(no that capital W in "With" is not a typo, that's just how the original is, and i refuse to gaslight the source material)


🧬 INHERITS FROM 🧬

SoBase > SoFieldContainer > SoNode > SoBaseKit > SoInteractionKit >
SoDragger > SoTranslate1Dragger

look at that family tree. generational. the whole bloodline is iconic πŸ‘‘


πŸ“œ SYNOPSIS πŸ“œ

first off, you gotta pull it in:

#include <Inventor/draggers/SoTranslate1Dragger.h>

then here's everything it picks up along the way:

Fields from class SoTranslate1Dragger:

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 SoTranslate1Dragger:

                     SoTranslate1Dragger()
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)

that's a LOT of inherited lore and honestly? every single one of them stays. periodt πŸ’–


🫢 DESCRIPTION 🫢

so SoTranslate1Dragger is a simple dragger that translates in one dimension when you drag it with the mouse. it moves along the x axis of its local space, and that axis is determined by where it sits in the scene graph. heads up though β€” any transformation nodes placed before it will affect both the dragger and the direction of motion. so like, the vibes of its neighbors literally move it. no cap.

this node has a translation field that always reflects its position in local space. you set the field β†’ the dragger moves accordingly. icon behavior, honestly. and you can also connect fields of other nodes or engines from this one to make them follow the dragger's motion. main character dragger, everyone else is just following it around πŸŽ€

this dragger contains four parts: translator, translatorActive, feedback, and feedbackActive.

each of these is set by default from a resource described in the Dragger Resources section of the online reference page for this class. and you can swap the parts in any instance of this dragger using setPart().

want your program to use different default resources for the parts? okay so here's the move: copy the file

/usr/share/data/draggerDefaults/translate1Dragger.iv

into your own directory, edit the file, and then set the environment variable SO_DRAGGER_DIR to be a path to that directory. customize, slay, repeat ✨


🌈 FIELDS 🌈

  • SoSFVec3f translation β€” Position of the dragger. that's it, that's the field, it holds the position πŸ¦‹

πŸ’… METHODS πŸ’…

  • SoTranslate1Dragger() β€” Constructor. it makes one. iconic of it.
  • static const SoNodekitCatalog * getClassNodekitCatalog() const β€” Returns an SoNodekitCatalog for this class.
  • static SoType getClassTypeId() β€” Returns type identifier for this class.

πŸ‘‘ CATALOG PARTS πŸ‘‘

All parts πŸ‘‘

here's every part, its type, its default type, and whether it's NULL by default:

  • callbackList β€” Part Type: NodeKitListPart β€” Default Type: -- β€” NULL by Default: yes
  • translator β€” Part Type: Separator β€” Default Type: -- β€” NULL by Default: yes
  • translatorActive β€” Part Type: Separator β€” Default Type: -- β€” NULL by Default: yes
  • feedback β€” Part Type: Separator β€” Default Type: -- β€” NULL by Default: yes
  • feedbackActive β€” 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 πŸŽ€

Resource: translate1Translator

  • Part: translator
  • Appearance: white arrow
  • Description: picking this initiates translation

Resource: translate1TranslatorActive

  • Part: translatorActive
  • Appearance: yellow arrow
  • Description: displayed during translation instead of the translator

Resource: translate1Feedback

  • Part: feedback
  • Appearance: empty Separator by default
  • Description: feedback displayed when not in motion

Resource: translate1FeedbackActive

  • Part: feedbackActive
  • Appearance: empty Separator by default
  • Description: feedback displayed while moving

white arrow when it's chill, yellow arrow when it's doing something β€” the color change is the whole personality, we love a glow-up 😭✨


πŸ“ FILE FORMAT/DEFAULTS πŸ“

Translate1Dragger {
   renderCaching       AUTO
   boundingBoxCaching  AUTO
   renderCulling       AUTO
   pickCulling         AUTO
   isActive            FALSE
   translation         0 0 0
   callbackList        NULL
   translator          <translate1Translator resource>
   translatorActive    <translate1TranslatorActive resource>
   feedback            <translate1Feedback resource>
   feedbackActive      <translate1FeedbackActive resource>
}

copy that exactly bestie, do not freestyle the defaults πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

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

the whole dragger friend group is here and they're all invited to the party 🫢


aaaand that's the page!! it lives in the 3IV manual, and the footer slot is literally just SoTranslate1Dragger(3IV)() β€” the date spot is empty, which is honestly so real of it, no deadlines, no timestamps, just vibes. bye bestie, go drag something along a line πŸ’–πŸ¦‹βœ¨