Class 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 float m_fCubeSize
      Maximum size of any side of cube for rendering slices.
      private float m_fSizeX
      Size of each axis in the original volume.
      private float m_fSizeY
      Size of each axis in the original volume.
      private float m_fSizeZ
      Size of each axis in the original volume.
      private float m_fSliceSpacingCoarse
      DOCUMENT ME!
      private float m_fSliceSpacingFine
      Spacing between slices.
      private javax.media.j3d.Appearance m_kAppearance
      The same appearance properties used to render each slice.
      private javax.media.j3d.OrderedGroup m_kOrderedGroupSlicesCoarse
      DOCUMENT ME!
      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.
      private javax.media.j3d.Switch m_kSwitch
      This is the only node attached to this TransformGroup.
      private javax.media.j3d.Transform3D m_kTempLocalViewTransform
      DOCUMENT ME!
      private javax.vecmath.Matrix3d m_kTempRotateMatrix
      DOCUMENT ME!
      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.
      private VolumeTexture m_kVolumeTexture
      Keep track of the texture instance.
      private static int SLICES_COARSE
      DOCUMENT ME!
      private static int SLICES_FINE
      Used 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 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.
      void dispose()
      Clean up memory of this class.
      private void disposeSlices​(javax.media.j3d.OrderedGroup kOrderedGroupSlices)
      Remove all children (geometries) of the specified ordered group node.
      protected void finalize()
      Used to call dispose of this class to clean up memory.
      float getSliceSpacingCoarse()
      Retrieve the current "coarse" spacing between slices.
      float getSliceSpacingFine()
      Retrieve the current "fine" spacing between slices.
      boolean isUsingSliceSpacingCoarse()
      Retrieves whether the "coarse" slice sampling is currently selected.
      boolean isUsingSliceSpacingFine()
      Retrieves whether the "fine" slice sampling is currently selected.
      void setSliceSpacingCoarse​(float fSpacing)
      Set the desired "coarse" spacing between slices.
      void setSliceSpacingFine​(float fSpacing)
      Set the desired "fine" spacing between slices.
      void updateOpacity​(int iValue)
      Not used at the moment.
      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.
      void useSliceSpacingCoarse()
      Select the "coarse" slice sampling for rendering.
      void useSliceSpacingFine()
      Select the "fine" slice sampling for rendering.
      • Methods inherited from class javax.media.j3d.TransformGroup

        cloneNode, getTransform, setTransform
      • 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
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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
      • 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 parameters
        kVolumeTexture - 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

      • 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:
        updateOpacity in class NodeVolumeTextureRender
        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:
        updateView in class NodeVolumeTextureRender
        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.Throwable
        Used to call dispose of this class to clean up memory.
        Overrides:
        finalize in class NodeVolumeTextureRender
        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.