SOTRANSLATE2DRAGGER(3iv)

πŸ’… SOTRANSLATE2DRAGGER β€” the 3IV manual page, part 1 of 2 πŸ¦‹

okay bestie, buckle up, because this is the dragger that lets you yeet stuff around a plane with your mouse and honestly? it's giving main character energy ✨


🌸 NAME 🌸

SoTranslate2Dragger β€” it's an object you can translate within a plane by dragging with the mouse. that's it. that's the whole job. and it does it beautifully. πŸ’–


🧬 INHERITS FROM 🧬

the whole family tree, no cap:

SoBase > SoFieldContainer > SoNode > SoBaseKit > SoInteractionKit > SoDragger > SoTranslate2Dragger

✨ SYNOPSIS ✨

first things first, you gotta include the header, obviously:

#include <Inventor/draggers/SoTranslate2Dragger.h>

πŸŽ€ Fields from class SoTranslate2Dragger

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 SoTranslate2Dragger

                     SoTranslate2Dragger()
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 SoTranslate2Dragger is a simple dragger β€” and when I say simple I mean it's not doing too much, it's just slaying β€” that translates in two dimensions when you drag it with the mouse. πŸ–±οΈβœ¨ It moves within the x-y plane of its local space, and that local space is determined by its location in the scene graph. so if you put transformation nodes before it in the graph, those transformations will affect both the dragger itself and the direction it moves. fr fr, no cap. πŸ”₯

now here's the cute part: press the <Shift> key and you can constrain motion to either the x axis or the y axis. πŸŽ€ which one? that's determined by your initial mouse gesture after you press the key. let go of the key and boom, constraint removed. it's giving precision. it's giving control. πŸ’…

this node has a translation field which always reflects its position in local space. set the field, and the dragger will move accordingly β€” like, it just listens. you can also connect fields of other nodes or engines from this one to make them follow the dragger's motion. obsessed. 🫢

this dragger contains six parts:

  • translator
  • translatorActive
  • feedback
  • feedbackActive
  • xAxisFeedback
  • yAxisFeedback

the last two parts are only displayed during motion, and only when their direction of motion is enabled. (and yes β€” pressing the <Shift> key and then dragging disables one of the two directions. that's the whole point, bestie. πŸ™ˆ)

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 change the parts in any instance of this dragger using setPart(). πŸ› οΈ

you can also make your program use different default resources for the parts by copying this file:

/usr/share/data/draggerDefaults/translate2Dragger.iv

into your own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to that directory. ✨ (iykyk)


πŸ”₯ FIELDS πŸ”₯

  • SoSFVec3f translation β€” Position of the dragger. literally its whole location vibe check. πŸ’–

⭐ METHODS ⭐

  • SoTranslate2Dragger() β€” Constructor. it makes one. iconic behavior. πŸ‘‘
  • static const SoNodekitCatalog * getClassNodekitCatalog() const β€” Returns an SoNodekitCatalog for this class. πŸ“š
  • static SoType getClassTypeId() β€” Returns type identifier for this class. your little ID card. πŸͺͺ

πŸ‘‘ CATALOG PARTS πŸ‘‘

🌈 All parts

every single part, its 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
  • xAxisFeedback β€” Part Type: Separator β€” Default Type: -- β€” NULL by Default: yes
  • yAxisFeedback β€” 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: translate2Translator

  • Part: translator
  • Appearance: pair of white crossing arrows 🀍
  • Description: picking this initiates translation

πŸ¦‹ Resource: translate2TranslatorActive

  • Part: translatorActive
  • Appearance: pair of yellow crossing arrows πŸ’›
  • Description: displayed during translation instead of the translator

πŸ¦‹ Resource: translate2Feedback

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

πŸ¦‹ Resource: translate2FeedbackActive

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

πŸ¦‹ Resource: translate2XAxisFeedback

  • Part: xAxisFeedback
  • Appearance: 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: translate2YAxisFeedback

  • Part: yAxisFeedback
  • Appearance: 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.

🌸 FILE FORMAT/DEFAULTS 🌸

here's the whole default situation, verbatim, don't touch anything:

Translate2Dragger {
    renderCaching       AUTO
    boundingBoxCaching  AUTO
    renderCulling       AUTO
    pickCulling         AUTO
    isActive            FALSE
    translation         0 0 0
    callbackList        NULL
    translator          <translate2Translator resource>
    translatorActive    <translate2TranslatorActive resource>
    feedback            <translate2Feedback resource>
    feedbackActive      <translate2FeedbackActive resource>
    xAxisFeedback       <translate2XAxisFeedback resource>
    yAxisFeedback       <translate2YAxisFeedback resource>
}

bestie this is only part 1 🫢 there's more coming, so don't go anywhere β€” we're not even done yet πŸ’–βœ¨

πŸ‘― SEE ALSO

ok bestie you made it to the end, and now it's time for the friend group. SoTranslate2Dragger doesn't run solo β€” it rolls deep with the whole dragger clique. Go read these when you want more of the same energy πŸ’–

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

and that's the whole page, bestie πŸŽ€ you literally just read the entire SoTranslate2Dragger(3IV) manual, cover to cover, no skimming (i would know πŸ™ˆ). the little footer at the bottom is where the source, version and date live β€” it's stamped with the page name and section SoTranslate2Dragger(3IV), and the version-and-date slots there are just sitting empty like an unread notification πŸ’€. go forth and drag those translations, you absolute icon πŸ‘‘βœ¨