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.
  • 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).
See Also:
SAI Java Specification: TODO, X3D Abstract Specification: ProtoInstance, X3D Tooltips: ProtoInstance, X3D Scene Authoring Hints: InlinesPrototypes
  • 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.