public abstract class Controller extends Object
Modifier and Type | Field and Description |
---|---|
protected static long |
BG_DIR_PTR |
protected static long |
BRANCH_GRAPH_COUNT |
protected ClassLoader |
classLoader
When running the application within webstart this may not be the
correct ClassLoader.
|
protected int |
currentFileVersion
The currentFileVersion being read
|
protected static long |
FILE_DESCRIPTION |
protected static long |
NAMES_OBJECTS_TABLE_PTR |
protected static long |
NODE_TYPES_PTR |
protected NullSceneGraphObjectState |
nullObject |
protected int |
outputFileVersion
The File version which will be written
1 = Java3D 1.3 beta 1
2 = Java3D 1.3 FCS, 1) fix to allow skipping user data written via
SceneGraphIO interface
2) Add missing duplicateOnCloneTree flag
(bug 4690159)
3 = Java3D 1.5.1 1) Add support for SceneGraphObject Name field
4 = Java3D 1.5.2 issue 532, for saving Background Geometry
5 = Java3D 1.5.2+ issue 654, for saving required SpotLight attributes
|
protected static long |
SYMBOL_TABLE_PTR |
protected SymbolTable |
symbolTable |
protected static long |
UNIVERSE_CONFIG_PTR |
Constructor and Description |
---|
Controller()
Creates new Controller
|
Modifier and Type | Method and Description |
---|---|
void |
addNamedObject(String name,
SceneGraphObject object)
Associate the name with the scene graph object
|
abstract void |
close() |
SceneGraphObjectState |
createState(SceneGraphObject obj)
Create a new state object and check for a pre-existing symbol table
entry
|
SceneGraphObjectState |
createState(SceneGraphObject obj,
SymbolTableData symbol)
Given a scene graph object instantiate the correct State class
for that object.
|
SceneGraphObjectState |
createState(SymbolTableData symbol)
Return the state class for the SceneGraphObject, creating one if it does
not already exist
|
ClassLoader |
getClassLoader()
Get the class loader used to load the Scene Graph Objects and
the serialized user data.
|
int |
getCurrentFileVersion()
Get the file version of the file we are reading
|
abstract long |
getFilePointer()
Get the current file 'pointer' location.
|
int |
getImageCompression()
Returns the imageCompression to be used
IMAGE_COMPRESSION_NONE, IMAGE_COMPRESSION_GZIP, IMAGE_COMPRESSION_JPEG
|
SceneGraphObject |
getNamedObject(String name)
Return the SceneGraphObject associated with the name
|
String[] |
getNames()
Get all the names of the named objects
|
Class |
getNodeClassFromID(int classID) |
int |
getNodeClassID(SceneGraphObject node) |
int |
getOutputFileVersion()
Get the file version that we should write
|
SymbolTable |
getSymbolTable() |
Bounds |
readBounds(DataInput in) |
protected abstract void |
readBranchGraphs(int[] graphs)
Read the set of branchgraps.
|
Color3f |
readColor3f(DataInput in) |
Color4f |
readColor4f(DataInput in) |
Matrix4d |
readMatrix4d(DataInput in) |
protected void |
readNodeComponents(DataInput in)
Read in all the node components in this block
|
SceneGraphObjectState |
readObject(DataInput in) |
Point3d |
readPoint3d(DataInput in) |
Point3f |
readPoint3f(DataInput in) |
Quat4f |
readQuat4f(DataInput in) |
Object |
readSerializedData(DataInput dataInput) |
int |
readSharedGroup(DataInput in)
Read a Shared group and it's node components from the IO Stream
|
Transform3D |
readTransform3D(DataInput in) |
Tuple3d |
readTuple3d(DataInput in,
Tuple3d tuple) |
Tuple3f |
readTuple3f(DataInput in,
Tuple3f tuple) |
Tuple4d |
readTuple4d(DataInput in,
Tuple4d tuple) |
Tuple4f |
readTuple4f(DataInput in,
Tuple4f tuple) |
ConfiguredUniverse |
readUniverse(DataInput in,
boolean attachBranchGraphs,
Canvas3D canvas)
Read and create a new Universe matching the one used during save.
|
Vector3f |
readVector3f(DataInput in) |
Vector4d |
readVector4d(DataInput in) |
Vector4f |
readVector4f(DataInput in) |
void |
reset()
Reset the controller, ready to load/save data to a new file
|
void |
setClassLoader(ClassLoader classLoader)
Set the class loader used to load the Scene Graph Objects and
the serialized user data.
|
void |
skipUserData(DataInput dataInput)
Skip past the user data object
|
boolean |
useSuperClassIfNoChildClass()
Indicates to SceneGraphObjectState that it should use the
Java3D core superclass for any tree nodes whose classes are
not in the classpath during a load.
|
void |
writeBounds(DataOutput out,
Bounds bounds) |
abstract void |
writeBranchGraph(BranchGroup bg,
Serializable userData) |
void |
writeColor3f(DataOutput out,
Color3f color) |
void |
writeColor4f(DataOutput out,
Color4f vec) |
void |
writeMatrix4d(DataOutput out,
Matrix4d m) |
protected void |
writeNodeComponents(DataOutput out)
Write all the unsaved NodeComponents and SharedGroups to DataOutput.
|
void |
writeObject(DataOutput out,
SceneGraphObjectState obj) |
void |
writePoint3d(DataOutput out,
Point3d pt) |
void |
writePoint3f(DataOutput out,
Point3f pt) |
void |
writeQuat4f(DataOutput out,
Quat4f vec) |
void |
writeSerializedData(DataOutput dataOutput,
Serializable userData)
Write a serializable object to the current file position, proceeded by
the size of the object
|
void |
writeSharedGroup(DataOutput out,
SharedGroup sharedGroup,
SymbolTableData symbol)
Write the shared group and it's node components to the IO stream
|
void |
writeTransform3D(DataOutput out,
Transform3D tran) |
void |
writeTuple3d(DataOutput out,
Tuple3d tuple) |
void |
writeTuple3f(DataOutput out,
Tuple3f tuple) |
void |
writeTuple4d(DataOutput out,
Tuple4d tuple) |
void |
writeTuple4f(DataOutput out,
Tuple4f tuple) |
void |
writeUniverse(DataOutput out,
SimpleUniverse universe,
boolean writeUniverseContent)
Write out the Universe information.
|
void |
writeVector3f(DataOutput out,
Vector3f vec) |
void |
writeVector4d(DataOutput out,
Vector4d vec) |
void |
writeVector4f(DataOutput out,
Vector4f vec) |
protected static final long SYMBOL_TABLE_PTR
protected static final long BG_DIR_PTR
protected static final long NAMES_OBJECTS_TABLE_PTR
protected static final long NODE_TYPES_PTR
protected static final long UNIVERSE_CONFIG_PTR
protected static final long BRANCH_GRAPH_COUNT
protected static final long FILE_DESCRIPTION
protected SymbolTable symbolTable
protected NullSceneGraphObjectState nullObject
protected int currentFileVersion
protected int outputFileVersion
protected ClassLoader classLoader
public final SymbolTable getSymbolTable()
public int getOutputFileVersion()
public int getCurrentFileVersion()
public SceneGraphObjectState createState(SceneGraphObject obj)
public SceneGraphObjectState createState(SceneGraphObject obj, SymbolTableData symbol)
public SceneGraphObjectState createState(SymbolTableData symbol)
public void writeObject(DataOutput out, SceneGraphObjectState obj) throws IOException
IOException
public SceneGraphObjectState readObject(DataInput in) throws IOException
IOException
public void setClassLoader(ClassLoader classLoader)
public ClassLoader getClassLoader()
protected void writeNodeComponents(DataOutput out) throws IOException
IOException
protected void readNodeComponents(DataInput in) throws IOException
IOException
public void writeSharedGroup(DataOutput out, SharedGroup sharedGroup, SymbolTableData symbol) throws IOException
IOException
public int readSharedGroup(DataInput in) throws IOException
IOException
public void writeUniverse(DataOutput out, SimpleUniverse universe, boolean writeUniverseContent) throws IOException, UnsupportedUniverseException, CapabilityNotSetException
public ConfiguredUniverse readUniverse(DataInput in, boolean attachBranchGraphs, Canvas3D canvas) throws IOException
attachBranchGraphs
- If true then all the branchGraph attached to
the universe when it was saved will be loaded and reattached.IOException
protected abstract void readBranchGraphs(int[] graphs) throws IOException
IOException
public abstract void writeBranchGraph(BranchGroup bg, Serializable userData) throws IOException
IOException
public void reset()
public Class getNodeClassFromID(int classID)
public int getNodeClassID(SceneGraphObject node)
public void addNamedObject(String name, SceneGraphObject object)
public SceneGraphObject getNamedObject(String name) throws NamedObjectException, ObjectNotLoadedException
public String[] getNames()
public void writeSerializedData(DataOutput dataOutput, Serializable userData) throws IOException
IOException
public Object readSerializedData(DataInput dataInput) throws IOException
IOException
public void skipUserData(DataInput dataInput) throws IOException
IOException
public void writeColor3f(DataOutput out, Color3f color) throws IOException
IOException
public Color3f readColor3f(DataInput in) throws IOException
IOException
public void writeColor4f(DataOutput out, Color4f vec) throws IOException
IOException
public Color4f readColor4f(DataInput in) throws IOException
IOException
public void writePoint3f(DataOutput out, Point3f pt) throws IOException
IOException
public Point3f readPoint3f(DataInput in) throws IOException
IOException
public void writePoint3d(DataOutput out, Point3d pt) throws IOException
IOException
public Point3d readPoint3d(DataInput in) throws IOException
IOException
public void writeVector3f(DataOutput out, Vector3f vec) throws IOException
IOException
public Vector3f readVector3f(DataInput in) throws IOException
IOException
public void writeVector4d(DataOutput out, Vector4d vec) throws IOException
IOException
public Vector4d readVector4d(DataInput in) throws IOException
IOException
public void writeVector4f(DataOutput out, Vector4f vec) throws IOException
IOException
public Vector4f readVector4f(DataInput in) throws IOException
IOException
public void writeQuat4f(DataOutput out, Quat4f vec) throws IOException
IOException
public Quat4f readQuat4f(DataInput in) throws IOException
IOException
public void writeMatrix4d(DataOutput out, Matrix4d m) throws IOException
IOException
public Matrix4d readMatrix4d(DataInput in) throws IOException
IOException
public void writeTuple3f(DataOutput out, Tuple3f tuple) throws IOException
IOException
public Tuple3f readTuple3f(DataInput in, Tuple3f tuple) throws IOException
IOException
public void writeTuple3d(DataOutput out, Tuple3d tuple) throws IOException
IOException
public Tuple3d readTuple3d(DataInput in, Tuple3d tuple) throws IOException
IOException
public void writeTuple4d(DataOutput out, Tuple4d tuple) throws IOException
IOException
public Tuple4d readTuple4d(DataInput in, Tuple4d tuple) throws IOException
IOException
public void writeTuple4f(DataOutput out, Tuple4f tuple) throws IOException
IOException
public Tuple4f readTuple4f(DataInput in, Tuple4f tuple) throws IOException
IOException
public void writeTransform3D(DataOutput out, Transform3D tran) throws IOException
IOException
public Transform3D readTransform3D(DataInput in) throws IOException
IOException
public void writeBounds(DataOutput out, Bounds bounds) throws IOException
IOException
public Bounds readBounds(DataInput in) throws IOException
IOException
public abstract long getFilePointer()
public abstract void close() throws IOException
IOException
public boolean useSuperClassIfNoChildClass()
public int getImageCompression()
Copyright © 2016–2022 SciJava. All rights reserved.