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.Vector3f
currentLocation
(package private) double
defaultVelocityRotational
(package private) double
defaultVelocityTranslational
3D MOUSE MOTION CONSTANTSprotected double
dpiScale
protected VolumeImage[]
hyperstack
protected WildMagic.LibGraphics.Rendering.Texture
hyperstackColormap
private static int
invertRX
used to invert the settings of the mouseprivate static int
invertRY
used to invert the settings of the mouseprivate static int
invertRZ
used to invert the settings of the mouseprivate static int
invertTX
used to invert the settings of the mouseprivate static int
invertTY
used to invert the settings of the mouseprivate static int
invertTZ
used to invert the settings of the mouseprotected boolean
isSpaceNavCodeRunning
protected WildMagic.LibGraphics.Rendering.Light[]
m_akLights
Lights from JPanelLightprotected boolean
m_bDispose
protected boolean
m_bDoClip
protected boolean
m_bExtract
protected boolean
m_bFirstDrag
Change the mouse cursor with the first mouseDrag eventprotected boolean
m_bInit
Set to true when init() is called:protected boolean
m_bModified
Minimizes rendering, only render when modified is true.protected boolean
m_bMouseDrag
keeps track if the user is currently dragging with the mouseprotected boolean
m_bPickPending
Set to true when there is a pending pick operationprotected boolean
m_bShared
protected boolean
m_bSnapshot
Set to true when recording.protected boolean
m_bSurfaceMaskUpdate
Set to true when the surface mask should be recalculated.protected boolean
m_bSurfaceUpdate
Set to true when the surface has been added or modified.protected boolean
m_bTestFrameRate
For testing the frame rate:protected boolean
m_bVisible
Flag for indicating the that Java Container is visible or not:protected float
m_fMax
Normalized volume extents:protected float
m_fX
Normalized volume extents:protected float
m_fY
Normalized volume extents:protected float
m_fZ
Normalized volume extents:protected int
m_iCaptureFPS
private int
m_iMovieCounter
protected int
m_iScreenCaptureCounter
Screen capture counter.protected int
m_iXPick
Picking support:protected int
m_iYPick
Picking support:protected com.jogamp.opengl.util.Animator
m_kAnimator
Animator object, displays scene in rendering loop (similar to GLUTMainLoop()protected WildMagic.LibGraphics.SceneGraph.Culler
m_kCuller
Culling out-of-view objects:protected java.util.Vector<VolumeObject>
m_kDeleteList
protected java.util.Vector<VolumeObject>
m_kDisplayList
List of objects displayed in the scene.protected WildMagic.LibGraphics.Collision.Picker
m_kPicker
For processing picking:protected WildMagic.LibFoundation.Mathematics.Matrix4f
m_kSceneToWorld
protected WildMagic.LibFoundation.Mathematics.Vector3f
m_kTranslate
Scene translation, centers the scene:protected VolumeImage
m_kVolumeImageA
VolumeImage for ModelImageA, contains data and textures.protected VolumeImage
m_kVolumeImageA_New
protected VolumeImage
m_kVolumeImageA_Old
protected VolumeImage
m_kVolumeImageB
VolumeImage for ModelImageB, contains data and textures.protected VolumeImage
m_kVolumeImageB_New
protected VolumeImage
m_kVolumeImageB_Old
protected WindowLevel
m_kWinLevel
Window-level interface.protected WildMagic.LibFoundation.Mathematics.Matrix3f
m_kXRotate
Basic rotations for fixed input use:protected WildMagic.LibFoundation.Mathematics.Matrix3f
m_kYRotate
Basic rotations for fixed input use:protected WildMagic.LibFoundation.Mathematics.Matrix3f
m_kZRotate
Basic rotations for fixed input use:protected WildMagic.LibGraphics.Rendering.CullState
m_spkCull
Culling: turns backface/frontface culling on/off:protected WildMagic.LibGraphics.SceneGraph.Node
m_spkScene
Scene-graph root node:private static int
mouseMax
logical min and max mouse values for calculations, this is the range of the normalized input valuesprivate static int
mouseMin
logical min and max mouse values for calculations, this is the range of the normalized input values(package private) double
mouseRot
private static double
mouseSpeedScaler
used to change the speed that the 3D mouse moves the cameraprotected float
nearPlane
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 inputprivate static float
rotationScaleFactor
used for slowing down the rate that the 3D mouse moves the image(package private) double
rotPower
(package private) double
rotScalar
private static double
rX
holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprivate static double
rY
holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprivate static double
rZ
holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprivate static long
serialVersionUID
private static float
spaceNavMax
actual min and max values for the 3D mouse (the space navigator)private static float
spaceNavMin
actual min and max values for the 3D mouse (the space navigator)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 inputprivate static int
translationScaleFactor
(package private) double
transPower
(package private) double
transScalar
private static double
tX
holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprivate static double
tY
holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprivate static double
tZ
holds the current value of the space navigator. normalized on a -100 to 100 scale for cross platform/calculating convenienceprotected boolean
updateBoundingCube
private boolean
useMouseRotationCutoffs
private boolean
useMouseTranslationCutoffs
private static int
zD
used for fine movement checkbox in 3D mouse options(package private) WildMagic.LibFoundation.Mathematics.Vector3f
zVector
(package private) float
ZXDistanceStep
(package private) float
ZYDistanceStep
(package private) float
ZZDistanceStep
-
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 VolumeObject
AddNode(WildMagic.LibGraphics.SceneGraph.Node kNode)
Add a new scene-graph node to the display list.protected static void
checkIfSpaceNavNeedsCalibration()
void
dispose()
void
dispose(com.jogamp.opengl.GLAutoDrawable kDrawable)
memory cleanup.void
drawText(int x, int y, java.lang.String message)
static void
fineMovement()
com.jogamp.opengl.awt.GLCanvas
GetCanvas()
Returns the GLCanvas in the m_pkRenderer object.int
getCounter()
java.util.Vector<VolumeObject>
getDisplayList()
Called by the doPick() method in Navigation behavior.ModelImage
getImage()
WildMagic.LibGraphics.Rendering.Light[]
GetLights()
float
getNearPlane()
Get the near planeVolumeNode
GetNode(java.lang.String kSurfaceName)
Sets blending between imageA and imageB.float
getNormalizedXDim()
Called by the NavigationBehavior to get normalized bounding box, x dimfloat
getNormalizedYDim()
Called by the NavigationBehavior to get normalized bounding box, y dimfloat
getNormalizedZDim()
Called by the NavigationBehavior to get normalized bounding box, z dimstatic int
getRotationCutoffValue()
static float
getRotationScaleFactor()
WildMagic.LibFoundation.Mathematics.Matrix3f
GetSceneRotation()
WildMagic.LibFoundation.Mathematics.Matrix4f
getSceneToWorldMatrix()
Get the world matrix.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.WildMagic.LibFoundation.Mathematics.Vector3f
getTranslate()
static int
getTranslationCutoffValue()
static int
getTranslationScaleFactor()
VolumeImage
getVolumeImage()
VolumeImage
getVolumeImageB()
static void
invertRX()
static void
invertRY()
static void
invertRZ()
static void
invertTX()
static void
invertTY()
static void
invertTZ()
boolean
isUseMouseRotationCutoffs()
boolean
isUseMouseTranslationCutoffs()
boolean
isVisible()
void
keyPressed(java.awt.event.KeyEvent e)
Part of the KeyListener interface.void
mousePressed(java.awt.event.MouseEvent e)
protected void
Move()
Updates the camera and displayed objects for rendering.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/256540private 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
normalMovement()
void
pauseAnimator(boolean pause)
private void
printSpaceNavData()
void
processSpaceNavEvent()
Processes a polled event from the space navigatorvoid
processSpaceNavEvent(SpaceNavigatorEvent e)
void
record(boolean bOn)
void
reInitialize(VolumeImage kImageA, VolumeImage kImageB)
VolumeObject
RemoveNode(java.lang.String kNodeName)
protected void
RenderFrameRate(com.jogamp.opengl.GLAutoDrawable kDraw)
Renders the frame rate to the screen.void
resetAxis()
Reset the z-axis.void
resetAxisX()
Reset x-axis.void
resetAxisXInv()
void
resetAxisY()
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
rotateAboutXAxis()
private void
rotateAboutYAxis()
private void
rotateAboutZAxis()
void
saveAVIMovie()
Save quick time movie.void
saveQuickTimeMovie()
Save AVI movie.void
setCameraNearPlane(float distance)
void
setDefaultLighting()
private void
setMouseSpeedModifier()
void
setOrthographicProjection()
Changes the projection to Orthographic Projection.void
setPerspectiveProjection()
Changes the projection to Perspective Projection.static void
setRotationCutoffValue(int value)
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 fastestvoid
SetSceneRotation(WildMagic.LibFoundation.Mathematics.Matrix3f kRotation)
static void
setTranslationCutoffValue(int value)
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 slowestvoid
setUseMouseRotationCutoffs(boolean useMouseRotationCutoffs)
void
setUseMouseTranslationCutoffs(boolean useMouseTranslationCutoffs)
void
setVisible(boolean bVisible)
Sets the currently visible flag.void
startAnimator(boolean bRunFast)
void
updateImageFromRotation()
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
UpdateSceneRotation()
Updates the displayed objects based on any user mouse rotation.boolean
writeImage()
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:
dispose
in classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
dispose
public void dispose(com.jogamp.opengl.GLAutoDrawable kDrawable)
memory cleanup.- Specified by:
dispose
in 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:
keyPressed
in interfacejava.awt.event.KeyListener
- Overrides:
keyPressed
in 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:
reshape
in 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:SpaceNavigatorListener
Processes a polled event from the space navigator- Specified by:
processSpaceNavEvent
in 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:
processSpaceNavEvent
in interfaceSpaceNavigatorListener
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in 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
-
-