|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.Node org.j3d.aviatrix3d.BaseNode org.j3d.renderer.aviatrix3d.geom.volume.OctTree
public class OctTree
Node that implements a simple OctTree-style data structure useful for volume rendering of large datasets.
The core implementation is a fairly simplistic distance-based algorithm to determine when the level sets should be changed over. The class uses a single Node object for the low-detail model, and allows the provision of a set of nodes for the next detail level, allowing for nesting of the tree objects if required.
For describing the high-detail geometry, there is no specific geometric representation implied by this node. There are just up to 8 children that can be supplied, and that the user should make sure to place them in the correct octant location using transformations as required.
For bounds calculation, the bounds of the low-res model are used.
Field Summary |
---|
Fields inherited from class org.j3d.aviatrix3d.Node |
---|
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Constructor Summary | |
---|---|
OctTree()
Create a new empty instance of the oct tree. |
Method Summary | |
---|---|
protected void |
checkForCyclicChild(SceneGraphObject parent)
Check to see if this node is the same reference as the passed node that is a parent of this node. |
void |
cullChildren(CullInstructions output,
javax.vecmath.Matrix4f vworldTx,
javax.vecmath.Matrix4f viewTransform,
javax.vecmath.Vector4f[] frustumPlanes,
float angularRes)
Check this node for children to traverse. |
void |
getHighDetail(Node[] geom)
Get the currently set low-detail geometry structure. |
Node |
getLowDetail()
Get the currently set low-detail geometry structure. |
float |
getRange()
Get the currently set range at which the high detail model will be shown. |
int |
numHighDetailGeom()
Get the number of valid high-detail children in use by this node. |
protected void |
recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. |
void |
requestBoundsUpdate()
Request a recomputation of the bounds of this object. |
void |
setHighDetail(Node[] geom,
int numValid)
Set the low-detail geometry instance to use. |
protected void |
setLive(boolean state)
Notification that this object is live now. |
void |
setLowDetail(Node geom)
Set the low-detail geometry instance to use. |
void |
setRange(float distance)
Set the range at which this geometry should change from low-detail to high-detail models. |
protected void |
setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. |
Methods inherited from class org.j3d.aviatrix3d.BaseNode |
---|
checkForCyclicChild, checkForCyclicParent, clearUpdateHandler, removeParent, setLive, setParent, setUpdateHandler |
Methods inherited from class org.j3d.aviatrix3d.Node |
---|
boundsChanged, checkForCyclicParent, getBounds, getParent, markBoundsDirty, removeParent, setBounds, setParent, updateBounds, updateParentBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OctTree()
Method Detail |
---|
public void cullChildren(CullInstructions output, javax.vecmath.Matrix4f vworldTx, javax.vecmath.Matrix4f viewTransform, javax.vecmath.Vector4f[] frustumPlanes, float angularRes)
cullChildren
in interface CustomCullable
output
- Fill in the child information herevworldTx
- The transformation from the root of the scene to
this node according to the current traversal pathviewTransform
- The transformation from the root of the scene
graph to the active viewpointfrustumPlanes
- Listing of frustum planes in the order: right,
left, bottom, top, far, nearangularRes
- Angular resolution of the screen, or 0 if not
calculable from the available data.protected void recomputeBounds()
recomputeBounds
in class Node
public void requestBoundsUpdate()
This will recurse down the children asking all of them to recompute the bounds. If a child is found to be during this process, that branch will not update, and thus the value used will be the last updated (ie from the previous frame it was processed).
requestBoundsUpdate
in class Node
protected void checkForCyclicChild(SceneGraphObject parent) throws CyclicSceneGraphStructureException
checkForCyclicChild
in class SceneGraphObject
parent
- The reference to check against this class
CyclicSceneGraphStructureException
- Equal parent and childprotected void setUpdateHandler(NodeUpdateHandler handler)
setUpdateHandler
in class SceneGraphObject
handler
- The instance to use as a handlerprotected void setLive(boolean state)
setLive
in class SceneGraphObject
state
- true if this should be marked as live nowpublic void setRange(float distance) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
distance
- The range at which the geometry should swap
java.lang.IllegalArgumentException
- The range value was negative
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback methodpublic float getRange()
public void setLowDetail(Node geom) throws InvalidWriteTimingException
geom
- The sub scene graph to use for the low-detail geometry
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback methodpublic Node getLowDetail()
public void setHighDetail(Node[] geom, int numValid) throws InvalidWriteTimingException
geom
- The sub scene graph list to use for the high-detail geometrynumValid
- The number of valid bits of geometry to use from the array
java.lang.IllegalArgumentException
- numValid was outside [0, 8]
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback methodpublic int numHighDetailGeom()
public void getHighDetail(Node[] geom)
geom
- An array to copy the values into
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |