SODIRECTIONALLIGHTDRAGGER(3iv)

SoDirectionalLightDragger πŸ’–βœ¨

ok so bestie, this is SoDirectionalLightDragger(3IV) β€” yes that's the manual name, yes we're putting it right up top, you're welcome πŸŽ€. It's a directional icon you rotate and translate by dragging with the mouse. Iconic behaviour, fr fr.


🌸 NAME 🌸

SoDirectionalLightDragger β€” a directional icon you rotate and translate by dragging with the mouse πŸ’…


πŸ¦‹ INHERITS FROM πŸ¦‹

lowkey a whole family tree, and it goes like this:

SoBase > SoFieldContainer > SoNode > SoBaseKit > SoInteractionKit >
SoDragger > SoDirectionalLightDragger

✨ SYNOPSIS ✨

first things first, you gotta include the header:

#include <Inventor/draggers/SoDirectionalLightDragger.h>

Fields from class SoDirectionalLightDragger

SoSFRotation        rotation
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 SoDirectionalLightDragger

                     SoDirectionalLightDragger()
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 🌈

ok bestie gather round, because this one is genuinely cute. SoDirectionalLightDragger is a composite dragger. It looks like a sun with a big ol' arrow coming out of it 🌞➑️. You can rotate that arrow around the sun by dragging it with the mouse, and where it's pointing is stored in the rotation field. You can also drag the sun (and yeah, the arrow comes along, they're a package deal πŸ’«) through 3-space. That location lives in the translation field.

The dragger uses an SoRotateSphericalDragger to handle the rotation. But instead of using the default spherical geometry, this dragger uses an arrow shape. slay.

The sun is an SoDragPointDragger. Dragging it edits the translation field, and it goes both ways β€” if you change the translation field, the sun moves to that new location and brings the arrow with it. The sun looks and behaves exactly like the sun in an SoPointLightDragger, and so does the material part. So if you want the deets, go read the SoPointLightDragger man page.

REMEMBER, bestie: This is not a light source! It just looks like one. no cap. If you actually want to move a light with this dragger, you've got options:

[a] Use an SoDirectionalLightManip, which is subclassed from SoLight. It creates an SoDirectionalLightDragger and uses it as the interface to change the direction of its light source (peep the SoDirectionalLightManip man page for that). The manipulator also edits the material part of this dragger so it matches the color of light the manipulator is producing. But heads up β€” the directional light manipulator will ignore the translation field, because a directional light has no location or translation field. So in this case the translation dragger is really just letting you move the physical arrow wherever you want it to be. it's giving "decorative". πŸ’…

[b] Put an SoTransform under an SoTransformSeparator. Add the SoDirectionalLight as the next child. Then use a field-to-field connection between the rotation fields of this dragger and the transform node to synchronize the light with this dragger.

[c] Use engines to connect the rotation field of this dragger to the direction field of an SoDirectionalLight. Use the rotation as input to an SoComposeMatrix engine. Then, use an SoTransformVec3f engine to apply that matrix to (0,0,-1), the default light direction.

You can change the parts in any instance of this dragger using setPart(). The default part geometries are defined as resources for this SoDirectionalLightDragger class. They're detailed in the Dragger Resources section of the online reference page for this class. And if you wanna make your program use different default resources for the parts, you can copy the file /usr/share/data/draggerDefaults/directionalLightDragger.iv into your own directory, edit that file, and then set the environment variable SO_DRAGGER_DIR to be a path to that directory. customisation era ✨


πŸŽ€ FIELDS πŸŽ€

  • SoSFRotation rotation β€” Orientation of the rotating part (an arrow by default). 🏹
  • SoSFVec3f translation β€” Position of the origin of the directional light dragger. πŸ“

πŸ’… METHODS πŸ’…

  • SoDirectionalLightDragger() β€” Constructor. the origin story ✨
  • static const SoNodekitCatalog *getClassNodekitCatalog() const β€” Returns an SoNodekitCatalog for this class.
  • static SoType getClassTypeId() β€” Returns type identifier for this class. πŸͺͺ

πŸ‘‘ CATALOG PARTS πŸ‘‘

All parts

every single one, with the "NULL by Default" tea:

  • callbackList β€” Part Type: NodeKitListPart β€” Default Type: -- β€” NULL by Default: yes
  • material β€” Part Type: Material β€” Default Type: -- β€” NULL by Default: yes
  • translatorRotInv β€” Part Type: Rotation β€” Default Type: -- β€” NULL by Default: yes
  • translator β€” Part Type: DragPointDragger β€” Default Type: -- β€” NULL by Default: yes
  • rotator β€” Part Type: RotateSphericalDragger β€” Default Type: -- β€” NULL by Default: yes

Extra information for list parts from above table

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

ok and that's part 1, bestie β€” more is coming, don't go anywhere 🫢

✨ DRAGGER RESOURCES ✨

okay bestie this is the fun part β€” every resource that lives inside this dragger, what part of the scene graph it hooks onto, what it looks like, and what it actually does. no skips. 🫢


πŸŽ€ Resource: directionalLightRotatorRotator

  • Part: rotator.rotator
  • Appearance: white arrow that goes through the sun
  • Description: picking this begins rotation of the arrow about the sun-shape

πŸŽ€ Resource: directionalLightRotatorRotatorActive

  • Part: rotator.rotatorActive
  • Appearance: yellow arrow that goes through the sun
  • Description: displayed while the arrow is being rotated

πŸŽ€ Resource: directionalLightRotatorFeedback

  • Part: rotator.feedback
  • Appearance: empty Separator
  • Description: this disables display of the axes that a rotateSpherical dragger uses by default

πŸŽ€ Resource: directionalLightRotatorFeedbackActive

  • Part: rotator.feedbackActive
  • Appearance: empty Separator
  • Description: this disables display of the axes that a rotateSpherical dragger uses by default

πŸŽ€ Resource: directionalLightOverallMaterial

  • Part: material
  • Appearance: white. half strength emissive, half strength diffuse
  • Description: sets material for the sun shape when stationary. Resource for the moving sun, directionalLightTranslatorPlaneTranslatorActive, contains a yellow material for highlighting.

πŸŽ€ Resource: directionalLightTranslatorPlaneTranslator

  • Parts:
    • translator.yzTranslator.translator
    • translator.xzTranslator.translator
    • translator.xyTranslator.translator
  • Appearance: sun shape with no material
  • Description: picking these parts initiates dragging by the yz, xz, and xy planar draggers respectively.

πŸŽ€ Resource: directionalLightTranslatorPlaneTranslatorActive

  • Parts:
    • translator.yzTranslator.translatorActive
    • translator.xzTranslator.translatorActive
    • translator.xyTranslator.translatorActive
  • Appearance: yellow sun shape
  • Description: shown during planar dragging in the yz, xz, and xy planes respectively.

πŸŽ€ Resource: directionalLightTranslatorLineTranslator

  • Parts:
    • translator.xTranslator.translator
    • translator.yTranslator.translator
    • translator.zTranslator.translator
  • Appearance: white cylinder
  • Description: picking these parts initiates dragging in the x, y, and z linear draggers respectively.

πŸŽ€ Resource: directionalLightTranslatorLineTranslatorActive

  • Parts:
    • translator.xTranslator.translatorActive
    • translator.yTranslator.translatorActive
    • translator.zTranslator.translatorActive
  • Appearance: yellow cylinder
  • Description: shown during linear dragging in the x, y, and z directions respectively.

πŸ’– FILE FORMAT/DEFAULTS πŸ’–

this is literally the whole default setup, laid out exactly as it comes out of the box. do not touch unless you mean it, ok? πŸ‘‘

DirectionalLightDragger {
   renderCaching                             AUTO
   boundingBoxCaching                        AUTO
   renderCulling                             AUTO
   pickCulling                               AUTO
   isActive                                  FALSE
   translation                               0 0 0
   rotation                                  0 0 1  0
   callbackList                              NULL
   material                                  <directionalLightOverallMaterial resource>
   translatorRotInv                          NULL
   translator                                DragPointDragger {
   }

   rotator                                   RotateSphericalDragger {
   }

   rotator.rotator                           <directionalLightRotatorRotator resource>
   rotator.rotatorActive                     <directionalLightRotatorRotatorActive resource>
   rotator.feedback                          <directionalLightRotatorFeedback resource>
   rotator.feedbackActive                    <directionalLightRotatorFeedbackActive resource>
   translator.yzTranslator.translator        <directionalLightTranslatorPlaneTranslator resource>
   translator.xzTranslator.translator        <directionalLightTranslatorPlaneTranslator resource>
   translator.xyTranslator.translator        <directionalLightTranslatorPlaneTranslator resource>
   translator.yzTranslator.translatorActive  <directionalLightTranslatorPlaneTranslatorActive resource>
   translator.xzTranslator.translatorActive  <directionalLightTranslatorPlaneTranslatorActive resource>
   translator.xyTranslator.translatorActive  <directionalLightTranslatorPlaneTranslatorActive resource>
   translator.xTranslator.translator         <directionalLightTranslatorLineTranslator resource>
   translator.yTranslator.translator         <directionalLightTranslatorLineTranslator resource>
   translator.zTranslator.translator         <directionalLightTranslatorLineTranslator resource>
   translator.xTranslator.translatorActive   <directionalLightTranslatorLineTranslatorActive resource>
   translator.yTranslator.translatorActive   <directionalLightTranslatorLineTranslatorActive resource>
   translator.zTranslator.translatorActive   <directionalLightTranslatorLineTranslatorActive resource>
}

🌈 SEE ALSO 🌈

go read these next bestie, they're all part of the same little family 🧚

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

and that's a wrap on the whole thing, bestie πŸ’… this was the <rainbow>3IV</rainbow> build of the SoDirectionalLightDragger page, and yeah we are so done. go forth and drag your directional lights around, you absolute icon πŸ‘‘πŸ’–