Class MjCorticalAnalysis

  • All Implemented Interfaces:
    com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback, ViewImageUpdateInterface, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener

    public class MjCorticalAnalysis
    extends RenderViewBase
    implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
    Cortical analysis applet and viewer. This class contains the static 'main' method to launch the application. This class is an Applet which means that it can be embedded in a browser or it can be attached to a MainFrame when executed as an application.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.Canvas

        java.awt.Canvas.AccessibleAWTCanvas
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)
      actionPerformed.
      void calculateConformal()
      Called on setup, when a new triangle mesh is loaded, or when the puncture triangle is selected and the "recalculate conformal" button is pressed by the user:
      private float closestPlanePointIndex​(javax.vecmath.Point3f kStart, int[] aiIndex)
      For the plane, all vertices have z-value set to zero.
      private static javax.vecmath.Point3f[] combine​(javax.vecmath.Point3f[] akPointA, javax.vecmath.Point3f[] akPointB)
      DOCUMENT ME!
      private static javax.media.j3d.GeometryArray createGeometry​(javax.vecmath.Point3f[] akPoint, javax.vecmath.Color4f[] akColor, int[] aiConnect)
      DOCUMENT ME!
      private static ModelTriangleMesh createTriangleMesh​(javax.vecmath.Point3f[] akPoint, javax.vecmath.Vector3f[] akNormal, javax.vecmath.Color4f[] akColor, int[] aiConnect)
      DOCUMENT ME!
      boolean displayConvexityColors()
      toggle between display of mean curvature-based colors and average convexity-based colors.
      boolean displayCurvatureColors()
      toggle between display of mean curvature-based colors and average convexity-based colors.
      void displayPlane()
      Switch to displaying the plane:
      void displaySphere()
      Switch to displaying the sphere:
      void disposeLocal()
      DOCUMENT ME!
      void drawPicked​(javax.vecmath.Point3f kStart, int[] aiIndex, int iWhich)
      Draw the user-selected point, either as a sphere on the triangle mesh, or as a black triangle, depending on which picking is enabled:
      private void drawPoint​(javax.vecmath.Point3f kStart, int[] aiIndex, int iWhich)
      Draw the user-selected point as a sphere on the triangle mesh:
      private void drawTriangle​(javax.vecmath.Point3f kStart, int[] aiIndex, int iWhich)
      Draw the user-selected triangle as a black triangle, save the original color so it can be restored:
      protected void finalize()
      DOCUMENT ME!
      javax.swing.JPanel getMainPanel()
      DOCUMENT ME!
      float getMaxAverageConvexity()
      DOCUMENT ME!
      float getMaxCurvature()
      return the max mean curvature:
      javax.media.j3d.BranchGroup getMesh()
      Display the mesh in the SurfaceRenderer:
      javax.media.j3d.BranchGroup getMeshLines()
      Display the mesh lines in the SurfaceRenderer:
      float getMinAverageConvexity()
      DOCUMENT ME!
      float getMinCurvature()
      return the min mean curvature:
      java.lang.Object getSceneState()
      Gets the scene state in terms of slices visible, which slice number, etc.
      ModelTriangleMesh getTMesh()
      Display the mesh in the SurfaceRenderer:
      private static javax.vecmath.Vector3d getTranslateToCenter​(javax.media.j3d.Shape3D kShape)
      DOCUMENT ME!
      boolean inflation()
      perform inflation step and then render shapes using the average convexity colors.
      boolean isCorrespondencePickEnabled()
      Return whether or not picking correspondence points is enabled:
      boolean isPickEnabled()
      Returns whether or not picking is enabled:
      boolean isPuncturePickEnabled()
      Return whether or not picking the puncture triangle is enabled:
      void mouseClicked​(java.awt.event.MouseEvent kEvent)
      DOCUMENT ME!
      void mouseDragged​(java.awt.event.MouseEvent kEvent)
      DOCUMENT ME!
      void mouseEntered​(java.awt.event.MouseEvent kEvent)
      DOCUMENT ME!
      void mouseExited​(java.awt.event.MouseEvent kEvent)
      DOCUMENT ME!
      void mouseMoved​(java.awt.event.MouseEvent kEvent)
      DOCUMENT ME!
      void mousePressed​(java.awt.event.MouseEvent kMouseEvent)
      DOCUMENT ME!
      void mouseReleased​(java.awt.event.MouseEvent kEvent)
      DOCUMENT ME!
      void removePoints()
      Remove all points drawn on the mesh, sphere, and plane:
      private void restoreTriColor()
      Resets the previously picked triangle to it's orginal color:
      void setAlphaBlend​(int value)
      Sets the alpha blending of parameter for two image displaying.
      private static void setColors​(float fCMin, float fCMax, float[] afCArray, int iVQuantity, javax.vecmath.Color4f[] akColor)
      DOCUMENT ME!
      private void setColorsLUT()
      Update the colormap based on the LUT:
      void setGUI​(java.lang.Object scene)
      Used by the JPanelMouse the redisplay the recorded actions.
      void setLUTConvexity​(ModelLUT kLUT)
      DOCUMENT ME!
      void setLUTCurvature​(ModelLUT kLUT)
      Update the colormap based on the LUT:
      void setRGBTA​(ModelRGB RGBT)
      setRGBTA.
      void setRGBTB​(ModelRGB RGBT)
      setRGBTB.
      void setSlice​(int slice)
      setSlice.
      void setTimeSlice​(int tSlice)
      setTimeSlice.
      void setup​(ModelTriangleMesh kTriangleMesh)
      Perform all initialization prior to executing.
      void setupLatLon​(int iNumLat, int iNumLon)
      Called when the mesh is created, or when the number of latitude or longitude lines is changed by the user.
      private void setupLight()
      Sets up a direction lightsource for the scene.
      void stateChanged​(javax.swing.event.ChangeEvent e)
      stateChanged.
      void toggleLatLonLines()
      Toggle between displaying the latitude and longitude lines:
      void togglePickCorrespondence()
      Enables picking with the mouse and drawing the curve on the mesh.
      void togglePickPuncture()
      Enables picking with the mouse and drawing the curve on the mesh.
      void transformChanged​(int type, javax.media.j3d.Transform3D transform)
      transformChanged.
      boolean updateImageExtents()
      updateImageExtents.
      boolean updateImages()
      updateImages.
      boolean updateImages​(boolean flag)
      updateImages.
      boolean updateImages​(ModelLUT LUTa, ModelLUT LUTb, boolean flag, int interpMode)
      updateImages.
      • Methods inherited from class javax.media.j3d.Canvas3D

        addNotify, getCenterEyeInImagePlate, getDoubleBufferAvailable, getDoubleBufferEnable, getGraphics2D, getGraphicsContext3D, getImagePlateToVworld, getInverseVworldProjection, getLeftEyeInImagePlate, getLeftManualEyeInImagePlate, getLocationOnScreen, getMonoscopicViewPolicy, getOffScreenBuffer, getOffScreenLocation, getOffScreenLocation, getPhysicalHeight, getPhysicalWidth, getPixelLocationFromImagePlate, getPixelLocationInImagePlate, getPixelLocationInImagePlate, getRightEyeInImagePlate, getRightManualEyeInImagePlate, getSceneAntialiasingAvailable, getScreen3D, getStereoAvailable, getStereoEnable, getView, getVworldProjection, getVworldToImagePlate, isOffScreen, isRendererRunning, isShadingLanguageSupported, postRender, preRender, queryProperties, removeNotify, renderField, renderOffScreenBuffer, setDoubleBufferEnable, setLeftManualEyeInImagePlate, setMonoscopicViewPolicy, setOffScreenBuffer, setOffScreenLocation, setOffScreenLocation, setRightManualEyeInImagePlate, setStereoEnable, startRenderer, stopRenderer, swap, waitForOffScreenRendering
      • Methods inherited from class java.awt.Canvas

        createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • m_aiTriIndex

        private int[] m_aiTriIndex
        DOCUMENT ME!
      • m_akPickColors

        private javax.vecmath.Color3f[] m_akPickColors
        Colors for the picked points:.
      • m_akTriColors

        private javax.vecmath.Color4f[] m_akTriColors
        DOCUMENT ME!
      • m_bCurvatureColors

        private boolean m_bCurvatureColors
        Flag set to indicate whether curvature colors are rendered on the mesh surface. If not, then average convexity colors are rendered.
      • m_bInflationInitialized

        private boolean m_bInflationInitialized
        Flag set once inflation processing has been initialized.
      • m_bMousePressed

        private boolean m_bMousePressed
        Mouse events. Setting mousePressed and mouseReleased explicitly when the mouse events are received has deals with getting multiply mouse event notifications for the same mouse press.
      • m_bMouseReleased

        private boolean m_bMouseReleased
        DOCUMENT ME!
      • m_bPickCorrespondenceEnabled

        private boolean m_bPickCorrespondenceEnabled
        Turned on when picking with the mouse is enabled:.
      • m_bPickPunctureEnabled

        private boolean m_bPickPunctureEnabled
        DOCUMENT ME!
      • m_iNumPicked

        private int m_iNumPicked
        number of picked points displayed.
      • m_iRunningNumPicked

        private int m_iRunningNumPicked
        DOCUMENT ME!
      • m_kCortical

        private MjCorticalMesh m_kCortical
        Cortical mesh to be used in rendering scene.
      • m_kGeometryArrayPlane

        private javax.media.j3d.GeometryArray m_kGeometryArrayPlane
        DOCUMENT ME!
      • m_kGeometryArraySphere

        private javax.media.j3d.GeometryArray m_kGeometryArraySphere
        DOCUMENT ME!
      • m_kLUTConvexity

        private ModelLUT m_kLUTConvexity
        DOCUMENT ME!
      • m_kLUTCurvature

        private ModelLUT m_kLUTCurvature
        local reference to ModelLUT.
      • m_kMeshBranchRoot

        private javax.media.j3d.BranchGroup m_kMeshBranchRoot
        BranchGroups for the Meshlines, for deleting and recreating the meshlines when the user changes the number of latitude and longitude lines:.
      • m_kMeshLinesBranchRoot

        private javax.media.j3d.BranchGroup m_kMeshLinesBranchRoot
        DOCUMENT ME!
      • m_kMouseEvent

        private java.awt.event.MouseEvent m_kMouseEvent
        DOCUMENT ME!
      • m_kPickCanvas

        private com.sun.j3d.utils.picking.PickCanvas m_kPickCanvas
        DOCUMENT ME!
      • m_kShapeMesh

        private javax.media.j3d.Shape3D m_kShapeMesh
        DOCUMENT ME!
      • m_kShapePlane

        private javax.media.j3d.Shape3D m_kShapePlane
        DOCUMENT ME!
      • m_kShapeSphere

        private javax.media.j3d.Shape3D m_kShapeSphere
        DOCUMENT ME!
      • m_kSwitchDisplay

        private javax.media.j3d.Switch m_kSwitchDisplay
        Switch between displaying the Sphere and the Plane:.
      • m_kSwitchLinesMesh

        private javax.media.j3d.Switch m_kSwitchLinesMesh
        This node contains the latitude/longitude renderings for the mesh which can be enabled/disabled.
      • m_kSwitchLinesPlane

        private javax.media.j3d.Switch m_kSwitchLinesPlane
        This node contains the latitude/longitude renderings for the plane which can be enabled/disabled.
      • m_kSwitchLinesPlaneBranch

        private javax.media.j3d.BranchGroup m_kSwitchLinesPlaneBranch
        DOCUMENT ME!
      • m_kSwitchLinesSphere

        private javax.media.j3d.Switch m_kSwitchLinesSphere
        This node contains the latitude/longitude renderings for the sphere which can be enabled/disabled.
      • m_kSwitchLinesSphereBranch

        private javax.media.j3d.BranchGroup m_kSwitchLinesSphereBranch
        DOCUMENT ME!
      • m_kTransformGroupActive

        private javax.media.j3d.TransformGroup m_kTransformGroupActive
        Currently selected transform that gets modified by the handler for the keyboard behavior.
      • m_kTransformGroupMesh

        private javax.media.j3d.TransformGroup m_kTransformGroupMesh
        DOCUMENT ME!
      • m_kTransformGroupPlane

        private javax.media.j3d.TransformGroup m_kTransformGroupPlane
        DOCUMENT ME!
      • m_kTransformGroupPoseMesh

        private javax.media.j3d.TransformGroup m_kTransformGroupPoseMesh
        This node contains all of the cortical mesh related nodes in the scene which can be manipulated as a group.
      • m_kTransformGroupPosePlane

        private javax.media.j3d.TransformGroup m_kTransformGroupPosePlane
        This node contains all of the plane related nodes in the scene which can be manipulated as a group.
      • m_kTransformGroupPoseSphere

        private javax.media.j3d.TransformGroup m_kTransformGroupPoseSphere
        This node contains all of the sphere related nodes in the scene which can be manipulated as a group.
      • m_kTransformGroupSphere

        private javax.media.j3d.TransformGroup m_kTransformGroupSphere
        DOCUMENT ME!
      • m_kTriangleMesh

        private ModelTriangleMesh m_kTriangleMesh
        Geometry for the rendering of the cortical mesh is maintained here so that the scene can be updated when the mesh is inflated.
      • MAX_POINTS

        private int MAX_POINTS
        DOCUMENT ME!
      • MESH

        private int MESH
        DOCUMENT ME!
      • PLANE

        private int PLANE
        DOCUMENT ME!
      • SPHERE

        private int SPHERE
        DOCUMENT ME!
    • Constructor Detail

      • MjCorticalAnalysis

        public MjCorticalAnalysis​(ModelImage _imageA,
                                  ModelImage _imageB,
                                  java.awt.GraphicsConfiguration _config,
                                  ViewJFrameVolumeView kParent)
        A simple universe is created that contains a viewing platform. A canvas is created and attached to the simple universe and is added to this instance The canvas is used for the 3D rendering. An initially empty scene graph for the application is created and assigned to the universe.
        Parameters:
        _imageA - DOCUMENT ME!
        _imageB - DOCUMENT ME!
        _config - DOCUMENT ME!
        kParent - DOCUMENT ME!
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        actionPerformed.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        e - ActionEvent
      • calculateConformal

        public void calculateConformal()
        Called on setup, when a new triangle mesh is loaded, or when the puncture triangle is selected and the "recalculate conformal" button is pressed by the user:
      • displayConvexityColors

        public boolean displayConvexityColors()
        toggle between display of mean curvature-based colors and average convexity-based colors.
        Returns:
        DOCUMENT ME!
      • displayCurvatureColors

        public boolean displayCurvatureColors()
        toggle between display of mean curvature-based colors and average convexity-based colors.
        Returns:
        DOCUMENT ME!
      • displayPlane

        public void displayPlane()
        Switch to displaying the plane:
      • displaySphere

        public void displaySphere()
        Switch to displaying the sphere:
      • drawPicked

        public void drawPicked​(javax.vecmath.Point3f kStart,
                               int[] aiIndex,
                               int iWhich)
        Draw the user-selected point, either as a sphere on the triangle mesh, or as a black triangle, depending on which picking is enabled:
        Parameters:
        kStart - DOCUMENT ME!
        aiIndex - DOCUMENT ME!
        iWhich - DOCUMENT ME!
      • getMainPanel

        public javax.swing.JPanel getMainPanel()
        DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • getMaxAverageConvexity

        public float getMaxAverageConvexity()
        DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • getMaxCurvature

        public float getMaxCurvature()
        return the max mean curvature:
        Returns:
        DOCUMENT ME!
      • getMesh

        public javax.media.j3d.BranchGroup getMesh()
        Display the mesh in the SurfaceRenderer:
        Returns:
        a Branchgroup containing a copy of the ModelTriangleMesh
      • getMeshLines

        public javax.media.j3d.BranchGroup getMeshLines()
        Display the mesh lines in the SurfaceRenderer:
        Returns:
        a BranchGroup containing a copy of the TriangleMesh Lat/Lon Lines
      • getMinAverageConvexity

        public float getMinAverageConvexity()
        DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • getMinCurvature

        public float getMinCurvature()
        return the min mean curvature:
        Returns:
        DOCUMENT ME!
      • getSceneState

        public java.lang.Object getSceneState()
        Gets the scene state in terms of slices visible, which slice number, etc.
        Specified by:
        getSceneState in class RenderViewBase
        Returns:
        A private object extension specific to the class that extends this one.
      • getTMesh

        public ModelTriangleMesh getTMesh()
        Display the mesh in the SurfaceRenderer:
        Returns:
        DOCUMENT ME!
      • inflation

        public boolean inflation()
        perform inflation step and then render shapes using the average convexity colors.
        Returns:
        DOCUMENT ME!
      • isCorrespondencePickEnabled

        public boolean isCorrespondencePickEnabled()
        Return whether or not picking correspondence points is enabled:
        Returns:
        DOCUMENT ME!
      • isPickEnabled

        public boolean isPickEnabled()
        Returns whether or not picking is enabled:
        Returns:
        DOCUMENT ME!
      • isPuncturePickEnabled

        public boolean isPuncturePickEnabled()
        Return whether or not picking the puncture triangle is enabled:
        Returns:
        DOCUMENT ME!
      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent kEvent)
        DOCUMENT ME!
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
        Parameters:
        kEvent - the mouse event generated by a mouse clicked
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent kEvent)
        DOCUMENT ME!
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Parameters:
        kEvent - the mouse event generated by a mouse drag
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent kEvent)
        DOCUMENT ME!
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
        Parameters:
        kEvent - the mouse event generated by a mouse entered
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent kEvent)
        DOCUMENT ME!
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
        Parameters:
        kEvent - the mouse event generated by a mouse exit
      • mouseMoved

        public void mouseMoved​(java.awt.event.MouseEvent kEvent)
        DOCUMENT ME!
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
        Parameters:
        kEvent - the event generated by a mouse movement
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent kMouseEvent)
        DOCUMENT ME!
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Parameters:
        kMouseEvent - the mouse event generated by a mouse press
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent kEvent)
        DOCUMENT ME!
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Parameters:
        kEvent - the mouse event generated by a mouse release
      • removePoints

        public void removePoints()
        Remove all points drawn on the mesh, sphere, and plane:
      • setAlphaBlend

        public void setAlphaBlend​(int value)
        Sets the alpha blending of parameter for two image displaying.
        Specified by:
        setAlphaBlend in class RenderViewBase
        Parameters:
        value - amount [0,100] that is the percentage of Image A to be displayed and (1-percentage) of Image B to be displayed
      • setGUI

        public void setGUI​(java.lang.Object scene)
        Used by the JPanelMouse the redisplay the recorded actions.
        Specified by:
        setGUI in class RenderViewBase
        Parameters:
        scene - Object
      • setLUTConvexity

        public void setLUTConvexity​(ModelLUT kLUT)
        DOCUMENT ME!
        Parameters:
        kLUT - DOCUMENT ME!
      • setLUTCurvature

        public void setLUTCurvature​(ModelLUT kLUT)
        Update the colormap based on the LUT:
        Parameters:
        kLUT - DOCUMENT ME!
      • setup

        public void setup​(ModelTriangleMesh kTriangleMesh)
        Perform all initialization prior to executing. Loads the sample mesh surface and sets up the rendering of the scene.
        Parameters:
        kTriangleMesh - DOCUMENT ME!
      • setupLatLon

        public void setupLatLon​(int iNumLat,
                                int iNumLon)
        Called when the mesh is created, or when the number of latitude or longitude lines is changed by the user. When the user changes the number of latitude or longitude lines, the meshes are removed from the scene and recreated.
        Parameters:
        iNumLat - DOCUMENT ME!
        iNumLon - DOCUMENT ME!
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent e)
        stateChanged.
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
        Parameters:
        e - ChangeEvent
      • toggleLatLonLines

        public void toggleLatLonLines()
        Toggle between displaying the latitude and longitude lines:
      • togglePickCorrespondence

        public void togglePickCorrespondence()
        Enables picking with the mouse and drawing the curve on the mesh.
      • togglePickPuncture

        public void togglePickPuncture()
        Enables picking with the mouse and drawing the curve on the mesh.
      • transformChanged

        public void transformChanged​(int type,
                                     javax.media.j3d.Transform3D transform)
        transformChanged.
        Specified by:
        transformChanged in interface com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback
        Parameters:
        type - int
        transform - Transform3D
      • updateImages

        public boolean updateImages​(boolean flag)
        updateImages.
        Specified by:
        updateImages in interface ViewImageUpdateInterface
        Parameters:
        flag - boolean
        Returns:
        boolean
      • updateImages

        public boolean updateImages​(ModelLUT LUTa,
                                    ModelLUT LUTb,
                                    boolean flag,
                                    int interpMode)
        updateImages.
        Specified by:
        updateImages in interface ViewImageUpdateInterface
        Parameters:
        LUTa - ModelLUT
        LUTb - ModelLUT
        flag - boolean
        interpMode - int
        Returns:
        boolean
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        DOCUMENT ME!
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable - DOCUMENT ME!
      • combine

        private static javax.vecmath.Point3f[] combine​(javax.vecmath.Point3f[] akPointA,
                                                       javax.vecmath.Point3f[] akPointB)
        DOCUMENT ME!
        Parameters:
        akPointA - DOCUMENT ME!
        akPointB - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • createGeometry

        private static javax.media.j3d.GeometryArray createGeometry​(javax.vecmath.Point3f[] akPoint,
                                                                    javax.vecmath.Color4f[] akColor,
                                                                    int[] aiConnect)
        DOCUMENT ME!
        Parameters:
        akPoint - DOCUMENT ME!
        akColor - DOCUMENT ME!
        aiConnect - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • createTriangleMesh

        private static ModelTriangleMesh createTriangleMesh​(javax.vecmath.Point3f[] akPoint,
                                                            javax.vecmath.Vector3f[] akNormal,
                                                            javax.vecmath.Color4f[] akColor,
                                                            int[] aiConnect)
        DOCUMENT ME!
        Parameters:
        akPoint - DOCUMENT ME!
        akNormal - DOCUMENT ME!
        akColor - DOCUMENT ME!
        aiConnect - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • getTranslateToCenter

        private static javax.vecmath.Vector3d getTranslateToCenter​(javax.media.j3d.Shape3D kShape)
        DOCUMENT ME!
        Parameters:
        kShape - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • setColors

        private static void setColors​(float fCMin,
                                      float fCMax,
                                      float[] afCArray,
                                      int iVQuantity,
                                      javax.vecmath.Color4f[] akColor)
        DOCUMENT ME!
        Parameters:
        fCMin - DOCUMENT ME!
        fCMax - DOCUMENT ME!
        afCArray - DOCUMENT ME!
        iVQuantity - DOCUMENT ME!
        akColor - DOCUMENT ME!
      • closestPlanePointIndex

        private float closestPlanePointIndex​(javax.vecmath.Point3f kStart,
                                             int[] aiIndex)
        For the plane, all vertices have z-value set to zero. Because the mesh is closed, even for the plane, the edge triangles wrap around the back of the mesh, and are co-planar with the forward-facing triangles (the ones that display the data) -- when picking is done, the pickClosest sometimes returns the back-facing triangle. This function returns the correct, visible triangle for the plane:
        Parameters:
        kStart - DOCUMENT ME!
        aiIndex - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • drawPoint

        private void drawPoint​(javax.vecmath.Point3f kStart,
                               int[] aiIndex,
                               int iWhich)
        Draw the user-selected point as a sphere on the triangle mesh:
        Parameters:
        kStart - DOCUMENT ME!
        aiIndex - DOCUMENT ME!
        iWhich - DOCUMENT ME!
      • drawTriangle

        private void drawTriangle​(javax.vecmath.Point3f kStart,
                                  int[] aiIndex,
                                  int iWhich)
        Draw the user-selected triangle as a black triangle, save the original color so it can be restored:
        Parameters:
        kStart - DOCUMENT ME!
        aiIndex - DOCUMENT ME!
        iWhich - DOCUMENT ME!
      • restoreTriColor

        private void restoreTriColor()
        Resets the previously picked triangle to it's orginal color:
      • setColorsLUT

        private void setColorsLUT()
        Update the colormap based on the LUT:
      • setupLight

        private void setupLight()
        Sets up a direction lightsource for the scene.