Class VolumeSlices


  • public class VolumeSlices
    extends VolumeObject
    Displays the three orthogonal planes with the volume data.
    See Also:
    GPUVolumeRender.java, VolumePlaneEffect.java, VolumeObject.java
    • Field Detail

      • m_kVolumePreShader

        private VolumePreRenderEffect[] m_kVolumePreShader
        ShaderEffect for the pre-render stage the bounding-box and the slice share the same pre-render effect.
      • m_akPlaneEffect

        private VolumePlaneEffect[] m_akPlaneEffect
        ShaderEffects for the planes. Each is unique so they can have different alpha values.
      • m_akPlanes

        private WildMagic.LibGraphics.SceneGraph.TriMesh[] m_akPlanes
        The three orthogonal plane TriMeshes.
      • m_abShowPlanes

        private boolean[] m_abShowPlanes
        Displaying each plane:
      • m_akBoundingBox

        private WildMagic.LibGraphics.SceneGraph.Polyline[] m_akBoundingBox
        The three plane bounding-box Polylines.
      • m_abShowBoundingBox

        private boolean[] m_abShowBoundingBox
        Displaying each bounding-box:
      • m_akColors

        private WildMagic.LibFoundation.Mathematics.ColorRGB[] m_akColors
        Set of colors used to draw the X and Y Bars and the Z box:.
      • m_abSolid

        private boolean[] m_abSolid
      • sliceIDs

        private int[] sliceIDs
    • Constructor Detail

      • VolumeSlices

        public VolumeSlices​(WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                            VolumeImage kImageA,
                            VolumeImage kImageB,
                            WildMagic.LibFoundation.Mathematics.Vector3f kTranslate,
                            float fX,
                            float fY,
                            float fZ)
        Create a new VolumeObject with the VolumeImage parameter.
        Parameters:
        kImageA - the VolumeImage containing shared data and textures for rendering.
        kVolumeImageB - second VolumeImage.
        kTranslate - translation in the scene-graph for this object.
        fX - the size of the volume in the x-dimension (extent * resolutions)
        fY - the size of the volume in the y-dimension (extent * resolutions)
        fZ - the size of the volume in the z-dimension (extent * resolutions)
    • Method Detail

      • dispose

        public void dispose​(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
        Delete local memory.
        Overrides:
        dispose in class VolumeObject
      • GetScene

        public WildMagic.LibGraphics.SceneGraph.Node GetScene()
        Description copied from class: VolumeObject
        Get the object's parent node in the scene graph.
        Overrides:
        GetScene in class VolumeObject
      • GetShowBoundingBox

        public boolean GetShowBoundingBox​(int i)
        Return the current display status for the bounding box for the given plane.
        Parameters:
        i - the plane index (0-3) in file coordinates.
        Returns:
        true when the bounding box is displayed.
      • GetShowSlice

        public boolean GetShowSlice​(int i)
        Return the current display status for the bounding box for the given plane.
        Parameters:
        i - the plane index (0-3) in file coordinates.
        Returns:
        true when the bounding box is displayed.
      • GetSliceOpacity

        public float GetSliceOpacity​(int i)
        Return the opacity for the given plane.
        Parameters:
        i - the plane index (0-3) in file coordinates.
        Returns:
        the opacity for the given plane.
      • GetSliceOpacity

        public float[] GetSliceOpacity()
      • SetSliceOpacity

        public void SetSliceOpacity​(float[] afAlpha)
      • Render

        public void Render​(WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                           WildMagic.LibGraphics.SceneGraph.Culler kCuller,
                           boolean bPreRender,
                           boolean bSolid)
        Description copied from class: VolumeObject
        Render the object.
        Specified by:
        Render in class VolumeObject
        Parameters:
        kRenderer - the OpenGLRenderer object.
        kCuller - the Culler object.
      • setABBlend

        public void setABBlend​(float fBlend)
      • SetBoundingBoxColor

        public void SetBoundingBoxColor​(int i,
                                        WildMagic.LibFoundation.Mathematics.ColorRGB kColor)
        Sets the bounding box color for the given plane.
        Parameters:
        i - the plane index (0-3) in file coordinates.
        kColor - the new color.
      • SetCenter

        public void SetCenter​(WildMagic.LibFoundation.Mathematics.Vector3f kCenter)
        Sets the positions of the three orthogonal planes.
        Parameters:
        kCenter - the positions in file coordinates.
      • setRGBTA

        public void setRGBTA​(ModelRGB RGBT)
      • setRGBTB

        public void setRGBTB​(ModelRGB RGBT)
      • SetSliceOpacity

        public void SetSliceOpacity​(int i,
                                    float fAlpha)
        Sets the opacity for the given plane.
        Parameters:
        i - the plane index (0-3) in file coordinates.
        fAlpha - the opacity for the given plane.
      • ShowBoundingBox

        public void ShowBoundingBox​(int i,
                                    boolean bShow)
        Turns on/off displaying the bounding box for the given plane.
        Parameters:
        i - the plane index (0-3) in file coordinates.
        bShow - when true, the bounding box is displayed.
      • ShowSlice

        public void ShowSlice​(int i,
                              boolean bShow)
        Turns on/off displaying the given plane.
        Parameters:
        i - the plane index (0-3) in file coordinates.
        bShow - when true, the plane is displayed.
      • ShowSurface

        public void ShowSurface​(boolean bOn)
        Turns rendering the planes with the surface mask on/off.
        Parameters:
        bOn - on/off.
      • SetTranslate

        public void SetTranslate​(WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
        Description copied from class: VolumeObject
        Copy translation vector.
        Overrides:
        SetTranslate in class VolumeObject
        Parameters:
        kTranslate - new translation amount.
      • whichPlane

        public int whichPlane​(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh)
      • CreateBoundingBox

        private void CreateBoundingBox()
        Creates the bounding frames for the planes.
      • CreatePlanes

        private void CreatePlanes()
        Creates the scene graph.
      • reCreateScene

        public void reCreateScene​(VolumeImage kImageA,
                                  WildMagic.LibFoundation.Mathematics.Vector3f kTranslate,
                                  float fX,
                                  float fY,
                                  float fZ)
      • reCreateBoundingBox

        private void reCreateBoundingBox()