Class VolumeClip


  • public class VolumeClip
    extends VolumeObject
    Displays the Clipping frames in the VolumeViewer.
    See Also:
    VolumeObject.java, GPUVolumeRender.java
    • Field Detail

      • m_kVertexColor3Shader

        private WildMagic.LibGraphics.Effects.VertexColor3Effect m_kVertexColor3Shader
        ShaderEffect for displaying the clip planes.
      • m_akPolyline

        private WildMagic.LibGraphics.SceneGraph.Polyline[] m_akPolyline
        axis-aligned clip plane polylines:
      • m_abDisplayPolyline

        private boolean[] m_abDisplayPolyline
        enables/disables displaying clip planes
      • m_spkEyeCamera

        private WildMagic.LibGraphics.Rendering.Camera m_spkEyeCamera
        Screen camera for displaying the eye clip planes in screen-coordinates:
      • m_kArbRotate

        private WildMagic.LibGraphics.SceneGraph.Node m_kArbRotate
        Node for rotating the arbitrary clip plane with the mouse trackball:
      • m_fMax

        private float m_fMax
        Maximum dimension.
    • Constructor Detail

      • VolumeClip

        public VolumeClip​(VolumeImage kImageA,
                          WildMagic.LibFoundation.Mathematics.Vector3f kTranslate,
                          float fX,
                          float fY,
                          float fZ)
        Creates a new VolumeClip object.
        Parameters:
        kImageA - the VolumeImage containing shared data and textures for rendering.
        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

      • ArbRotate

        public WildMagic.LibGraphics.SceneGraph.Node ArbRotate()
        Scene-graph node for rotating the arbitrary clipping plane.
        Returns:
        Scene-graph node for rotating the arbitrary clipping plane.
      • DisplayArb

        public boolean DisplayArb()
        Return true if the arbitrary clip plane is current being displayed.
        Returns:
        true if the arbitrary clip plane is current being displayed.
      • DisplayArb

        public void DisplayArb​(boolean bDisplay)
        Turns displaying the arbitrary clip plane on/off.
        Parameters:
        bDisplay - when true display the arbitrary clip plane.
      • displayClipPlane

        public void displayClipPlane​(int iWhich,
                                     boolean bDisplay)
        Called from JPanelClip. Sets the axis-aligned clip plane display on/off.
        Parameters:
        iWhich - the clip plane to set.
        bDisplay - on/off.
      • DisplayEye

        public void DisplayEye​(boolean bDisplay)
        Turns displaying the eye clip plane on/off.
        Parameters:
        bDisplay - when true display the eye clip plane.
      • DisplayEyeInv

        public void DisplayEyeInv​(boolean bDisplay)
        Turns displaying the inverse-eye clip plane on/off.
        Parameters:
        bDisplay - when true display the inverse-eye clip plane.
      • dispose

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

        public boolean[] getDisplay()
      • getDisplayInv

        public boolean[] getDisplayInv()
      • getClipColor

        public java.awt.Color[] getClipColor()
      • getDisplayEye

        public boolean[] getDisplayEye()
      • getDisplayArb

        public boolean getDisplayArb()
      • GetValue

        public float GetValue​(int iWhich)
        Returns the value of the specified axis-aligend clip plane.
        Parameters:
        iWhich - one of the 6 clip planes
        Returns:
        the value of the specified axis-aligend clip plane.
      • PostRender

        public void PostRender​(WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                               WildMagic.LibGraphics.SceneGraph.Culler kCuller)
        Render the object after all other objects have been rendererd. Useful for screen-space objects such as the eye-clip plane.
        Overrides:
        PostRender in class VolumeObject
        Parameters:
        kRenderer - the OpenGLRenderer object.
        kCuller - the Culler object.
      • Render

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

        public void setArbColor​(WildMagic.LibFoundation.Mathematics.ColorRGB kColor)
        Sets the arbitrary clip plane color.
        Parameters:
        kColor - the new color.
      • SetArbPlane

        public WildMagic.LibFoundation.Mathematics.Vector3f SetArbPlane​(float fX)
        Set the position of the arbitrary clipping plane, before rotation.
        Parameters:
        fX - the position of the arbitrary clipping plane, before rotation.
      • GetArbInverse

        public WildMagic.LibFoundation.Mathematics.Vector3f GetArbInverse​(float fX)
      • setClipPlane

        public void setClipPlane​(int iWhich,
                                 float fValue)
        Sets the axis-aligned clip plane clipping position.
        Parameters:
        iWhich - one of the 6 clip planes
        fValue - the clipping position.
      • setClipPlaneColor

        public void setClipPlaneColor​(int iWhich,
                                      WildMagic.LibFoundation.Mathematics.ColorRGB kColor)
        Sets the axis-aligned clip plane color.
        Parameters:
        iWhich - one of the 6 clip planes
        kColor - the new color.
      • setEyeClipPlane

        public void setEyeClipPlane​(float fZ)
        Sets the eye clip plane position.
        Parameters:
        f4 - clip position (same value as sSlice in JPanelClip)
        bDisplay - on/off.
      • setEyeInvClipPlane

        public void setEyeInvClipPlane​(float fZ)
        Sets the eye clip plane position.
        Parameters:
        f4 - clip position (same value as sSlice in JPanelClip)
        bDisplay - on/off.
      • CreateClipPlanes

        private void CreateClipPlanes()
        Creates the clipping planes.
      • reCreateScene

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

        private void reCreateClipPlanes()