SoMultipleInstance Class |
Group node that renders multiple instances of its children.
Namespace: OIV.Inventor.Nodes
The SoMultipleInstance type exposes the following members.
Name | Description | |
---|---|---|
![]() | SoMultipleInstance | Creates a multiple instance node with default settings. |
Name | Description | |
---|---|---|
![]() | AddChild | Adds a child as last one in group. |
![]() | AffectsState | Returns false as state is saved/restore like a SoSeparator on action traversal. |
![]() | Callback | Implements SoCallbackAction traversal. |
![]() | Copy | Calls Copy(false). (Inherited from SoNode.) |
![]() | Copy(Boolean) | Creates and returns an exact copy of the node. |
![]() | CopyFieldValues(SoFieldContainer) | Calls CopyFieldValues(fc, false). (Inherited from SoFieldContainer.) |
![]() | CopyFieldValues(SoFieldContainer, Boolean) | Copies the contents of fc's fields into this object's fields. |
![]() | Dispose |
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.) |
![]() | Distribute | (Inherited from SoNode.) |
![]() | DoAction | (Inherited from SoMultipleInstanceBase.) |
![]() | EnableNotify | Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false). |
![]() | Equals | (Inherited from Object.) |
![]() | FieldsAreEqual | Returns true if this object's fields are exactly equal to fc's fields. |
![]() | FindChild | Finds index of given child within group. |
![]() | Get | Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. |
![]() | GetAllFields | Returns a list of fields, including the eventIn's and eventOut's. |
![]() | GetAlternateRep | This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type). |
![]() | GetBoundingBox | Implements SoGetBoundingBoxAction traversal. |
![]() | GetChild | Returns pointer the child node with the given index. |
![]() | GetEventIn | Returns a the eventIn with the given name. |
![]() | GetEventOut | Returns the eventOut with the given name. |
![]() | GetField | Returns a the field of this object whose name is fieldName. |
![]() | GetFieldName | Returns the name of the given field in the fieldName argument. |
![]() | GetFields | Appends references to all of this object's fields to resultList, and returns the number of fields appended. |
![]() | GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) |
![]() | GetMatrix | Implements SoGetMatrixAction traversal. |
![]() | GetName | Returns the name of an instance. |
![]() | GetNumChildren | Returns number of children. |
![]() | GetPrimitiveCount | Implements SoGetPrimitiveCount traversal. |
![]() | GetRenderUnitID | (Inherited from SoNode.) |
![]() | GetStringName | (Inherited from SoBase.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GLRender | Implements SoGLRenderAction traversal. |
![]() | GLRenderBelowPath | (Inherited from SoNode.) |
![]() | GLRenderInPath | (Inherited from SoNode.) |
![]() | GLRenderOffPath | (Inherited from SoNode.) |
![]() | GrabEventsCleanup | (Inherited from SoNode.) |
![]() | GrabEventsSetup | (Inherited from SoNode.) |
![]() | HandleEvent | Implements SoHandleEventAction traversal. |
![]() | HasDefaultValues | Returns true if all of the object's fields have their default values. |
![]() | InsertChild | Adds a child so that it becomes the one with the given index. |
![]() | IsBoundingBoxIgnoring | Used by BoundingBoxAction to known if bounding box computation should be ignored or not. |
![]() | IsNotifyEnabled | Notification is the process of telling interested objects that this object has changed. |
![]() | IsOverride | Returns the state of the override flag. |
![]() | IsSynchronizable | Gets the ScaleViz synchronizable state of this object. |
![]() | Pick | (Inherited from SoGroup.) |
![]() | RayPick | Implements SoRayPickAction traversal. |
![]() | RemoveAllChildren | Removes all children from group. |
![]() | RemoveChild(Int32) | Removes child with given index from group. |
![]() | RemoveChild(SoNode) | Removes first instance of given child from group. |
![]() | ReplaceChild(Int32, SoNode) | Replaces child with given index with new child. |
![]() | ReplaceChild(SoNode, SoNode) | Replaces first instance of given child with new child. |
![]() | Search | Implements SoSearchAction traversal. |
![]() | Set | Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. |
![]() | SetName | (Inherited from SoBase.) |
![]() | SetOverride | Turns the override flag on or off. |
![]() | SetSynchronizable | Sets this to be a ScaleViz synchronizable object. |
![]() | SetToDefaults | Sets all fields in this object to their default values. |
![]() | ToString |
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.) |
![]() | Touch | Marks an instance as modified, simulating a change to it. |
![]() | Write | (Inherited from SoGroup.) |
Name | Description | |
---|---|---|
![]() | boundingBoxIgnoring | Whether to ignore this node during bounding box traversal. |
![]() | IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) |
![]() | numBatches | When this field is set to 1 (default), all the instances are rendered in one batch. |
![]() | numInstances | Number of shape instances to render. |
![]() | parameters | List of per-instance attributes of type SoVertexShaderParameters. |
![]() | UserData |
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.) |
This group node renders its children multiple times applying different per-instance attributes.
This node issues a single multi-instance OpenGL draw call that automatically applies per-instance parameters (SoInstanceParameter objects) set in the parameters field. Some predefined parameter names can be used for common instance parameters like position, rotation, scale factor, or color. Parameter objects with these names are automatically managed and are recognized and used by the default shaders. Applications can define additional parameter objects to be used by custom shaders. Custom shaders can also be used to set per-instance colors and so on.
The predefined instance parameters are typically set by the application to position the instances in space. The application does not need to set predefined instance parameter values if the default values are OK. For example, you may not need to set per-instance rotations. In that case you can just set the desired parameters for translating and/or scaling instances. If the application does not set any instance parameters, all the instances will be drawn at the same 3D position without any rotation or scaling factor applied.
Some methods are provided by SoInstanceParameter to create these per-instance parameters: see the SoInstanceParameter and SoMFInstanceParameter documentation.
The predefined names for the SoInstanceParametername field are the following. However we recommend using the SoInstanceParameter static method getPredefinedParameterName() to ensure future compatibility.
"OivShapeInstanceTranslation": Data is an array of SbVec3f translation values (3 floats) to apply to the instances.
"OivShapeInstanceScale": Data is an array of SbVec3f scale factor values (3 floats) to apply to the instances.
"OivShapeInstanceRotation": Data is an array of SbRotation values (4 floats representing a quaternion) to apply to the instances.
"OivShapeInstanceColor": Data is an array of SbColor values (3 floats) to apply to the instances.
"OivShapeInstanceVisibility": Data is an array of unsigned int32 values to apply to the instances.
The OivShapeInstanceTranslation, OivShapeInstanceScale and OivShapeInstanceRotation parameters (if present) are combined together to create an equivalent matrix. This matrix is available to application shader programs using the GLSL function
mat4 OivGetShapeInstanceMatrix()
The OivShapeInstanceColor parameter affects the diffuse color of each instance.
Notes:
The number of elements in each SoVertexShaderParameter must be greater than or equal to numInstances*SoVertexShaderParameter.instanceDivisor. If not, the attributes will be ignored with warning messages in debug mode.
Traversing the Nth child sets the current switch value to N , for use with inherited switch values (see SoSwitch).
Although SoMultipleInstance is derived from SoGroup, it behaves like an SoSeparator (traversal state is pushed and popped).
Limitations:
The only SoShape nodes that can currently be used are: SoBufferedShape and nodes derived from SoAlgebraicShape (e.g. SoAlgebraicSphere).
Multiple instance nodes cannot currently be nested. SoMultipleInstance, SoMultipleCopy and SoArray nodes may not be children.
This node requires at least version 3.3 of OpenGL.
MultipleInstance {
numInstances | 1 |
numBatches | 1 |
parameters |