Class GPURenderBase

java.lang.Object
WildMagic.LibApplications.OpenGLApplication.Application
WildMagic.LibApplications.OpenGLApplication.JavaApplication
WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
gov.nih.mipav.view.renderer.WildMagic.GPURenderBase
All Implemented Interfaces:
com.jogamp.opengl.GLEventListener, SpaceNavigatorListener, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, Serializable, EventListener
Direct Known Subclasses:
CorticalAnalysisRender, FlyThroughRender, PlaneRender_WM, PlaneRenderProstate, VolumeTriPlanarRenderBase

public abstract class GPURenderBase extends WildMagic.LibApplications.OpenGLApplication.JavaApplication3D implements com.jogamp.opengl.GLEventListener, KeyListener, MouseMotionListener, MouseListener, SpaceNavigatorListener
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) WildMagic.LibFoundation.Mathematics.Vector3f
     
    (package private) double
     
    (package private) double
    3D MOUSE MOTION CONSTANTS
    protected double
     
    protected VolumeImage[]
     
    protected WildMagic.LibGraphics.Rendering.Texture
     
    private static int
    used to invert the settings of the mouse
    private static int
    used to invert the settings of the mouse
    private static int
    used to invert the settings of the mouse
    private static int
    used to invert the settings of the mouse
    private static int
    used to invert the settings of the mouse
    private static int
    used to invert the settings of the mouse
    protected boolean
     
    protected WildMagic.LibGraphics.Rendering.Light[]
    Lights from JPanelLight
    protected boolean
     
    protected boolean
     
    protected boolean
     
    protected boolean
    Change the mouse cursor with the first mouseDrag event
    protected boolean
    Set to true when init() is called:
    protected boolean
    Minimizes rendering, only render when modified is true.
    protected boolean
    keeps track if the user is currently dragging with the mouse
    protected boolean
    Set to true when there is a pending pick operation
    protected boolean
     
    protected boolean
    Set to true when recording.
    protected boolean
    Set to true when the surface mask should be recalculated.
    protected boolean
    Set to true when the surface has been added or modified.
    protected boolean
    For testing the frame rate:
    protected boolean
    Flag for indicating the that Java Container is visible or not:
    protected float
    Normalized volume extents:
    protected float
    Normalized volume extents:
    protected float
    Normalized volume extents:
    protected float
    Normalized volume extents:
    protected int
     
    private int
     
    protected int
    Screen capture counter.
    protected int
    Picking support:
    protected int
    Picking support:
    protected com.jogamp.opengl.util.Animator
    Animator object, displays scene in rendering loop (similar to GLUTMainLoop()
    protected WildMagic.LibGraphics.SceneGraph.Culler
    Culling out-of-view objects:
    protected Vector<VolumeObject>
     
    protected Vector<VolumeObject>
    List of objects displayed in the scene.
    protected WildMagic.LibGraphics.Collision.Picker
    For processing picking:
    protected WildMagic.LibFoundation.Mathematics.Matrix4f
     
    protected WildMagic.LibFoundation.Mathematics.Vector3f
    Scene translation, centers the scene:
    protected VolumeImage
    VolumeImage for ModelImageA, contains data and textures.
    protected VolumeImage
     
    protected VolumeImage
     
    protected VolumeImage
    VolumeImage for ModelImageB, contains data and textures.
    protected VolumeImage
     
    protected VolumeImage
     
    protected WindowLevel
    Window-level interface.
    protected WildMagic.LibFoundation.Mathematics.Matrix3f
    Basic rotations for fixed input use:
    protected WildMagic.LibFoundation.Mathematics.Matrix3f
    Basic rotations for fixed input use:
    protected WildMagic.LibFoundation.Mathematics.Matrix3f
    Basic rotations for fixed input use:
    protected WildMagic.LibGraphics.Rendering.CullState
    Culling: turns backface/frontface culling on/off:
    protected WildMagic.LibGraphics.SceneGraph.Node
    Scene-graph root node:
    private static int
    logical min and max mouse values for calculations, this is the range of the normalized input values
    private static int
    logical min and max mouse values for calculations, this is the range of the normalized input values
    (package private) double
     
    private static double
    used to change the speed that the 3D mouse moves the camera
    protected float
     
    private static int
    used as cutoffs for making space navigator mouse less sensitive to the low range values that may not be intentional user input
    private static float
    used for slowing down the rate that the 3D mouse moves the image
    (package private) double
     
    (package private) double
     
    private static double
    holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    private static double
    holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    private static double
    holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    private static final long
     
    private static float
    actual min and max values for the 3D mouse (the space navigator)
    private static float
    actual min and max values for the 3D mouse (the space navigator)
    private static int
    used as cutoffs for making space navigator mouse less sensitive to the low range values that may not be intentional user input
    private static int
     
    (package private) double
     
    (package private) double
     
    private static double
    holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    private static double
    holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    private static double
    holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    protected boolean
     
    private boolean
     
    private boolean
     
    private static int
    used for fine movement checkbox in 3D mouse options
    (package private) WildMagic.LibFoundation.Mathematics.Vector3f
     
    (package private) float
     
    (package private) float
     
    (package private) float
     

    Fields inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D

    cameraParams, m_akWorldAxis, m_bCameraMoveable, m_bDArrowPressed, m_bEndPressed, m_bHomePressed, m_bLArrowPressed, m_bLInsertPressed, m_bObjectZoomed, m_bPgDnPressed, m_bPgUpPressed, m_bRArrowPressed, m_bRDeletePressed, m_bTrackBallDown, m_bUArrowPressed, m_bUseTrackBall, m_dAccumulatedTime, m_dFrameRate, m_dLastTime, m_fRotSpeed, m_fRotSpeedFactor, m_fTrnSpeed, m_fTrnSpeedFactor, m_fXDrag0, m_fXTrack0, m_fXTrack1, m_fYDrag0, m_fYTrack0, m_fYTrack1, m_fZoomSpeed, m_iAccumulatedFrameCount, m_iDoPitch, m_iDoRoll, m_iDoYaw, m_iFrameCount, m_iMaxTimer, m_iMouseButton, m_iTimer, m_kSaveRotate, m_mouseRotSpeed, m_spkCamera, m_spkMotionObject, pitchRotationAngle, rollRotationAngle, xCameraMove, xCameraTurn, yawRotationAngle, yCameraMove, yCameraTurn, zCameraMove

    Fields inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication

    m_acWindowTitle, m_eBuffering, m_eDepth, m_eFormat, m_eMultisampling, m_eStencil, m_iHeight, m_iWidth, m_iXPosition, m_iYPosition, m_kBackgroundColor, m_pkRenderer
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default GPURenderBase constructor.
    GPURenderBase(VolumeTriPlanarInterface kParent, com.jogamp.opengl.util.Animator kAnimator, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    AddNode(WildMagic.LibGraphics.SceneGraph.Node kNode)
    Add a new scene-graph node to the display list.
    protected static void
     
    void
     
    void
    dispose(com.jogamp.opengl.GLAutoDrawable kDrawable)
    memory cleanup.
    void
    drawText(int x, int y, String message)
     
    static void
     
    com.jogamp.opengl.awt.GLCanvas
    Returns the GLCanvas in the m_pkRenderer object.
    int
     
    Called by the doPick() method in Navigation behavior.
     
    WildMagic.LibGraphics.Rendering.Light[]
     
    float
    Get the near plane
    GetNode(String kSurfaceName)
    Sets blending between imageA and imageB.
    float
    Called by the NavigationBehavior to get normalized bounding box, x dim
    float
    Called by the NavigationBehavior to get normalized bounding box, y dim
    float
    Called by the NavigationBehavior to get normalized bounding box, z dim
    static int
     
    static float
     
    WildMagic.LibFoundation.Mathematics.Matrix3f
     
    WildMagic.LibFoundation.Mathematics.Matrix4f
    Get the world matrix.
    private void
    Helper method sets the values tX, tY, tZ, rX, rY, and rZ to the current space navigator values normalized on a -100 to 100 scale.
    WildMagic.LibFoundation.Mathematics.Vector3f
     
    static int
     
    static int
     
     
     
    static void
     
    static void
     
    static void
     
    static void
     
    static void
     
    static void
     
    boolean
     
    boolean
     
    boolean
     
    void
    Part of the KeyListener interface.
    void
     
    protected void
    Updates the camera and displayed objects for rendering.
    private float
    takes a value from the spaceNavigotorController and normalizes the value between -1 to 1 got formula from http://www.mathworks.com/matlabcentral/newsreader/view_thread/256540
    private double
    normalizeValue(double value, double minValue, double maxValue, double minRange, double maxRange)
    got this formula from the video at http://www.youtube.com/watch?
    static void
     
    void
    pauseAnimator(boolean pause)
     
    private void
     
    void
    Processes a polled event from the space navigator
    void
     
    void
    record(boolean bOn)
     
    void
     
    RemoveNode(String kNodeName)
     
    protected void
    RenderFrameRate(com.jogamp.opengl.GLAutoDrawable kDraw)
    Renders the frame rate to the screen.
    void
    Reset the z-axis.
    void
    Reset x-axis.
    void
     
    void
    Reset y-axis.
    void
    reshape(com.jogamp.opengl.GLAutoDrawable arg0, int iX, int iY, int iWidth, int iHeight)
    Part of the GLEventListener interface.
    private void
     
    private void
     
    private void
     
    void
    Save quick time movie.
    void
    Save AVI movie.
    void
    setCameraNearPlane(float distance)
     
    void
     
    private void
     
    void
    Changes the projection to Orthographic Projection.
    void
    Changes the projection to Perspective Projection.
    static void
     
    static void
    setRotationScaleFactor(float rotationScaleFactor)
    the rotationScaleFactor is used to change how fast the camera moves around the object ranging from 1%, the slowest, to 100%, the fastest
    void
    SetSceneRotation(WildMagic.LibFoundation.Mathematics.Matrix3f kRotation)
     
    static void
     
    static void
    the translationScaleFactor is used to change how fast the camera moves around the object ranging from 1, the fastest, to 10, the slowest
    void
    setUseMouseRotationCutoffs(boolean useMouseRotationCutoffs)
     
    void
    setUseMouseTranslationCutoffs(boolean useMouseTranslationCutoffs)
     
    void
    setVisible(boolean bVisible)
    Sets the currently visible flag.
    void
    startAnimator(boolean bRunFast)
     
    void
    Build a image with the current rotational transformation matrix.
    void
    updateLighting(WildMagic.LibGraphics.Rendering.Light[] akGLights)
    Called from JPanelLight.
    private void
    updateScene(WildMagic.LibFoundation.Mathematics.Matrix3f rotateMatrix)
     
    protected void
    Updates the displayed objects based on any user mouse rotation.
    boolean
    Writes a the frame buffer as a .jpg image to disk.

    Methods inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D

    DrawFrameRate, getCameraLocation, getCameraParameters, getObjectParameters, getObjectRotation, InitializeCameraMotion, InitializeCameraMotion, InitializeObjectMotion, keyReleased, keyTyped, LookDown, LookUp, MeasureTime, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, mouseWheelMoved, MoveBackward, MoveCamera, MoveDown, MoveForward, MoveLeft, MoveObject, MoveRight, MoveUp, OnDisplay, OnInitialize, OnTerminate, ResetTime, RotateTrackBall, setCameraLocation, setCameraParameters, setObjectParameters, setObjectRotation, TurnLeft, TurnRight, UpdateCameraRotationSpeed, UpdateCameraTranslationSpeed, UpdateCameraZoomSpeed, UpdateFrameCount, UpdateMouseRotationSpeed

    Methods inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication

    GetAspectRatio, GetHeight, GetRenderer, GetWidth, GetWindowTitle, GetXPosition, GetYPosition, OnIdle, OnMove, OnPrecreate, OnResize, SetRenderer

    Methods inherited from class WildMagic.LibApplications.OpenGLApplication.Application

    reloadShaders, TestStreaming

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.jogamp.opengl.GLEventListener

    display, init

    Methods inherited from interface java.awt.event.KeyListener

    keyReleased, keyTyped

    Methods inherited from interface java.awt.event.MouseListener

    mouseClicked, mouseEntered, mouseExited, mouseReleased

    Methods inherited from interface java.awt.event.MouseMotionListener

    mouseDragged, mouseMoved
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • m_kVolumeImageA

      protected VolumeImage m_kVolumeImageA
      VolumeImage for ModelImageA, contains data and textures.
    • m_kVolumeImageB

      protected VolumeImage m_kVolumeImageB
      VolumeImage for ModelImageB, contains data and textures.
    • hyperstack

      protected VolumeImage[] hyperstack
    • hyperstackColormap

      protected WildMagic.LibGraphics.Rendering.Texture hyperstackColormap
    • m_kVolumeImageA_Old

      protected VolumeImage m_kVolumeImageA_Old
    • m_kVolumeImageB_Old

      protected VolumeImage m_kVolumeImageB_Old
    • m_kVolumeImageA_New

      protected VolumeImage m_kVolumeImageA_New
    • m_kVolumeImageB_New

      protected VolumeImage m_kVolumeImageB_New
    • m_spkScene

      protected WildMagic.LibGraphics.SceneGraph.Node m_spkScene
      Scene-graph root node:
    • m_spkCull

      protected WildMagic.LibGraphics.Rendering.CullState m_spkCull
      Culling: turns backface/frontface culling on/off:
    • m_kCuller

      protected WildMagic.LibGraphics.SceneGraph.Culler m_kCuller
      Culling out-of-view objects:
    • m_kAnimator

      protected com.jogamp.opengl.util.Animator m_kAnimator
      Animator object, displays scene in rendering loop (similar to GLUTMainLoop()
    • m_bInit

      protected boolean m_bInit
      Set to true when init() is called:
    • m_kTranslate

      protected WildMagic.LibFoundation.Mathematics.Vector3f m_kTranslate
      Scene translation, centers the scene:
    • m_kSceneToWorld

      protected WildMagic.LibFoundation.Mathematics.Matrix4f m_kSceneToWorld
    • m_fX

      protected float m_fX
      Normalized volume extents:
    • m_fY

      protected float m_fY
      Normalized volume extents:
    • m_fZ

      protected float m_fZ
      Normalized volume extents:
    • m_fMax

      protected float m_fMax
      Normalized volume extents:
    • m_bVisible

      protected boolean m_bVisible
      Flag for indicating the that Java Container is visible or not:
    • m_akLights

      protected WildMagic.LibGraphics.Rendering.Light[] m_akLights
      Lights from JPanelLight
    • m_bTestFrameRate

      protected boolean m_bTestFrameRate
      For testing the frame rate:
    • m_kZRotate

      protected WildMagic.LibFoundation.Mathematics.Matrix3f m_kZRotate
      Basic rotations for fixed input use:
    • m_kYRotate

      protected WildMagic.LibFoundation.Mathematics.Matrix3f m_kYRotate
      Basic rotations for fixed input use:
    • m_kXRotate

      protected WildMagic.LibFoundation.Mathematics.Matrix3f m_kXRotate
      Basic rotations for fixed input use:
    • m_kDisplayList

      protected Vector<VolumeObject> m_kDisplayList
      List of objects displayed in the scene.
    • m_bSurfaceUpdate

      protected boolean m_bSurfaceUpdate
      Set to true when the surface has been added or modified.
    • m_bSurfaceMaskUpdate

      protected boolean m_bSurfaceMaskUpdate
      Set to true when the surface mask should be recalculated.
    • m_bExtract

      protected boolean m_bExtract
    • m_bDoClip

      protected boolean m_bDoClip
    • m_iXPick

      protected int m_iXPick
      Picking support:
    • m_iYPick

      protected int m_iYPick
      Picking support:
    • m_bPickPending

      protected boolean m_bPickPending
      Set to true when there is a pending pick operation
    • m_kPicker

      protected WildMagic.LibGraphics.Collision.Picker m_kPicker
      For processing picking:
    • m_bModified

      protected boolean m_bModified
      Minimizes rendering, only render when modified is true.
    • m_iScreenCaptureCounter

      protected int m_iScreenCaptureCounter
      Screen capture counter.
    • m_iMovieCounter

      private int m_iMovieCounter
    • m_bMouseDrag

      protected boolean m_bMouseDrag
      keeps track if the user is currently dragging with the mouse
    • m_bSnapshot

      protected boolean m_bSnapshot
      Set to true when recording.
    • m_iCaptureFPS

      protected int m_iCaptureFPS
    • m_bShared

      protected boolean m_bShared
    • m_kDeleteList

      protected Vector<VolumeObject> m_kDeleteList
    • updateBoundingCube

      protected boolean updateBoundingCube
    • nearPlane

      protected float nearPlane
    • isSpaceNavCodeRunning

      protected boolean isSpaceNavCodeRunning
    • spaceNavMax

      private static float spaceNavMax
      actual min and max values for the 3D mouse (the space navigator)
    • spaceNavMin

      private static float spaceNavMin
      actual min and max values for the 3D mouse (the space navigator)
    • mouseMax

      private static int mouseMax
      logical min and max mouse values for calculations, this is the range of the normalized input values
    • mouseMin

      private static int mouseMin
      logical min and max mouse values for calculations, this is the range of the normalized input values
    • rotationScaleFactor

      private static float rotationScaleFactor
      used for slowing down the rate that the 3D mouse moves the image
    • translationScaleFactor

      private static int translationScaleFactor
    • translationCutoff

      private static int translationCutoff
      used as cutoffs for making space navigator mouse less sensitive to the low range values that may not be intentional user input
    • rotationCutoff

      private static int rotationCutoff
      used as cutoffs for making space navigator mouse less sensitive to the low range values that may not be intentional user input
    • mouseSpeedScaler

      private static double mouseSpeedScaler
      used to change the speed that the 3D mouse moves the camera
    • invertTX

      private static int invertTX
      used to invert the settings of the mouse
    • invertTY

      private static int invertTY
      used to invert the settings of the mouse
    • invertTZ

      private static int invertTZ
      used to invert the settings of the mouse
    • invertRX

      private static int invertRX
      used to invert the settings of the mouse
    • invertRY

      private static int invertRY
      used to invert the settings of the mouse
    • invertRZ

      private static int invertRZ
      used to invert the settings of the mouse
    • zD

      private static int zD
      used for fine movement checkbox in 3D mouse options
    • tX

      private static double tX
      holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    • tY

      private static double tY
      holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    • tZ

      private static double tZ
      holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    • rX

      private static double rX
      holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    • rY

      private static double rY
      holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    • rZ

      private static double rZ
      holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenience
    • m_kWinLevel

      protected WindowLevel m_kWinLevel
      Window-level interface.
    • m_bFirstDrag

      protected boolean m_bFirstDrag
      Change the mouse cursor with the first mouseDrag event
    • useMouseTranslationCutoffs

      private boolean useMouseTranslationCutoffs
    • useMouseRotationCutoffs

      private boolean useMouseRotationCutoffs
    • dpiScale

      protected double dpiScale
    • m_bDispose

      protected boolean m_bDispose
    • defaultVelocityTranslational

      double defaultVelocityTranslational
      3D MOUSE MOTION CONSTANTS
    • transScalar

      double transScalar
    • transPower

      double transPower
    • ZXDistanceStep

      float ZXDistanceStep
    • ZYDistanceStep

      float ZYDistanceStep
    • ZZDistanceStep

      float ZZDistanceStep
    • defaultVelocityRotational

      double defaultVelocityRotational
    • rotScalar

      double rotScalar
    • rotPower

      double rotPower
    • zVector

      WildMagic.LibFoundation.Mathematics.Vector3f zVector
    • currentLocation

      WildMagic.LibFoundation.Mathematics.Vector3f currentLocation
    • mouseRot

      double mouseRot
  • Constructor Details

    • GPURenderBase

      public GPURenderBase()
      Default GPURenderBase constructor.
    • GPURenderBase

      public GPURenderBase(VolumeTriPlanarInterface kParent, com.jogamp.opengl.util.Animator kAnimator, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB)
      Parameters:
      kParent -
      kAnimator -
      kVolumeImageA -
      kVolumeImageB -
  • Method Details

    • AddNode

      public VolumeObject AddNode(WildMagic.LibGraphics.SceneGraph.Node kNode)
      Add a new scene-graph node to the display list.
      Parameters:
      kNode -
    • dispose

      public void dispose()
      Overrides:
      dispose in class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
    • dispose

      public void dispose(com.jogamp.opengl.GLAutoDrawable kDrawable)
      memory cleanup.
      Specified by:
      dispose in interface com.jogamp.opengl.GLEventListener
    • drawText

      public void drawText(int x, int y, String message)
    • GetCanvas

      public com.jogamp.opengl.awt.GLCanvas GetCanvas()
      Returns the GLCanvas in the m_pkRenderer object.
      Returns:
      OpenGLRenderer.GLCanvas
    • getCounter

      public int getCounter()
      Returns:
      current screen capture number.
    • getImage

      public ModelImage getImage()
      Returns:
      ModelImage A.
    • getVolumeImage

      public VolumeImage getVolumeImage()
      Returns:
      ModelImage A.
    • getVolumeImageB

      public VolumeImage getVolumeImageB()
    • GetLights

      public WildMagic.LibGraphics.Rendering.Light[] GetLights()
      Returns:
      the current light configuration.
    • GetNode

      public VolumeNode GetNode(String kSurfaceName)
      Sets blending between imageA and imageB.
      Parameters:
      fValue - the blend value (0-1)
    • getTranslate

      public WildMagic.LibFoundation.Mathematics.Vector3f getTranslate()
      Returns:
      translation vector center of the volume rendered scene.
    • keyPressed

      public void keyPressed(KeyEvent e)
      Part of the KeyListener interface.
      Specified by:
      keyPressed in interface KeyListener
      Overrides:
      keyPressed in class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
      Parameters:
      e - the key event.
    • updateScene

      private void updateScene(WildMagic.LibFoundation.Mathematics.Matrix3f rotateMatrix)
    • record

      public void record(boolean bOn)
    • reInitialize

      public void reInitialize(VolumeImage kImageA, VolumeImage kImageB)
    • RemoveNode

      public VolumeObject RemoveNode(String kNodeName)
    • resetAxis

      public void resetAxis()
      Reset the z-axis.
    • resetAxisX

      public void resetAxisX()
      Reset x-axis.
    • resetAxisXInv

      public void resetAxisXInv()
    • resetAxisY

      public void resetAxisY()
      Reset y-axis.
    • reshape

      public void reshape(com.jogamp.opengl.GLAutoDrawable arg0, int iX, int iY, int iWidth, int iHeight)
      Part of the GLEventListener interface. Called when the GLCanvas is resized.
      Specified by:
      reshape in interface com.jogamp.opengl.GLEventListener
      Parameters:
      arg0 - the GLCanvas
      iX - the new x-position in screen coordinates.
      iY - the new y-position in screen coordinates.
      iWidth - the new width
      iHeight - the new height
    • saveAVIMovie

      public void saveAVIMovie()
      Save quick time movie.
    • saveQuickTimeMovie

      public void saveQuickTimeMovie()
      Save AVI movie.
    • setCameraNearPlane

      public void setCameraNearPlane(float distance)
    • getNearPlane

      public float getNearPlane()
      Get the near plane
    • setOrthographicProjection

      public void setOrthographicProjection()
      Changes the projection to Orthographic Projection.
    • setPerspectiveProjection

      public void setPerspectiveProjection()
      Changes the projection to Perspective Projection.
    • setVisible

      public void setVisible(boolean bVisible)
      Sets the currently visible flag. Used when the GLCanvas is removed from the display panel or frame.
      Parameters:
      bVisible - set to false when the GLCanvas container is not displayed.
    • isVisible

      public boolean isVisible()
    • startAnimator

      public void startAnimator(boolean bRunFast)
    • pauseAnimator

      public void pauseAnimator(boolean pause)
    • updateImageFromRotation

      public void updateImageFromRotation()
      Build a image with the current rotational transformation matrix. Step.1 convert the java3D transform matrix into a quaternion component. Step.2 convert the quaternion into image( our world ) coordinate system. Step.3 convert the quaternion into a rotatin matrix. Quaternion q ( w, x, y, z ): rotation of w around the vector ( x, y, z ); Convert the quaternion into a rotation matrix. / \ | 1-2*y^2-2*z^2 2*x*y-2*w*z 2*x*z+2*w*y | | 2*xy+2*w*z 1-2*x^2-2*z^2 2*y*z-2*w*x | | 2*x*z-2*w*y 2*y*z+2*w*x 1-2*x^2-2*y^2 | \ / Step.4 Calling the transform algorithm to extract the image.
    • setDefaultLighting

      public void setDefaultLighting()
    • updateLighting

      public void updateLighting(WildMagic.LibGraphics.Rendering.Light[] akGLights)
      Called from JPanelLight. Updates the lighting parameters.
      Parameters:
      akGLights - the set of GeneralLight objects.
    • writeImage

      public boolean writeImage()
      Writes a the frame buffer as a .jpg image to disk. The file name is captureImage + the image number.
      Returns:
      true on successful write.
    • GetSceneRotation

      public WildMagic.LibFoundation.Mathematics.Matrix3f GetSceneRotation()
    • Move

      protected void Move()
      Updates the camera and displayed objects for rendering.
    • RenderFrameRate

      protected void RenderFrameRate(com.jogamp.opengl.GLAutoDrawable kDraw)
      Renders the frame rate to the screen.
    • SetSceneRotation

      public void SetSceneRotation(WildMagic.LibFoundation.Mathematics.Matrix3f kRotation)
    • UpdateSceneRotation

      protected void UpdateSceneRotation()
      Updates the displayed objects based on any user mouse rotation.
    • getDisplayList

      public Vector<VolumeObject> getDisplayList()
      Called by the doPick() method in Navigation behavior.
      Returns:
      the display list
    • getNormalizedXDim

      public float getNormalizedXDim()
      Called by the NavigationBehavior to get normalized bounding box, x dim
      Returns:
      normalized bounding box x component.
    • getNormalizedYDim

      public float getNormalizedYDim()
      Called by the NavigationBehavior to get normalized bounding box, y dim
      Returns:
      normalized bounding box y component.
    • getNormalizedZDim

      public float getNormalizedZDim()
      Called by the NavigationBehavior to get normalized bounding box, z dim
      Returns:
      normalized bounding box z component.
    • getSceneToWorldMatrix

      public WildMagic.LibFoundation.Mathematics.Matrix4f getSceneToWorldMatrix()
      Get the world matrix.
      Returns:
      world matrix
    • processSpaceNavEvent

      public void processSpaceNavEvent()
      Description copied from interface: SpaceNavigatorListener
      Processes a polled event from the space navigator
      Specified by:
      processSpaceNavEvent in interface SpaceNavigatorListener
    • rotateAboutXAxis

      private void rotateAboutXAxis()
    • rotateAboutYAxis

      private void rotateAboutYAxis()
    • rotateAboutZAxis

      private void rotateAboutZAxis()
    • setMouseSpeedModifier

      private void setMouseSpeedModifier()
    • processSpaceNavEvent

      public void processSpaceNavEvent(SpaceNavigatorEvent e)
      Specified by:
      processSpaceNavEvent in interface SpaceNavigatorListener
    • mousePressed

      public void mousePressed(MouseEvent e)
      Specified by:
      mousePressed in interface MouseListener
      Overrides:
      mousePressed in class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
    • normalizeSpaceNavValue

      private float normalizeSpaceNavValue(float value)
      takes a value from the spaceNavigotorController and normalizes the value between -1 to 1 got formula from http://www.mathworks.com/matlabcentral/newsreader/view_thread/256540
      Parameters:
      value -
      Returns:
    • normalizeValue

      private double normalizeValue(double value, double minValue, double maxValue, double minRange, double maxRange)
      got this formula from the video at http://www.youtube.com/watch?v=7DQMAXaiXmk
      Parameters:
      value -
      minValue -
      maxValue -
      minRange -
      maxRange -
      Returns:
    • printSpaceNavData

      private void printSpaceNavData()
    • checkIfSpaceNavNeedsCalibration

      protected static void checkIfSpaceNavNeedsCalibration()
    • invertRX

      public static void invertRX()
    • invertRY

      public static void invertRY()
    • invertRZ

      public static void invertRZ()
    • invertTX

      public static void invertTX()
    • invertTY

      public static void invertTY()
    • invertTZ

      public static void invertTZ()
    • fineMovement

      public static void fineMovement()
    • normalMovement

      public static void normalMovement()
    • getSpaceNavValues

      private void getSpaceNavValues()
      Helper method sets the values tX, tY, tZ, rX, rY, and rZ to the current space navigator values normalized on a -100 to 100 scale. This is done to make coding cross platform values easier by making them uniform across platforms.
    • setTranslationCutoffValue

      public static void setTranslationCutoffValue(int value)
    • getTranslationCutoffValue

      public static int getTranslationCutoffValue()
    • setRotationCutoffValue

      public static void setRotationCutoffValue(int value)
    • getRotationCutoffValue

      public static int getRotationCutoffValue()
    • getTranslationScaleFactor

      public static int getTranslationScaleFactor()
    • setTranslationScaleFactor

      public static void setTranslationScaleFactor(int i)
      the translationScaleFactor is used to change how fast the camera moves around the object ranging from 1, the fastest, to 10, the slowest
    • isUseMouseTranslationCutoffs

      public boolean isUseMouseTranslationCutoffs()
    • setUseMouseTranslationCutoffs

      public void setUseMouseTranslationCutoffs(boolean useMouseTranslationCutoffs)
    • isUseMouseRotationCutoffs

      public boolean isUseMouseRotationCutoffs()
    • setUseMouseRotationCutoffs

      public void setUseMouseRotationCutoffs(boolean useMouseRotationCutoffs)
    • getRotationScaleFactor

      public static float getRotationScaleFactor()
    • setRotationScaleFactor

      public static void setRotationScaleFactor(float rotationScaleFactor)
      the rotationScaleFactor is used to change how fast the camera moves around the object ranging from 1%, the slowest, to 100%, the fastest
      Parameters:
      rotationScaleFactor - - value must be between 0.0f and 1.0f representing the percentage to scale the raw input speed