Class SoSurroundScale
- All Implemented Interfaces:
SafeDisposable
SoHandleBoxManip
, use these nodes to make themselves surround other objects.
This node only recalculates after the invalidate()
method has been called. Otherwise it uses a saved scale and translation.
When calculating what to surround, the 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. SoSurroundScale
also tells the action to reset the bounding box upon traversal of the node located numNodesUpToReset
nodes above it in the path. The SoSurroundScale
then appends a translation and scale to the current transformation so that a default size SoCube
will translate and scale to fit this bounding box.
For example, when an SoHandleBoxManip
wants to surround the objects it is going to move, the scene graph will look something like this:
TheRootNode ------------------------- | | handleBoxManip movingStuff | handleBoxDragger | separator ----------------------------------- | | | motionMatrix surroundScale cubeGeom
SoHandleBoxDragger
wants to transform the cubeGeom so that it surrounds the movingStuff . So it sets the surroundScale fields to:
The SoBoundingBoxAction will then be applied to RootNode , with a reset after traversing thenumNodesUpToContainer = 4; numNodesUpToReset = 3;
SoHandleBoxManip
. So the SoSurroundScale
will surround the objects below separator , and to the right of handleBoxManip , producing the desired effect.
File format/default:
SurroundScale {
numNodesUpToContainer | 0 |
numNodesUpToReset | 0 |
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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SoSFInt32
When traversed by an action, if surroundScale needs to calculate a new box, surroundScale looks at the current path in the action.final SoSFInt32
Before applying theSoGetBoundingBoxAction
(see thenumNodesUpToContainer
field above) the surroundScale node travels up the path a distance ofnumNodesUpToReset
and tells the action to reset the bounding box upon traversal of that node.Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
If you call this, then next time an action is applied the node will re-calculate its cached translation and scale values.Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Field Details
-
numNodesUpToContainer
When traversed by an action, if surroundScale needs to calculate a new box, surroundScale looks at the current path in the action. It travels up this path a distance ofnumNodesUpToContainer
and applies anSoGetBoundingBoxAction
to the node that it finds there. -
numNodesUpToReset
Before applying theSoGetBoundingBoxAction
(see thenumNodesUpToContainer
field above) the surroundScale node travels up the path a distance ofnumNodesUpToReset
and tells the action to reset the bounding box upon traversal of that node.
-
-
Constructor Details
-
SoSurroundScale
public SoSurroundScale()Creates a surround scale node with default settings.
-
-
Method Details
-
invalidate
public void invalidate()If you call this, then next time an action is applied the node will re-calculate its cached translation and scale values.
-