SOSURROUNDSCALE(3iv)
π SoSurroundScale β the manual page, but make it cute π
okay bestie, gather round, because today we're talking about SoSurroundScale, a member of the <rainbow>SoSurroundScale(3IV)</rainbow> family of manual pages. It's a transformation node that adjusts the current matrix so a default cube will surround other objects. yes literally. it's the node that makes things β¨fitβ¨. π
πΈ INHERITS FROM πΈ
SoBase > SoFieldContainer > SoNode > SoTransformation > SoSurroundScale
the whole ancestry, no skips. it's giving noble bloodline. π
β¨ SYNOPSIS β¨
#include <Inventor/nodes/SoSurroundScale.h>
π¦ Fields from class SoSurroundScale
SoSFInt32numNodesUpToContainerSoSFInt32numNodesUpToReset
π¦ Methods from class SoSurroundScale
SoSurroundScale()voidinvalidate()static SoTypegetClassTypeId()
π¦ Methods from class SoNode
voidsetOverride(SbBool state)SbBoolisOverride() constSoNode *copy(SbBool copyConnections = FALSE) constvirtual SbBoolaffectsState() conststatic SoNode *getByName(const SbName &name)static intgetByName(const SbName &name, SoNodeList &list)
π¦ Methods from class SoFieldContainer
voidsetToDefaults()SbBoolhasDefaultValues() constSbBoolfieldsAreEqual(const SoFieldContainer *fc) constvoidcopyFieldValues(const SoFieldContainer *fc, SbBool copyConnections = FALSE)SbBoolset(const char *fieldDataString)voidget(SbString &fieldDataString)virtual intgetFields(SoFieldList &resultList) constvirtual SoField *getField(const SbName &fieldName) constSbBoolgetFieldName(const SoField *field, SbName &fieldName) constSbBoolisNotifyEnabled() constSbBoolenableNotify(SbBool flag)
π¦ Methods from class SoBase
voidref()voidunref() constvoidunrefNoDelete() constvoidtouch()virtual SoTypegetTypeId() constSbBoolisOfType(SoType type) constvirtual voidsetName(const SbName &name)virtual SbNamegetName() const
π DESCRIPTION π
so. when this node gets traversed by an action, it appends a transformation to the current transformation matrix so that a default size cube will surround the objects specified by its fields. that's the whole vibe. π§
transform manipulators β like SoHandleBoxManip β use these nodes to make themselves surround other objects. yes, they're using surroundScale as their little helper. besties supporting besties. π«Ά
β οΈ important: this node only recalculates after the invalidate() method has been called. otherwise it just uses a saved scale and translation. no recalc, no drama. it's coasting on old data. π
when it's calculating what to surround, SoSurroundScale looks at the current path in the action and at its own field values. then SoSurroundScale applies an SoGetBoundingBoxAction to the node that is numNodesUpToContainer nodes above it on the path. it also tells the action to reset the bounding box upon traversal of the node located numNodesUpToReset nodes above it in the path. then SoSurroundScale appends a translation and scale to the current transformation so that a default size SoCube will translate and scale to fit this bounding box. slay. π
for example, when an SoHandleBoxManip wants to surround the objects it's going to move, the scene graph will look something like this:
RootNode
-------------------------
| |
handleBoxManip movingStuff
|
handleBoxDragger
|
separator
-----------------------------------
| | |
motionMatrix surroundScale cubeGeom
the SoHandleBoxDragger wants to transform the cubeGeom so that it surrounds the movingStuff. so it sets the surroundScale fields to:
numNodesUpToContainer = 4;
numNodesUpToReset = 3;
the SoBoundingBoxAction will then be applied to RootNode, with a reset after traversing the SoHandleBoxManip. so the SoSurroundScale will surround the objects below separator, and to the right of handleBoxManip, producing the desired effect. we love a plan that comes together. π
π FIELDS π
SoSFInt32numNodesUpToContainerβ when it gets traversed by an action, ifsurroundScaleneeds to calculate a new box, it looks at the current path in the action. it travels up this path a distance ofnumNodesUpToContainerand applies anSoGetBoundingBoxActionto the node that it finds there. it's going up the tree to find its target, basically. π¦SoSFInt32numNodesUpToResetβ before applying theSoGetBoundingBoxAction(see thenumNodesUpToContainerfield above π) thesurroundScalenode travels up the path a distance ofnumNodesUpToResetand tells the action to reset the bounding box upon traversal of that node. that's the reset point, bestie. π―
β METHODS β
SoSurroundScale()β creates a surround scale node with default settings. brand new, fresh out the box, defaults everywhere. β¨voidinvalidate()β if you call this, then next time an action is applied the node will re-calculate its cached translation and scale values. it's the "okay bestie, recalculate" button. π«Άstatic SoTypegetClassTypeId()β returns the type identifier for this class. iykyk. π
π₯ ACTION BEHAVIOR π₯
SoGLRenderAction,SoCallbackAction,SoGetBoundingBoxAction,SoRayPickActionβ accumulates scaling and translation transformations into the current transformation. πSoGetMatrixActionβ returns the matrix corresponding to the scaling and translation. the receipts, basically. π§Ύ
π FILE FORMAT/DEFAULTS π
SurroundScale {
numNodesUpToContainer 0
numNodesUpToReset 0
}
zero and zero. starting from nothing, building a whole cube-sized vibe. we love an origin story. πβ¨
π SEE ALSO π
SoTransformation, SoTransformManip, SoCenterballDragger, SoCenterballManip, SoHandleBoxDragger, SoHandleBoxManip, SoJackDragger, SoJackManip, SoTabBoxDragger, SoTabBoxManip, SoTrackballDragger, SoTrackballManip, SoTransformBoxDragger, SoTransformBoxManip
the whole friend group, honestly. go say hi. π«Ά
and that's the page!! πΈ this was SoSurroundScale(3IV), brought to you by the good people behind this source and version, and stamped with whatever date it was stamped with. mwah. π π go surround something.
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms