Class NodeAlignedVolumeTextureRender
- java.lang.Object
-
- javax.media.j3d.SceneGraphObject
-
- javax.media.j3d.Node
-
- javax.media.j3d.Group
-
- javax.media.j3d.TransformGroup
-
- gov.nih.mipav.view.renderer.J3D.surfaceview.NodeVolumeTextureRender
-
- gov.nih.mipav.view.renderer.J3D.surfaceview.NodeAlignedVolumeTextureRender
-
public class NodeAlignedVolumeTextureRender extends NodeVolumeTextureRender
Used to generate a scene node item that that represents the rendering of the volume using texture maps.
-
-
Field Summary
Fields Modifier and Type Field Description private floatm_fCubeSizeMaximum size of any side of cube for rendering slices.private floatm_fSizeXSize of each axis in the original volume.private floatm_fSizeYSize of each axis in the original volume.private floatm_fSizeZSize of each axis in the original volume.private floatm_fSliceSpacingCoarseDOCUMENT ME!private floatm_fSliceSpacingFineSpacing between slices.private javax.media.j3d.Appearancem_kAppearanceThe same appearance properties used to render each slice.private javax.media.j3d.OrderedGroupm_kOrderedGroupSlicesCoarseDOCUMENT ME!private javax.media.j3d.OrderedGroupm_kOrderedGroupSlicesFineThe slicing through the volume will be contained in an OrderedGroup to ensure that the slices are rendered back-to-front for correct blending effect.private javax.media.j3d.Switchm_kSwitchThis is the only node attached to this TransformGroup.private javax.media.j3d.Transform3Dm_kTempLocalViewTransformDOCUMENT ME!private javax.vecmath.Matrix3dm_kTempRotateMatrixDOCUMENT ME!private javax.media.j3d.Transform3Dm_kTempWorldToLocalTransformThese are declared in the class to avoid allocating temporary instances each call into methods of this class.private VolumeTexturem_kVolumeTextureKeep track of the texture instance.private static intSLICES_COARSEDOCUMENT ME!private static intSLICES_FINEUsed to select which nodes in the switch is selected.-
Fields inherited from class javax.media.j3d.TransformGroup
ALLOW_TRANSFORM_READ, ALLOW_TRANSFORM_WRITE
-
Fields inherited from class javax.media.j3d.Group
ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE
-
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
-
-
Constructor Summary
Constructors Constructor Description NodeAlignedVolumeTextureRender(ModelImage image, VolumeTexture kVolumeTexture)Create the scene graph node for the rendering of the volume data, everything except the textures from the volume data to be applied to the slices through the volume.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcreateSlices(javax.media.j3d.OrderedGroup kOrderedGroupSlices, float fSpacing)Create the z-axis aligned slices through the volume so that any rotation of the volume does not result in the slices getting clipped by the texture volume.voiddispose()Clean up memory of this class.private voiddisposeSlices(javax.media.j3d.OrderedGroup kOrderedGroupSlices)Remove all children (geometries) of the specified ordered group node.protected voidfinalize()Used to call dispose of this class to clean up memory.floatgetSliceSpacingCoarse()Retrieve the current "coarse" spacing between slices.floatgetSliceSpacingFine()Retrieve the current "fine" spacing between slices.booleanisUsingSliceSpacingCoarse()Retrieves whether the "coarse" slice sampling is currently selected.booleanisUsingSliceSpacingFine()Retrieves whether the "fine" slice sampling is currently selected.voidsetSliceSpacingCoarse(float fSpacing)Set the desired "coarse" spacing between slices.voidsetSliceSpacingFine(float fSpacing)Set the desired "fine" spacing between slices.voidupdateOpacity(int iValue)Not used at the moment.voidupdateView(javax.media.j3d.Transform3D kViewTransform)Automatically call selectSlices with the correct axis (X, Y, or Z) and increasing/decreasing coordinate order flag based on the specified view direction vector such that the slices are rendered back to front for the plane which is most parallel to the view plane.voiduseSliceSpacingCoarse()Select the "coarse" slice sampling for rendering.voiduseSliceSpacingFine()Select the "fine" slice sampling for rendering.-
Methods inherited from class gov.nih.mipav.view.renderer.J3D.surfaceview.NodeVolumeTextureRender
getAxisSlice, getIncreasingOrder, updateSlicing
-
Methods inherited from class javax.media.j3d.Group
addChild, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, indexOfChild, insertChild, moveTo, numChildren, removeAllChildren, removeChild, removeChild, setAlternateCollisionTarget, setChild, setCollisionBounds
-
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
-
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
-
-
-
-
Field Detail
-
SLICES_FINE
private static final int SLICES_FINE
Used to select which nodes in the switch is selected.- See Also:
- Constant Field Values
-
SLICES_COARSE
private static final int SLICES_COARSE
DOCUMENT ME!- See Also:
- Constant Field Values
-
m_fCubeSize
private final float m_fCubeSize
Maximum size of any side of cube for rendering slices.
-
m_fSizeX
private final float m_fSizeX
Size of each axis in the original volume.
-
m_fSizeY
private final float m_fSizeY
Size of each axis in the original volume.
-
m_fSizeZ
private final float m_fSizeZ
Size of each axis in the original volume.
-
m_fSliceSpacingCoarse
private float m_fSliceSpacingCoarse
DOCUMENT ME!
-
m_fSliceSpacingFine
private float m_fSliceSpacingFine
Spacing between slices.
-
m_kAppearance
private javax.media.j3d.Appearance m_kAppearance
The same appearance properties used to render each slice.
-
m_kOrderedGroupSlicesCoarse
private javax.media.j3d.OrderedGroup m_kOrderedGroupSlicesCoarse
DOCUMENT ME!
-
m_kOrderedGroupSlicesFine
private javax.media.j3d.OrderedGroup m_kOrderedGroupSlicesFine
The slicing through the volume will be contained in an OrderedGroup to ensure that the slices are rendered back-to-front for correct blending effect. One set each is available for fine and coarse resolution quality rendering.
-
m_kSwitch
private javax.media.j3d.Switch m_kSwitch
This is the only node attached to this TransformGroup. It will enable either the selection of the "fine" or "coarse" resolution slice sampling.
-
m_kTempLocalViewTransform
private javax.media.j3d.Transform3D m_kTempLocalViewTransform
DOCUMENT ME!
-
m_kTempRotateMatrix
private javax.vecmath.Matrix3d m_kTempRotateMatrix
DOCUMENT ME!
-
m_kTempWorldToLocalTransform
private javax.media.j3d.Transform3D m_kTempWorldToLocalTransform
These are declared in the class to avoid allocating temporary instances each call into methods of this class.
-
m_kVolumeTexture
private VolumeTexture m_kVolumeTexture
Keep track of the texture instance.
-
-
Constructor Detail
-
NodeAlignedVolumeTextureRender
public NodeAlignedVolumeTextureRender(ModelImage image, VolumeTexture kVolumeTexture)
Create the scene graph node for the rendering of the volume data, everything except the textures from the volume data to be applied to the slices through the volume.- Parameters:
image- description of the parameters for the volumes which can be rendered with this node, where all volumes must shared the same description parameterskVolumeTexture- VolumeTexture-derived instance which contains the texture properties. This description parameters for the volume associated with this instance must match the parameters for which this node and its geometry.
-
-
Method Detail
-
dispose
public void dispose()
Clean up memory of this class.- Overrides:
disposein classNodeVolumeTextureRender
-
getSliceSpacingCoarse
public float getSliceSpacingCoarse()
Retrieve the current "coarse" spacing between slices.- Returns:
- float Current "coarse" spacing between slices.
-
getSliceSpacingFine
public float getSliceSpacingFine()
Retrieve the current "fine" spacing between slices.- Returns:
- float Current "fine" spacing between slices.
-
isUsingSliceSpacingCoarse
public boolean isUsingSliceSpacingCoarse()
Retrieves whether the "coarse" slice sampling is currently selected.- Returns:
- boolean Returns true if "coarse" slice sampling is currently selected.
-
isUsingSliceSpacingFine
public boolean isUsingSliceSpacingFine()
Retrieves whether the "fine" slice sampling is currently selected.- Returns:
- boolean Returns true if "fine" slice sampling is currently selected.
-
setSliceSpacingCoarse
public void setSliceSpacingCoarse(float fSpacing)
Set the desired "coarse" spacing between slices.- Parameters:
fSpacing- float Desired "coarse" spacing between slices.
-
setSliceSpacingFine
public void setSliceSpacingFine(float fSpacing)
Set the desired "fine" spacing between slices.- Parameters:
fSpacing- float Desired "fine" spacing between slices.
-
updateOpacity
public void updateOpacity(int iValue)
Not used at the moment. Update the opacity from the relate opacity change slider- Overrides:
updateOpacityin classNodeVolumeTextureRender- Parameters:
iValue- Opacity value from the opacity slider
-
updateView
public void updateView(javax.media.j3d.Transform3D kViewTransform)
Automatically call selectSlices with the correct axis (X, Y, or Z) and increasing/decreasing coordinate order flag based on the specified view direction vector such that the slices are rendered back to front for the plane which is most parallel to the view plane.- Overrides:
updateViewin classNodeVolumeTextureRender- Parameters:
kViewTransform- current view transform in virtual world coordinates
-
useSliceSpacingCoarse
public void useSliceSpacingCoarse()
Select the "coarse" slice sampling for rendering.
-
useSliceSpacingFine
public void useSliceSpacingFine()
Select the "fine" slice sampling for rendering.
-
finalize
protected void finalize() throws java.lang.ThrowableUsed to call dispose of this class to clean up memory.- Overrides:
finalizein classNodeVolumeTextureRender- Throws:
java.lang.Throwable- DOCUMENT ME!
-
createSlices
private void createSlices(javax.media.j3d.OrderedGroup kOrderedGroupSlices, float fSpacing)Create the z-axis aligned slices through the volume so that any rotation of the volume does not result in the slices getting clipped by the texture volume.- Parameters:
kOrderedGroupSlices- Node containing the sequenced ordering of the slices for correct back to front rendering when looking down the -Z axis.fSpacing- float Spacing between slices
-
disposeSlices
private void disposeSlices(javax.media.j3d.OrderedGroup kOrderedGroupSlices)
Remove all children (geometries) of the specified ordered group node.- Parameters:
kOrderedGroupSlices- OrderedGroup Node which is to be cleared of all children.
-
-