SoSurroundScale(3)
π SoSurroundScale π
Library Functions Manual Β· section 3 β bestie, this is the manual page for SoSurroundScale, and yes it's a whole saga (this is part 1 of 3, we are NOT done yet).
okay so real talk: this page is mostly a giant family tree of inherited functions, and I'm gonna walk you through every single one because we do not skip members in this house. π«Ά
β¨ NAME β¨
SoSurroundScale β the class that automatically scales geometry to surround other geometry. that's it, that's the whole job, and it does it iconically. π
πΈ SYNOPSIS πΈ
#include <Inventor/nodes/SoSurroundScale.h>
Inherits SoTransformation. π
π¦ Public Member Functions π¦
virtual SoType getTypeId (void) constSoSurroundScale (void)void invalidate (void)virtual void doAction (SoAction *action)void setDoingTranslations (const SbBool val)SbBool isDoingTranslations (void)
π Public Member Functions inherited from SoNode π
void setOverride (const SbBool state)SbBool isOverride (void) constvoid setNodeType (const NodeType type)NodeType getNodeType (void) constvirtual SoNode * copy (SbBool copyconnections=0) constvirtual SbBool affectsState (void) constvirtual void GLRenderBelowPath (SoGLRenderAction *action)virtual void GLRenderInPath (SoGLRenderAction *action)virtual void GLRenderOffPath (SoGLRenderAction *action)virtual void handleEvent (SoHandleEventAction *action)virtual void rayPick (SoRayPickAction *action)virtual void search (SoSearchAction *action)virtual void write (SoWriteAction *action)virtual void audioRender (SoAudioRenderAction *action)virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)virtual void grabEventsSetup (void)virtual void grabEventsCleanup (void)virtual void startNotify (void)virtual void notify (SoNotList *l)uint32_t getNodeId (void) constvirtual SoChildList * getChildren (void) constvirtual void writeInstance (SoOutput *out)virtual SoNode * addToCopyDict (void) constvirtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)virtual SoFieldContainer * copyThroughConnection (void) const
π Public Member Functions inherited from SoFieldContainer π
void setToDefaults (void)SbBool hasDefaultValues (void) constSbBool fieldsAreEqual (const SoFieldContainer *container) constvoid copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=0)SbBool set (const char *const fielddata)void get (SbString &fielddata)virtual int getFields (SoFieldList &l) constvirtual int getAllFields (SoFieldList &l) constvirtual SoField * getField (const SbName &name) constvirtual SoField * getEventIn (const SbName &name) constvirtual SoField * getEventOut (const SbName &name) constSbBool getFieldName (const SoField *const field, SbName &name) constSbBool enableNotify (const SbBool flag)SbBool isNotifyEnabled (void) constSbBool set (const char *fielddata, SoInput *in)void get (SbString &fielddata, SoOutput *out)virtual SbBool validateNewFieldValue (SoField *field, void *newval)virtual void addWriteReference (SoOutput *out, SbBool isfromfield=0)SbBool getIsBuiltIn (void) constvoid setUserData (void *userdata) constvoid * getUserData (void) const
π¦ Public Member Functions inherited from SoBase π¦
void ref (void) constvoid unref (void) constvoid unrefNoDelete (void) constint32_t getRefCount (void) constvoid touch (void)SbBool isOfType (SoType type) constvirtual SbName getName (void) constvirtual void setName (const SbName &newname)void addAuditor (void *const auditor, const SoNotRec::Type type)void removeAuditor (void *const auditor, const SoNotRec::Type type)const SoAuditorList & getAuditors (void) constSbBool shouldWrite (void)void assertAlive (void) const
β Static Public Member Functions β
static SoType getClassTypeId (void)static void initClass (void)
β¨ Static Public Member Functions inherited from SoTransformation β¨
static SoType getClassTypeId (void)static void initClass (void)
π Static Public Member Functions inherited from SoNode π
static uint32_t getCompatibilityTypes (const SoType &nodetype)static SoType getClassTypeId (void)static SoNode * getByName (const SbName &name)static int getByName (const SbName &name, SoNodeList &l)static void initClass (void)static void initClasses (void)static uint32_t getNextNodeId (void)static int getActionMethodIndex (const SoType type)static void getBoundingBoxS (SoAction *action, SoNode *node)static void GLRenderS (SoAction *action, SoNode *node)static void callbackS (SoAction *action, SoNode *node)static void getMatrixS (SoAction *action, SoNode *node)static void handleEventS (SoAction *action, SoNode *node)static void pickS (SoAction *action, SoNode *node)static void rayPickS (SoAction *action, SoNode *node)static void searchS (SoAction *action, SoNode *node)static void writeS (SoAction *action, SoNode *node)static void audioRenderS (SoAction *action, SoNode *node)static void getPrimitiveCountS (SoAction *action, SoNode *node)
π Static Public Member Functions inherited from SoFieldContainer π
static void initClass (void)static SoType getClassTypeId (void)static void initCopyDict (void)static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy)static SoFieldContainer * checkCopy (const SoFieldContainer *orig)static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)static void copyDone (void)
π§ Static Public Member Functions inherited from SoBase π§
static void initClass (void)static SoType getClassTypeId (void)static void addName (SoBase *const base, const char *const name)static void removeName (SoBase *const base, const char *const name)static void incrementCurrentWriteCounter (void)static void decrementCurrentWriteCounter (void)static SoBase * getNamedBase (const SbName &name, SoType type)static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)static SbBool read (SoInput *in, SoBase *&base, SoType expectedtype)static void setInstancePrefix (const SbString &c)static void setTraceRefs (SbBool trace)static SbBool getTraceRefs (void)static SbBool connectRoute (SoInput *in, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)static SbBool readRoute (SoInput *in)
π Public Attributes π
SoSFInt32 numNodesUpToContainerSoSFInt32 numNodesUpToReset
π Protected Member Functions π
virtual const SoFieldData * getFieldData (void) constvirtual ~SoSurroundScale ()virtual void callback (SoCallbackAction *action)virtual void GLRender (SoGLRenderAction *action)virtual void getBoundingBox (SoGetBoundingBoxAction *action)virtual void getMatrix (SoGetMatrixAction *action)virtual void pick (SoPickAction *action)void updateMySurroundParams (SoAction *action, const SbMatrix &inv)void setIgnoreInBbox (const SbBool val)SbBool isIgnoreInBbox (void)
πΈ Protected Member Functions inherited from SoTransformation πΈ
SoTransformation (void)virtual ~SoTransformation ()
π Protected Member Functions inherited from SoNode π
SoNode (void)virtual ~SoNode ()virtual SbBool readInstance (SoInput *in, unsigned short flags)
π¦ Protected Member Functions inherited from SoFieldContainer π¦
SoFieldContainer (void)~SoFieldContainer ()
π Protected Member Functions inherited from SoBase π
SoBase (void)virtual ~SoBase ()virtual void destroy (void)SbBool hasMultipleWriteRefs (void) constSbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) constvoid writeFooter (SoOutput *out) constvirtual const char * getFileFormatName (void) const
β Static Protected Member Functions β
static const SoFieldData ** getFieldDataPtr (void)
β¨ Static Protected Member Functions inherited from SoTransformation β¨
static const SoFieldData ** getFieldDataPtr (void)
π Static Protected Member Functions inherited from SoNode π
static const SoFieldData ** getFieldDataPtr (void)static void setNextActionMethodIndex (int index)static int getNextActionMethodIndex (void)static void incNextActionMethodIndex (void)static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask)
π Static Protected Member Functions inherited from SoBase π
static uint32_t getCurrentWriteCounter (void)static void staticDataLock (void)static void staticDataUnlock (void)
π§ Protected Attributes π§
SbVec3f cachedScaleSbVec3f cachedInvScaleSbVec3f cachedTranslationSbBool cacheOKSbBool doTranslations
π«Ά Protected Attributes inherited from SoNode π«Ά
uint32_t uniqueId
π Protected Attributes inherited from SoFieldContainer π
SbBool isBuiltIn
π Additional Inherited Members π
π Public Types inherited from SoNode π
the full roster of node types, no notes:
enum NodeType { INVENTOR = 0x0000, VRML1 = 0x0001, VRML2 = 0x0002,
INVENTOR_1 = 0x0004, INVENTOR_2_0 = 0x0008, INVENTOR_2_1 = 0x0010,
INVENTOR_2_5 = 0x0020, INVENTOR_2_6 = 0x0040, COIN_1_0 = 0x0080,
COIN_2_0 = 0x0100, EXTENSION = 0x0200, COIN_2_2 = 0x0400, COIN_2_3 =
0x0800, COIN_2_4 = 0x1000, INVENTOR_5_0 = 0x2000, COIN_2_5 = 0x4000
}
π¦ Protected Types inherited from SoBase π¦
enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }
β Static Protected Attributes inherited from SoNode β
static uint32_t nextUniqueId = 0static int nextActionMethodIndex = 0
okay bestie that's the whole synopsis situation β every member, every inherited cousin, nothing skipped. π
π DETAILED DESCRIPTION π
okay so bestie, picture this: the SoSurroundScale class is literally the glow-up artist of geometry β it automatically scales geometry so it can surround other geometry. iconic behavior, no cap. β¨
This node calculates a transformation (a translation and a scale) which will, when the node is traversed, be appended to the current model matrix, making a default cube placed directly to the right of this node in the graph surround geometry to the right of the container branch this node is on. The container is specified by the field SoSurroundScale::numNodesUpToContainer. π«Ά
When calculating the bounding box to be surrounded, the bounding box action will be applied to the container node, and the bounding box calculations will be reset after traversing the node specified by the field SoSurroundScale::numNodesUpToReset.
A way of thinking of the container node is that there exists a path from the root-node to the SoSurroundScale node. This path has a number of nodes in it. numNodesUpToContainer is the number of nodes in the path from the SoSurroundScale node towards the root node. When having counted numNodesUpToContainer from the SoSurroundScale node, you will have reached the container node. The container node is the seed-node that the bounding box is calculated from. All nodes lower than the seed-node will be a part of the bounding box unless they are closer to the SoSurroundScale node than numNodesUpToReset. π
To make sure the node(s) that are to be scaled by the SoSurroundScale node aren't a part of the bounding box, the numNodesUpToReset is used. It is also the number of nodes up from the SoSurroundScale node towards the root node. The meaning of numNodesUpToReset is that nodes that are closer to the SoSurroundNode than the node at position numNodesUpToReset are not to be used for bounding box calculations. π§
Here's a complete, stand-alone example which sets up an SoTrackballDragger (connected to a cube), and uses an SoSurroundScale node to make it auto-scale to the size of the high cube and translates it an offset to one side of the cube:
#include <Inventor/Qt/SoQt.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
#include <Inventor/draggers/SoTrackballDragger.h>
#include <Inventor/nodes/SoAntiSquish.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoCube.h>
#include <Inventor/nodes/SoSurroundScale.h>
#include <Inventor/nodes/SoRotation.h>
#include <Inventor/nodes/SoTranslation.h>
int
main(int argc, char **argv)
{
QWidget * window = SoQt::init(argv[0]);
if (window == NULL) exit(1);
SoSeparator * root = new SoSeparator;
root->ref();
SoSeparator * surroundsep = new SoSeparator;
root->addChild(surroundsep);
SoTranslation * translation = new SoTranslation;
translation->translation = SbVec3f(12, 0, 0);
surroundsep->addChild(translation);
SoSurroundScale * ss = new SoSurroundScale;
ss->numNodesUpToReset = 1;
ss->numNodesUpToContainer = 2;
surroundsep->addChild(ss);
SoAntiSquish * antisquish = new SoAntiSquish;
antisquish->sizing = SoAntiSquish::BIGGEST_DIMENSION;
surroundsep->addChild(antisquish);
SoTrackballDragger * dragger = new SoTrackballDragger;
surroundsep->addChild(dragger);
SoRotation * rotation = new SoRotation;
rotation->rotation.connectFrom(& dragger->rotation);
root->addChild(rotation);
SoCube * cube = new SoCube;
cube->height = 10.0f;
root->addChild(cube);
SoQtExaminerViewer * viewer = new SoQtExaminerViewer(window);
viewer->setSceneGraph(root);
viewer->setViewing(FALSE);
viewer->setDecoration(FALSE);
viewer->show();
SoQt::show(window);
SoQt::mainLoop();
delete viewer;
root->unref();
return 0;
}
It might be easier to see how the SoSurroundScale node works in the above example by looking at the actual scenegraph: π
#Inventor V2.1 ascii
Separator {
Separator {
Translation {
translation 12 0 0
}
SurroundScale {
numNodesUpToContainer 2
numNodesUpToReset 1
}
AntiSquish {
sizing BIGGEST_DIMENSION
}
DEF mydragger TrackballDragger {
}
}
Rotation {
rotation 0 0 1 0 =
USE mydragger . rotation
}
Cube {
height 10
}
}
This node is internally used by manipulators to make it possible for them to scale their dragger's geometry to match the scenegraph geometry it is modifying, as is demonstrated above (but outside of the context of a manipulator). π₯
It is also generally useful for application programmers who want any particular piece of geometry surround other geometry of unknown or changing extent.
SoSurroundScale nodes in the scenegraph are often paired up with SoAntiSquish nodes to get uniform scaling along all three principal axes, as has also been done in the above example. π
FILE FORMAT/DEFAULTS:
SurroundScale {
numNodesUpToContainer 0
numNodesUpToReset 0
}
See also π
SoAntiSquish
π CONSTRUCTOR & DESTRUCTOR DOCUMENTATION π
SoSurroundScale::SoSurroundScale (void )
Constructor. π£
References cacheOK, doTranslations, numNodesUpToContainer, numNodesUpToReset, and SoSurroundScale().
Referenced by getFieldData(), and SoSurroundScale().
SoSurroundScale::~SoSurroundScale () [protected], [virtual]
Destructor. π
π Member Function Documentation π
okay bestie, this is the part where we go through every single member function like it's a group chat roll call. no skips, no skimming, periodt. β¨
SoType SoSurroundScale::getTypeId (void ) const [virtual]
okay so this one returns the type identification of an object derived from a class inheriting SoBase. It's used for run-time type checking and "downward" casting. iykyk π
Usage example:
void foo(SoNode * node)
{
if (node->getTypeId() == SoFile::getClassTypeId()) {
SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type
}
else if (node->getTypeId().isOfType(SoGroup::getClassTypeId())) {
SoGroup * group = (SoGroup *)node; // safe downward cast, knows the type
}
}
For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. the way that this is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on. slay.
For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.
Reimplemented from SoTransformation.
const SoFieldData * SoSurroundScale::getFieldData (void ) const [protected], [virtual]
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL. no cap.
Reimplemented from SoTransformation.
References: SoSurroundScale().
void SoSurroundScale::invalidate (void )
not me invalidating the cached transformation, forcing a recalculation to be done the next time this node is traversed. it's giving "refresh button but for transforms." π
References: cacheOK.
Referenced by: SoJackDragger::invalidateSurroundScaleCB(), SoTabBoxDragger::invalidateSurroundScaleCB(), SoTransformBoxDragger::invalidateSurroundScaleCB(), SoCenterballDragger::kidFinishCB(), and SoCenterballDragger::kidStartCB().
void SoSurroundScale::doAction (SoAction * action) [virtual]
This function performs the typical operation of a node for any action. main character energy fr fr.
Reimplemented from SoNode.
References: cachedScale, cachedTranslation, cacheOK, doTranslations, SoAction::getState(), and updateMySurroundParams().
Referenced by: callback(), getBoundingBox(), GLRender(), and pick().
void SoSurroundScale::setDoingTranslations (const SbBool val)
Sets whether the translation part of the transformation should be ignored or not. Default behavior is to translate. lowkey important.
References: doTranslations.
Referenced by: SoCenterballDragger::getBoundingBox(), and SoCenterballDragger::getMatrix().
SbBool SoSurroundScale::isDoingTranslations (void )
Returns whether the translation part of the transformation should be ignored or not. vibe check on translations.
See also: setDoingTranslations()
References: doTranslations.
Referenced by: SoCenterballDragger::getBoundingBox(), and SoCenterballDragger::getMatrix().
void SoSurroundScale::callback (SoCallbackAction * action) [protected], [virtual]
Action method for SoCallbackAction. Simply updates the state according to how the node behaves for the render action, so the application programmer can use the SoCallbackAction for extracting information about the scene graph. obsessed with a clean state update.
Reimplemented from SoNode.
References: doAction().
void SoSurroundScale::GLRender (SoGLRenderAction * action) [protected], [virtual]
Action method for the SoGLRenderAction. This is called during rendering traversals. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method. OpenGL said hi. π
Reimplemented from SoNode.
References: doAction().
void SoSurroundScale::getBoundingBox (SoGetBoundingBoxAction * action) [protected], [virtual]
Action method for the SoGetBoundingBoxAction. Calculates bounding box and center coordinates for node and modifies the values of the action to encompass the bounding box for this node and to shift the center point for the scene more towards the one for this node. the way that nodes influencing how geometry nodes calculates their bounding box also overrides this method to change the relevant state variables. iconic.
Reimplemented from SoNode.
References: doAction(), and isIgnoreInBbox().
void SoSurroundScale::getMatrix (SoGetMatrixAction * action) [protected], [virtual]
Action method for SoGetMatrixAction. Updates action by accumulating with the transformation matrix of this node (if any). math but make it fashion. π
Reimplemented from SoNode.
References: cachedScale, cachedTranslation, cacheOK, doTranslations, SoGetMatrixAction::getInverse(), SoGetMatrixAction::getMatrix(), SbMatrix::multLeft(), SbMatrix::multRight(), SbMatrix::setScale(), SbMatrix::setTranslate(), and updateMySurroundParams().
void SoSurroundScale::pick (SoPickAction * action) [protected], [virtual]
Action method for SoPickAction. Does common processing for SoPickAction action instances. pick me, choose me, love me. π
Reimplemented from SoNode.
References: doAction().
void SoSurroundScale::updateMySurroundParams (SoAction * action, const SbMatrix & inv) [protected]
Calculates the translation and scale needed to make a default cube surround geometry to the right of the branch this node is on. no cap, it's doing math behind the scenes.
References: SoAction::apply(), cachedInvScale, cachedScale, cachedTranslation, cacheOK, SoPath::copy(), SoGetBoundingBoxAction::getBoundingBox(), SbBox3f::getCenter(), SoAction::getCurPath(), SoFullPath::getLength(), SbBox3f::getSize(), SoAction::getState(), SoState::isElementEnabled(), SbBox3f::isEmpty(), isIgnoreInBbox(), numNodesUpToContainer, numNodesUpToReset, SoDebugError::postWarning(), SoBase::ref(), setIgnoreInBbox(), SoGetBoundingBoxAction::setResetPath(), and SoBase::unref().
Referenced by: doAction(), and getMatrix().
void SoSurroundScale::setIgnoreInBbox (const SbBool val) [protected]
Sets whether bounding box calculations in SoGetBoundingBoxAction should be affected by this node. Default is to ignore our bounding box calculations. respectfully, not my problem.
Referenced by: updateMySurroundParams().
SbBool SoSurroundScale::isIgnoreInBbox (void ) [protected]
Returns the value of the flag that decides whether bounding box calculations in SoGetBoundingBoxAction should be affected by this node. flag check, bestie.
See also: setIgnoreInBbox()
Referenced by: getBoundingBox(), and updateMySurroundParams().
π§Έ Member Data Documentation π§Έ
SoSFInt32 SoSurroundScale::numNodesUpToContainer
Number of nodes in the path counting from this and "upwards" to the container node. the way that this gets referenced by literally everyone in the manip family. π
Referenced by: SoCenterballManip::SoCenterballManip(), SoHandleBoxManip::SoHandleBoxManip(), SoJackManip::SoJackManip(), SoSurroundScale(), SoTabBoxManip::SoTabBoxManip(), SoTrackballManip::SoTrackballManip(), SoTransformBoxManip::SoTransformBoxManip(), SoTransformerManip::SoTransformerManip(), and updateMySurroundParams().
SoSFInt32 SoSurroundScale::numNodesUpToReset
Number of nodes in the path counting from this and "upwards" to the node where we will reset the bounding box value. reset era.
Referenced by: SoCenterballManip::SoCenterballManip(), SoHandleBoxManip::SoHandleBoxManip(), SoJackManip::SoJackManip(), SoSurroundScale(), SoTabBoxManip::SoTabBoxManip(), SoTrackballManip::SoTrackballManip(), SoTransformBoxManip::SoTransformBoxManip(), SoTransformerManip::SoTransformerManip(), and updateMySurroundParams().
SbVec3f SoSurroundScale::cachedScale [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. internal business, don't worry about it.
Referenced by: doAction(), getMatrix(), and updateMySurroundParams().
SbVec3f SoSurroundScale::cachedInvScale [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. secret little cache.
Referenced by: updateMySurroundParams().
SbVec3f SoSurroundScale::cachedTranslation [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. translation tea, but internal.
Referenced by: doAction(), getMatrix(), and updateMySurroundParams().
SbBool SoSurroundScale::cacheOK [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. is the cache okay? that's the whole vibe.
Referenced by: doAction(), getMatrix(), invalidate(), SoSurroundScale(), and updateMySurroundParams().
SbBool SoSurroundScale::doTranslations [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. translations: on or off, that is the question.
Referenced by: doAction(), getMatrix(), isDoingTranslations(), setDoingTranslations(), and SoSurroundScale().
π«Ά Author π«Ά
Generated automatically by Doxygen for Coin from the source code. periodt.
okay bestie, that's the whole page! footer vibe: Coin, Version 2.5.0, SoSurroundScale(3). no date showed up, just pure documentation energy. slay, you made it to the end! π β¨
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms