Class FlyThroughRender

    • Field Detail

      • serialVersionUID

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

        private ModelImage3DLayout m_kVolumeLayout
        3D Layout of the ModelImage.
      • m_kSkeleton

        private Skeleton3D m_kSkeleton
        3D Skeleton of the ModelImage.
      • m_kFlyPathGraphCurve

        private FlyPathGraphCurve m_kFlyPathGraphCurve
        Fly path curve.
      • m_kMaskImage

        private ModelImage m_kMaskImage
        ModelImage used to generate the fly path.
      • m_iLastSelectedBranchIndex

        private int m_iLastSelectedBranchIndex
        Keep track of the last branch that was selected (at a branch point).
      • m_aiBranchIndexUnvisitedMax

        private int[] m_aiBranchIndexUnvisitedMax
        This is the range of path samples for each branch that are unvisited.
      • m_kNormalColorPathVisited

        private WildMagic.LibFoundation.Mathematics.ColorRGB m_kNormalColorPathVisited
        Color for the parts of the path that have been visited (Light Green)
      • m_kNormalColorPathUnvisited

        private WildMagic.LibFoundation.Mathematics.ColorRGB m_kNormalColorPathUnvisited
        Color for the parts of the path that have not yet been visited (Dark Green)
      • m_kSelectColorPathVisited

        private WildMagic.LibFoundation.Mathematics.ColorRGB m_kSelectColorPathVisited
        Color for selecting previously-visited parts of the path at a branch (Red)
      • m_kSelectColorPathUnvisited

        private WildMagic.LibFoundation.Mathematics.ColorRGB m_kSelectColorPathUnvisited
        Color for selecting previously-unvisited parts of the path at a branch (Dark Red)
      • m_aiBranchIndexUnvisitedMin

        private int[] m_aiBranchIndexUnvisitedMin
        This is the range of path samples for each branch that are unvisited.
      • m_kSurface

        private WildMagic.LibGraphics.SceneGraph.TriMesh m_kSurface
        The surface to fly through.
      • m_kLight

        private WildMagic.LibGraphics.Rendering.Light m_kLight
        Lighting in the scene.
      • m_kRotation

        private WildMagic.LibGraphics.SceneGraph.Node m_kRotation
        Mouse rotation.
      • m_kCortical

        private MjCorticalMesh_WM m_kCortical
        Calculating the mesh curvatures.
      • m_kCenter

        private WildMagic.LibFoundation.Mathematics.Vector3f m_kCenter
        Center of Mesh
      • m_kMeanCurvaturesLUT

        private ModelLUT m_kMeanCurvaturesLUT
        kMean curvature LUT. Pseudo color look up table.
      • m_akColorBackup

        private WildMagic.LibFoundation.Mathematics.ColorRGB[] m_akColorBackup
        Original surface color for undoing the pseudo-color curvature map.
      • pressed

        private volatile boolean pressed
        If any of the mouse move button pressed.
      • lookup

        public static int lookup
      • lookdown

        public static int lookdown
      • lookright

        public static int lookright
      • lookleft

        public static int lookleft
    • Constructor Detail

      • FlyThroughRender

        public FlyThroughRender​(com.jogamp.opengl.awt.GLCanvas kCanvas,
                                VolumeTriPlanarInterface kParent,
                                com.jogamp.opengl.util.Animator kAnimator,
                                VolumeImage kVolumeImageA,
                                VolumeImage kVolumeImageB,
                                WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
        Construct the FlyThroughRenderer.
        Parameters:
        kParent - parent user-interface and frame.
        kAnimator - animator used to display the canvas.
        kVolumeImageA - volume data and textures for ModelImage A.
        kVolumeImageB - volume data and textures for ModelImage B.
    • Method Detail

      • addSurface

        public void addSurface​(WildMagic.LibGraphics.SceneGraph.TriMesh kSurface,
                               WildMagic.LibFoundation.Mathematics.Vector3f kCenter)
        Add the fly-through surface.
        Parameters:
        kSurface - the TriMesh surface to fly through.
      • display

        public void display​(com.jogamp.opengl.GLAutoDrawable arg0)
        Specified by:
        display in interface com.jogamp.opengl.GLEventListener
      • doPseudoColor

        public void doPseudoColor​(boolean bOn)
        Turn curvature-based color map on/off.
        Parameters:
        bOn - turns curvature-based color map on when true and off when false.
      • getBranchState

        public java.lang.Object getBranchState()
        Specified by:
        getBranchState in interface FlyThroughRenderInterface
        Returns:
        the current BranchState from the FlyPatheBehavior class.
      • getCameraDirection

        public WildMagic.LibFoundation.Mathematics.Vector3f getCameraDirection()
        Return the camera direction vector.
        Returns:
        camera direction vector.
      • getCameraUp

        public WildMagic.LibFoundation.Mathematics.Vector3f getCameraUp()
        Return the camera up vector.
        Returns:
        camera up vector.
      • getPositionScaled

        public WildMagic.LibFoundation.Mathematics.Vector3f getPositionScaled​(WildMagic.LibFoundation.Mathematics.Vector3f kPoint)
        Scaled coordinates for the current position along the path for viewing.
        Parameters:
        Point - in normalized path coordinates.
        Returns:
        Point3f A new instance created which contains the path position coordinates, scaled to match the TriMesh in JPanelSurface.
      • getPositionUnScaled

        public WildMagic.LibFoundation.Mathematics.Vector3f getPositionUnScaled​(WildMagic.LibFoundation.Mathematics.Vector3f kPoint)
        Scaled coordinates for the current position along the path for viewing.
        Parameters:
        The - path position coordinates, scaled to match the TriMesh.
        Returns:
        Point in normalized path coordinates.
      • init

        public void init​(com.jogamp.opengl.GLAutoDrawable arg0)
        Specified by:
        init in interface com.jogamp.opengl.GLEventListener
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent e)
        Description copied from class: GPURenderBase
        Part of the KeyListener interface.
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
        Overrides:
        keyPressed in class GPURenderBase
        Parameters:
        e - the key event.
      • makeMove

        public void makeMove​(java.lang.String cmd)
        Description copied from interface: FlyThroughRenderInterface
        Passes move command from the JPanelFlythruMove to the FlyPathBehavior class.
        Specified by:
        makeMove in interface FlyThroughRenderInterface
        Parameters:
        cmd - move command.
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent event)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseDragged in class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent e)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Overrides:
        mousePressed in class GPURenderBase
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent e)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Overrides:
        mouseReleased in class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
      • mouseWheelMoved

        public void mouseWheelMoved​(java.awt.event.MouseWheelEvent event)
        Mouse wheel event invoked from the middle mouse button roller. Rolling forward to track the fly-thru path in forward direction. Rolling backward to track the fly-thru path in backward direction.
        Specified by:
        mouseWheelMoved in interface java.awt.event.MouseWheelListener
        Overrides:
        mouseWheelMoved in class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
        Parameters:
        event - mouse middle mouse roller event.
      • setupRender

        public void setupRender​(ModelImage kImage,
                                FlyThroughRender.SetupOptions kOptions)
        Setup flythru renderer.
        Parameters:
        _kImage - original model image reference.
        kOptions - setup options reference.
      • setupRenderControl

        public void setupRenderControl​(JPanelVirtualEndoscopySetup_WM _control)
        Set the JPanelVirtualEndoscopySetup user-interface.
        Parameters:
        _control - the JPanelVirtualEndoscopySetup user-interface.
      • update

        public void update()
        Update the representation of the current viewpoint in the Volume Tri-Planar renderer.
      • updateLighting

        public void updateLighting​(WildMagic.LibGraphics.Rendering.Light[] akGLights)
        Description copied from class: GPURenderBase
        Called from JPanelLight. Updates the lighting parameters.
        Overrides:
        updateLighting in class GPURenderBase
        Parameters:
        akGLights - the set of GeneralLight objects.
      • viewChanged

        public void viewChanged​(FlyPathBehavior_WM behavior,
                                int iEvent)
        Description copied from interface: FlyPathBehavior_WM.Callback
        ViewChanged callback for flythrough renderers.
        Specified by:
        viewChanged in interface FlyPathBehavior_WM.Callback
        Parameters:
        behavior - reference to this MjFlyPathBehavior in which the view changed.
        iEvent - Bitmask identifies the event(s) which caused the view to change. Bitmask created from OR of EVENT_* defintions.
      • createAnnotatePoint

        private void createAnnotatePoint​(WildMagic.LibFoundation.Mathematics.Vector3f kPosition)
        Create a new Annotation point at the position specified.
        Parameters:
        kPosition - position of new annotation point.
      • createBranchConnectGeometryScaled

        private WildMagic.LibGraphics.SceneGraph.Polyline createBranchConnectGeometryScaled​(int iBranch)
        Get the geometry to be used for rendering the connection of the specified branch to its parent branch.
        Parameters:
        iBranch - Index which identifies the branch.
        Returns:
        Polyline instance that can be attached to a scene-graph Node for rendering
      • createBranchPathGeometryScaled

        private WildMagic.LibGraphics.SceneGraph.Polyline createBranchPathGeometryScaled​(int iBranch)
        Get the geometry to be used for rendering the path of the specified branch.
        Parameters:
        iBranch - Index which identifies the branch.
        Returns:
        Polyline instance that can be attached to a scene-graph Node for rendering

        The coordinates are scaled to match the TriMesh in JPanelSurface.

      • CreateScene

        private void CreateScene()
        Called by the init() function. Creates and initialized the scene-graph.
        Parameters:
        arg0 - the GLCanvas
      • Render

        private void Render()
        Render the scene-graph.
      • updateCamera

        private void updateCamera()
        Update the camera location and view direction. Called from mouse dragged. Implements "inside looking out" object rotation.
      • Move

        protected void Move()
        Description copied from class: GPURenderBase
        Updates the camera and displayed objects for rendering.
        Overrides:
        Move in class GPURenderBase
      • Pick

        protected void Pick()
        Picking support for adding Annotation points to the scene.
      • resetRenderBranchConnect

        protected void resetRenderBranchConnect()
        Called any time a change has been made to a new branch so that the connection between the branch and its parent can be rendered.
      • resetRenderBranchPath

        protected void resetRenderBranchPath()
        Called any time the position along the current curve changes and the color of the curve needs to change to show what has been visited.