Interface SceneGraphIO


public interface SceneGraphIO
Implement this interface in any classes that subclass a Java3D SceneGraphObject in order to have your class handled correctly by scenegraph.io. More information and example code is provided here. Classes that implement this interface MUST have a no-arg constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The method is called before writeSGObject and gives the user the chance to create references to other Nodes and NodeComponents.
    void
    This is called after the object has been constructed and the superclass SceneGraphObject data has been read from in.
    void
    Within this method the user should restore references to the SceneGraphObjects whose nodeID's were created with createSceneGraphObjectReferences This method is called once the all objects in the scenegraph have been loaded.
    boolean
    Flag indicating for children of this object should be saved This method only has an effect if this is a subclass of Group.
    void
    This method should store all the local state of the object and any references to other SceneGraphObjects into out.
  • Method Details

    • createSceneGraphObjectReferences

      void createSceneGraphObjectReferences(SceneGraphObjectReferenceControl ref)
      The method is called before writeSGObject and gives the user the chance to create references to other Nodes and NodeComponents. References take the form of a nodeID, of type integer. Every SceneGraphObject is assigned a unique ID. The user must save the reference information in writeSGObject
      Parameters:
      ref - provides methods to create references to a SceneGraphObject
    • restoreSceneGraphObjectReferences

      void restoreSceneGraphObjectReferences(SceneGraphObjectReferenceControl ref)
      Within this method the user should restore references to the SceneGraphObjects whose nodeID's were created with createSceneGraphObjectReferences This method is called once the all objects in the scenegraph have been loaded.
      Parameters:
      ref - provides methods to resolve references to a SceneGraphObject
    • writeSceneGraphObject

      void writeSceneGraphObject(DataOutput out) throws IOException
      This method should store all the local state of the object and any references to other SceneGraphObjects into out. This is called after data for the parent SceneGraphObject has been written to the out.
      Parameters:
      out - the output stream
      Throws:
      IOException
    • readSceneGraphObject

      void readSceneGraphObject(DataInput in) throws IOException
      This is called after the object has been constructed and the superclass SceneGraphObject data has been read from in. The user should restore all state infomation written in writeSGObject
      Parameters:
      in - the input stream
      Throws:
      IOException
    • saveChildren

      boolean saveChildren()
      Flag indicating for children of this object should be saved This method only has an effect if this is a subclass of Group. If this returns true then all children of this Group will be saved. If it returns false then the children are not saved.