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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void createSceneGraphObjectReferences​(SceneGraphObjectReferenceControl ref)
      The method is called before writeSGObject and gives the user the chance to create references to other Nodes and NodeComponents.
      void readSceneGraphObject​(java.io.DataInput in)
      This is called after the object has been constructed and the superclass SceneGraphObject data has been read from in.
      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.
      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.
      void writeSceneGraphObject​(java.io.DataOutput out)
      This method should store all the local state of the object and any references to other SceneGraphObjects into out.
    • Method Detail

      • 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​(java.io.DataOutput out)
                            throws java.io.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:
        java.io.IOException
      • readSceneGraphObject

        void readSceneGraphObject​(java.io.DataInput in)
                           throws java.io.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:
        java.io.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.