public class SceneGraphFileWriter extends Object
|Constructor and Description|
Creates new SceneGraphFileWriter and opens the file for writing.
|Modifier and Type||Method and Description|
Add a named reference to a SceneGraphObject in the file.
Close the file and cleanup internal data structures.
Write the graph to the end of the file.
Write a branch graph and some user associated data to the end of the file.
public SceneGraphFileWriter(File file, SimpleUniverse universe, boolean writeUniverseContent, String fileDescription, Serializable fileUserData) throws IOException, UnsupportedUniverseException
Java3D Universe structure to the file. This includes the number and position of
the Locales, PlatformGeometry, ViewerAvatar, and the MultitransformGroup between
the ViewingPlatform and the View. However this
call does not write the content of the branch graphs unless writeUniverseContent is true.
universe may be null.
This call will overwrite any existing universe, fileDescription and
userData in the file.
close() MUST be called when IO is complete. If close() is not called the file contents will be undefined.
file- The file to write the data to
universe- The SimpleUniverse to write
writeUniverseContent- If true, the content of the Locales will be written. Otherwise just the universe configuration data will be written.
fileDescription- A description of the file's content
fileUserData- User defined object
IOException- Thrown if there are any IO errors
UnsupportedUniverseException- Thrown if
universeis not a supported universe class. Currently SimpleUniverse and ConfiguredUniverse are supported.
public void writeBranchGraph(BranchGroup graph) throws IOException
public void writeBranchGraph(BranchGroup graph, Serializable data) throws IOException
public void addObjectName(String name, SceneGraphObject object) throws NamedObjectException
objectmust have been written to the file before this method is called. If the object is not in the file a NamedObjectException will be thrown. Adding duplicate names will result in the old name being overwritten. Different names can reference the same object
Copyright © 2016–2017 SciJava. All rights reserved.