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,java.awt.event.KeyListener,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.awt.event.MouseWheelListener,java.io.Serializable,java.util.EventListener
- Direct Known Subclasses:
CorticalAnalysisRender,FlyThroughRender,PlaneRender_WM,PlaneRenderProstate,VolumeTriPlanarRenderBase
public abstract class GPURenderBase extends WildMagic.LibApplications.OpenGLApplication.JavaApplication3D implements com.jogamp.opengl.GLEventListener, java.awt.event.KeyListener, java.awt.event.MouseMotionListener, java.awt.event.MouseListener, SpaceNavigatorListener
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) WildMagic.LibFoundation.Mathematics.Vector3fcurrentLocation(package private) doubledefaultVelocityRotational(package private) doubledefaultVelocityTranslational3D MOUSE MOTION CONSTANTSprotected doubledpiScaleprotected VolumeImage[]hyperstackprotected WildMagic.LibGraphics.Rendering.TexturehyperstackColormapprivate static intinvertRXused to invert the settings of the mouseprivate static intinvertRYused to invert the settings of the mouseprivate static intinvertRZused to invert the settings of the mouseprivate static intinvertTXused to invert the settings of the mouseprivate static intinvertTYused to invert the settings of the mouseprivate static intinvertTZused to invert the settings of the mouseprotected booleanisSpaceNavCodeRunningprotected WildMagic.LibGraphics.Rendering.Light[]m_akLightsLights from JPanelLightprotected booleanm_bDisposeprotected booleanm_bDoClipprotected booleanm_bExtractprotected booleanm_bFirstDragChange the mouse cursor with the first mouseDrag eventprotected booleanm_bInitSet to true when init() is called:protected booleanm_bModifiedMinimizes rendering, only render when modified is true.protected booleanm_bMouseDragkeeps track if the user is currently dragging with the mouseprotected booleanm_bPickPendingSet to true when there is a pending pick operationprotected booleanm_bSharedprotected booleanm_bSnapshotSet to true when recording.protected booleanm_bSurfaceMaskUpdateSet to true when the surface mask should be recalculated.protected booleanm_bSurfaceUpdateSet to true when the surface has been added or modified.protected booleanm_bTestFrameRateFor testing the frame rate:protected booleanm_bVisibleFlag for indicating the that Java Container is visible or not:protected floatm_fMaxNormalized volume extents:protected floatm_fXNormalized volume extents:protected floatm_fYNormalized volume extents:protected floatm_fZNormalized volume extents:protected intm_iCaptureFPSprivate intm_iMovieCounterprotected intm_iScreenCaptureCounterScreen capture counter.protected intm_iXPickPicking support:protected intm_iYPickPicking support:protected com.jogamp.opengl.util.Animatorm_kAnimatorAnimator object, displays scene in rendering loop (similar to GLUTMainLoop()protected WildMagic.LibGraphics.SceneGraph.Cullerm_kCullerCulling out-of-view objects:protected java.util.Vector<VolumeObject>m_kDeleteListprotected java.util.Vector<VolumeObject>m_kDisplayListList of objects displayed in the scene.protected WildMagic.LibGraphics.Collision.Pickerm_kPickerFor processing picking:protected WildMagic.LibFoundation.Mathematics.Matrix4fm_kSceneToWorldprotected WildMagic.LibFoundation.Mathematics.Vector3fm_kTranslateScene translation, centers the scene:protected VolumeImagem_kVolumeImageAVolumeImage for ModelImageA, contains data and textures.protected VolumeImagem_kVolumeImageA_Newprotected VolumeImagem_kVolumeImageA_Oldprotected VolumeImagem_kVolumeImageBVolumeImage for ModelImageB, contains data and textures.protected VolumeImagem_kVolumeImageB_Newprotected VolumeImagem_kVolumeImageB_Oldprotected WindowLevelm_kWinLevelWindow-level interface.protected WildMagic.LibFoundation.Mathematics.Matrix3fm_kXRotateBasic rotations for fixed input use:protected WildMagic.LibFoundation.Mathematics.Matrix3fm_kYRotateBasic rotations for fixed input use:protected WildMagic.LibFoundation.Mathematics.Matrix3fm_kZRotateBasic rotations for fixed input use:protected WildMagic.LibGraphics.Rendering.CullStatem_spkCullCulling: turns backface/frontface culling on/off:protected WildMagic.LibGraphics.SceneGraph.Nodem_spkSceneScene-graph root node:private static intmouseMaxlogical min and max mouse values for calculations, this is the range of the normalized input valuesprivate static intmouseMinlogical min and max mouse values for calculations, this is the range of the normalized input values(package private) doublemouseRotprivate static doublemouseSpeedScalerused to change the speed that the 3D mouse moves the cameraprotected floatnearPlaneprivate static introtationCutoffused as cutoffs for making space navigator mouse less sensitive to the low range values that may not be intentional user inputprivate static floatrotationScaleFactorused for slowing down the rate that the 3D mouse moves the image(package private) doublerotPower(package private) doublerotScalarprivate static doublerXholds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprivate static doublerYholds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprivate static doublerZholds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprivate static longserialVersionUIDprivate static floatspaceNavMaxactual min and max values for the 3D mouse (the space navigator)private static floatspaceNavMinactual min and max values for the 3D mouse (the space navigator)private static inttranslationCutoffused as cutoffs for making space navigator mouse less sensitive to the low range values that may not be intentional user inputprivate static inttranslationScaleFactor(package private) doubletransPower(package private) doubletransScalarprivate static doubletXholds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprivate static doubletYholds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprivate static doubletZholds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprotected booleanupdateBoundingCubeprivate booleanuseMouseRotationCutoffsprivate booleanuseMouseTranslationCutoffsprivate static intzDused for fine movement checkbox in 3D mouse options(package private) WildMagic.LibFoundation.Mathematics.Vector3fzVector(package private) floatZXDistanceStep(package private) floatZYDistanceStep(package private) floatZZDistanceStep-
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
-
-
Constructor Summary
Constructors Constructor Description GPURenderBase()Default GPURenderBase constructor.GPURenderBase(VolumeTriPlanarInterface kParent, com.jogamp.opengl.util.Animator kAnimator, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VolumeObjectAddNode(WildMagic.LibGraphics.SceneGraph.Node kNode)Add a new scene-graph node to the display list.protected static voidcheckIfSpaceNavNeedsCalibration()voiddispose()voiddispose(com.jogamp.opengl.GLAutoDrawable kDrawable)memory cleanup.voiddrawText(int x, int y, java.lang.String message)static voidfineMovement()com.jogamp.opengl.awt.GLCanvasGetCanvas()Returns the GLCanvas in the m_pkRenderer object.intgetCounter()java.util.Vector<VolumeObject>getDisplayList()Called by the doPick() method in Navigation behavior.ModelImagegetImage()WildMagic.LibGraphics.Rendering.Light[]GetLights()floatgetNearPlane()Get the near planeVolumeNodeGetNode(java.lang.String kSurfaceName)Sets blending between imageA and imageB.floatgetNormalizedXDim()Called by the NavigationBehavior to get normalized bounding box, x dimfloatgetNormalizedYDim()Called by the NavigationBehavior to get normalized bounding box, y dimfloatgetNormalizedZDim()Called by the NavigationBehavior to get normalized bounding box, z dimstatic intgetRotationCutoffValue()static floatgetRotationScaleFactor()WildMagic.LibFoundation.Mathematics.Matrix3fGetSceneRotation()WildMagic.LibFoundation.Mathematics.Matrix4fgetSceneToWorldMatrix()Get the world matrix.private voidgetSpaceNavValues()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.Vector3fgetTranslate()static intgetTranslationCutoffValue()static intgetTranslationScaleFactor()VolumeImagegetVolumeImage()VolumeImagegetVolumeImageB()static voidinvertRX()static voidinvertRY()static voidinvertRZ()static voidinvertTX()static voidinvertTY()static voidinvertTZ()booleanisUseMouseRotationCutoffs()booleanisUseMouseTranslationCutoffs()booleanisVisible()voidkeyPressed(java.awt.event.KeyEvent e)Part of the KeyListener interface.voidmousePressed(java.awt.event.MouseEvent e)protected voidMove()Updates the camera and displayed objects for rendering.private floatnormalizeSpaceNavValue(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/256540private doublenormalizeValue(double value, double minValue, double maxValue, double minRange, double maxRange)got this formula from the video at http://www.youtube.com/watch?static voidnormalMovement()voidpauseAnimator(boolean pause)private voidprintSpaceNavData()voidprocessSpaceNavEvent()Processes a polled event from the space navigatorvoidprocessSpaceNavEvent(SpaceNavigatorEvent e)voidrecord(boolean bOn)voidreInitialize(VolumeImage kImageA, VolumeImage kImageB)VolumeObjectRemoveNode(java.lang.String kNodeName)protected voidRenderFrameRate(com.jogamp.opengl.GLAutoDrawable kDraw)Renders the frame rate to the screen.voidresetAxis()Reset the z-axis.voidresetAxisX()Reset x-axis.voidresetAxisXInv()voidresetAxisY()Reset y-axis.voidreshape(com.jogamp.opengl.GLAutoDrawable arg0, int iX, int iY, int iWidth, int iHeight)Part of the GLEventListener interface.private voidrotateAboutXAxis()private voidrotateAboutYAxis()private voidrotateAboutZAxis()voidsaveAVIMovie()Save quick time movie.voidsaveQuickTimeMovie()Save AVI movie.voidsetCameraNearPlane(float distance)voidsetDefaultLighting()private voidsetMouseSpeedModifier()voidsetOrthographicProjection()Changes the projection to Orthographic Projection.voidsetPerspectiveProjection()Changes the projection to Perspective Projection.static voidsetRotationCutoffValue(int value)static voidsetRotationScaleFactor(float rotationScaleFactor)the rotationScaleFactor is used to change how fast the camera moves around the object ranging from 1%, the slowest, to 100%, the fastestvoidSetSceneRotation(WildMagic.LibFoundation.Mathematics.Matrix3f kRotation)static voidsetTranslationCutoffValue(int value)static voidsetTranslationScaleFactor(int i)the translationScaleFactor is used to change how fast the camera moves around the object ranging from 1, the fastest, to 10, the slowestvoidsetUseMouseRotationCutoffs(boolean useMouseRotationCutoffs)voidsetUseMouseTranslationCutoffs(boolean useMouseTranslationCutoffs)voidsetVisible(boolean bVisible)Sets the currently visible flag.voidstartAnimator(boolean bRunFast)voidupdateImageFromRotation()Build a image with the current rotational transformation matrix.voidupdateLighting(WildMagic.LibGraphics.Rendering.Light[] akGLights)Called from JPanelLight.private voidupdateScene(WildMagic.LibFoundation.Mathematics.Matrix3f rotateMatrix)protected voidUpdateSceneRotation()Updates the displayed objects based on any user mouse rotation.booleanwriteImage()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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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 java.util.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 java.util.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 Detail
-
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 Detail
-
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:
disposein classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
dispose
public void dispose(com.jogamp.opengl.GLAutoDrawable kDrawable)
memory cleanup.- Specified by:
disposein interfacecom.jogamp.opengl.GLEventListener
-
drawText
public void drawText(int x, int y, java.lang.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(java.lang.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(java.awt.event.KeyEvent e)
Part of the KeyListener interface.- Specified by:
keyPressedin interfacejava.awt.event.KeyListener- Overrides:
keyPressedin classWildMagic.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(java.lang.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:
reshapein interfacecom.jogamp.opengl.GLEventListener- Parameters:
arg0- the GLCanvasiX- the new x-position in screen coordinates.iY- the new y-position in screen coordinates.iWidth- the new widthiHeight- 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 java.util.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:SpaceNavigatorListenerProcesses a polled event from the space navigator- Specified by:
processSpaceNavEventin interfaceSpaceNavigatorListener
-
rotateAboutXAxis
private void rotateAboutXAxis()
-
rotateAboutYAxis
private void rotateAboutYAxis()
-
rotateAboutZAxis
private void rotateAboutZAxis()
-
setMouseSpeedModifier
private void setMouseSpeedModifier()
-
processSpaceNavEvent
public void processSpaceNavEvent(SpaceNavigatorEvent e)
- Specified by:
processSpaceNavEventin interfaceSpaceNavigatorListener
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressedin interfacejava.awt.event.MouseListener- Overrides:
mousePressedin classWildMagic.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
-
-