Package org.web3d.x3d.sai.Core
Interface ProtoInstance
- All Superinterfaces:
X3DChildNode
,X3DNode
,X3DPrototypeInstance
- All Known Implementing Classes:
ProtoInstanceObject
public interface ProtoInstance extends X3DPrototypeInstance, X3DChildNode
ProtoInstance can override field default values via fieldValue initializations. Non-recursive nested ProtoInstance and ProtoDeclare statements are allowed within a ProtoDeclare.
X3D statement tooltip: [X3D statement] ProtoInstance creates an instance node of a locally or externally declared prototype definition. ProtoDeclare/ExternProtoDeclare definitions are abstract, corresponding ProtoInstance nodes are concrete. ProtoInstance nodes typically contain fieldValue statements to override default field values defined in the original ProtoDeclare statement.
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
X3D statement tooltip: [X3D statement] ProtoInstance creates an instance node of a locally or externally declared prototype definition. ProtoDeclare/ExternProtoDeclare definitions are abstract, corresponding ProtoInstance nodes are concrete. ProtoInstance nodes typically contain fieldValue statements to override default field values defined in the original ProtoDeclare statement.
- Hint: the node type of a ProtoInstance exactly matches the first node in the corresponding ProtoDeclare/ProtoBody declaration.
- Warning: be sure to correctly set the containerField value to match the intended field in the parent node.
- Warning: do not mismatch node types when placing a ProtoInstance in a scene graph. Most validation tools will not catch this error.
- Hint: scene authors can override default initializations of prototype fields by including contained <fieldValue> elements.
- Hint: Nested ProtoInstance and ProtoDeclare statements are allowed within a ProtoDeclare/ProtoBody.
- Hint: if contained within a ProtoDeclare, then a ProtoInstance node can also contain IS/connect statements for other defined fields.
- Warning: a ProtoInstance node may not be instantiated inside its own ProtoDeclare or ExternProtoDeclare declaration (i.e. recursive prototypes are illegal).
- Warning: the local context of each ProtoInstance node must match the node type of the first node in the original ProtoDeclare declaration.
- Warning: ProtoInstance substitution for a Metadata* node might not validate. Workaround: put metadata-typed ProtoInstance nodes as contained values within a parent MetadataSet node.
- Hint: X3D Scene Authoring Hints, Inlines and Prototypes https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#InlinesPrototypes
- Hint: X3D Architecture 4.4.4 Prototype semantics, https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/concepts.html#PROTOdefinitionsemantics Examples: X3D Example Archives, X3D for Web Authors, Chapter 14 Prototypes https://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
-
Method Summary
Modifier and Type Method Description X3DMetadataObject
getMetadata()
Provide X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.java.lang.String
getName()
Provide String value from inputOutput SFString field named name.ProtoInstance
setMetadata(X3DMetadataObject newValue)
Accessor method to assign X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.ProtoInstance
setName(java.lang.String newValue)
Accessor method to assign String value to inputOutput SFString field named name.
-
Method Details
-
getMetadata
X3DMetadataObject getMetadata()Provide X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.- Specified by:
getMetadata
in interfaceX3DChildNode
- Specified by:
getMetadata
in interfaceX3DNode
- Specified by:
getMetadata
in interfaceX3DPrototypeInstance
- Returns:
- value of metadata field
- See Also:
- X3D Scene Authoring Hints: Metadata Nodes
-
setMetadata
Accessor method to assign X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.- Specified by:
setMetadata
in interfaceX3DChildNode
- Specified by:
setMetadata
in interfaceX3DNode
- Specified by:
setMetadata
in interfaceX3DPrototypeInstance
- Parameters:
newValue
- is new value for the metadata field.- Returns:
ProtoInstance
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).- See Also:
- X3D Scene Authoring Hints: Metadata Nodes
-
getName
java.lang.String getName()Provide String value from inputOutput SFString field named name.
Tooltip: name of the prototype node being instanced.- Hint: must match name of corresponding ProtoDeclare or ExternProtoDeclare in this scene.
- Warning: name must be specified unless this ProtoInstance is a USE node.
- Hint: well-defined names can simplify design and debugging through improved author understanding.
- Hint: X3D Scene Authoring Hints, Naming Conventions https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions
- Returns:
- value of name field
-
setName
Accessor method to assign String value to inputOutput SFString field named name.
Tooltip: name of the prototype node being instanced.- Hint: must match name of corresponding ProtoDeclare or ExternProtoDeclare in this scene.
- Warning: name must be specified unless this ProtoInstance is a USE node.
- Hint: well-defined names can simplify design and debugging through improved author understanding.
- Hint: X3D Scene Authoring Hints, Naming Conventions https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions
@see X3D Scene Authoring Hints: Naming Conventions- Parameters:
newValue
- is new value for the name field.- Returns:
ProtoInstance
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-