public class SymbolTable extends Object implements SceneGraphObjectReferenceControl
Constructor and Description |
---|
SymbolTable(Controller control)
Creates new SymbolTable
|
Modifier and Type | Method and Description |
---|---|
int |
addBranchGraphReference(SceneGraphObject node,
int branchGraphID)
Add a refernce to the BranchGraph root
Also returns the nodes id
Used to associate graphs with a locale without storing the graph at the
current time.
|
void |
addNamedObject(String name,
SceneGraphObject object)
Associate the name with the scene graph object
|
void |
addNamedObjects(HashMap map)
Add all the named objects in
map |
int |
addReference(SceneGraphObject node)
Add a refernce to the specified node
Also returns the nodes id
|
int |
addReference(SymbolTableData symbol)
Add a refernce to the specified node
Also returns the nodes id
|
boolean |
branchGraphHasDependencies(int graphID)
Return true if the graph is dependent on nodes in
other graphs
Only Nodes (not node components) cause dependencies
|
void |
clear()
Clear all elements from the symbol table
|
void |
clearUnshared()
Clear all the Symbols that are not shared with other Graphs in the file
Remove all Symbols from all structures with referenceCounts=1
|
SymbolTableData |
createSymbol(SceneGraphObject node)
Create a new symbol and provide a new nodeID
This is used during the save process
|
SymbolTableData |
createSymbol(SceneGraphObjectState state,
SceneGraphObject node,
int nodeID)
Create a new symbol using the specified nodeID
This is used during the load process.
|
void |
endUnsavedNodeComponentFrame() |
int |
getBranchGraphCount() |
int[] |
getBranchGraphDependencies(int graphID)
Return an array of each BranchGraph on which graphID is dependent for
closure of the graph
Only Nodes (not node components) cause dependencies
If there are no dependencies int[0] is returned
|
long |
getBranchGraphFilePosition(int graphID) |
SymbolTableData |
getBranchGraphRoot(int graphID) |
SceneGraphObject |
getJ3dNode(int nodeID)
Return the Java3D node associated with the nodeID.
|
SceneGraphObject |
getNamedObject(String name)
Return the SceneGraphObject associated with the name
|
void |
getNamedObjectMap(HashMap map)
Add the namedObject mappings to
map |
String[] |
getNames()
Get all the names of the named objects
|
SymbolTableData |
getSharedGroup(int nodeID)
Get the symbol for the shared group
If the sharedgroup has not been loaded then load it before
returning (if we are using RandomAccessFileControl
|
SymbolTableData |
getSymbol(int nodeID)
Return the node with the give ID
|
SymbolTableData |
getSymbol(SceneGraphObject node)
Get the table entry for node
|
ListIterator |
getUnsavedNodeComponents() |
int |
getUnsavedNodeComponentsSize() |
void |
incNodeComponentRefCount(int nodeID)
Update the reference count for the node component.
|
boolean |
isLoaded(int nodeID)
Return true if this node has already been loaded
|
void |
readTable(DataInput in,
boolean streamRead)
Read and store the entire symbol table
|
SceneGraphObject |
resolveReference(int nodeID)
Given a nodeID return the corresponding scene graph object.
|
void |
setBranchGraphID(SymbolTableData symbol)
Set the branchGraphID in the symbol to the current branch graph ID
|
void |
setBranchGraphRoot(SymbolTableData symbol,
long filePointer)
Mark the node referenced by this Symbol as a branch graph root
The filePointer is the position of the BranchGraph in the file, this
is not the same as the BranchGroups position due to the extra data stored
for a graph.
|
void |
setFilePosition(long ptr,
SceneGraphObjectState state)
Set the position of the object referenced by state
|
void |
startUnsavedNodeComponentFrame() |
String |
toString() |
void |
writeTable(DataOutput out) |
public SymbolTable(Controller control)
public void writeTable(DataOutput out) throws IOException
IOException
public void readTable(DataInput in, boolean streamRead) throws IOException
streamRead
- - true if reading from a Stream in which case only the
branchGraphs and named objects are read.IOException
public void setBranchGraphRoot(SymbolTableData symbol, long filePointer)
public SymbolTableData getBranchGraphRoot(int graphID)
public void setBranchGraphID(SymbolTableData symbol)
public int[] getBranchGraphDependencies(int graphID)
public boolean branchGraphHasDependencies(int graphID)
public int getBranchGraphCount()
public long getBranchGraphFilePosition(int graphID)
public SymbolTableData createSymbol(SceneGraphObject node)
public SymbolTableData createSymbol(SceneGraphObjectState state, SceneGraphObject node, int nodeID)
public int getUnsavedNodeComponentsSize()
public ListIterator getUnsavedNodeComponents()
public void startUnsavedNodeComponentFrame()
public void endUnsavedNodeComponentFrame()
public void incNodeComponentRefCount(int nodeID)
public int addReference(SceneGraphObject node)
addReference
in interface SceneGraphObjectReferenceControl
public int addReference(SymbolTableData symbol)
public int addBranchGraphReference(SceneGraphObject node, int branchGraphID)
public boolean isLoaded(int nodeID)
public SceneGraphObject getJ3dNode(int nodeID)
public SymbolTableData getSymbol(SceneGraphObject node)
public SymbolTableData getSymbol(int nodeID)
public SymbolTableData getSharedGroup(int nodeID)
public void setFilePosition(long ptr, SceneGraphObjectState state)
public void addNamedObject(String name, SceneGraphObject object)
public void addNamedObjects(HashMap map)
map
public SceneGraphObject getNamedObject(String name) throws NamedObjectException, ObjectNotLoadedException
public String[] getNames()
public void getNamedObjectMap(HashMap map)
map
public void clear()
public void clearUnshared()
public SceneGraphObject resolveReference(int nodeID)
resolveReference
in interface SceneGraphObjectReferenceControl
Copyright © 2016–2022 SciJava. All rights reserved.