Class VolumeVOI
- java.lang.Object
-
- gov.nih.mipav.view.renderer.WildMagic.Render.VolumeObject
-
- gov.nih.mipav.view.renderer.WildMagic.Render.VolumeVOI
-
public class VolumeVOI extends VolumeObject
Displays the VOIBase in the GPU-based VolumeRenderer. Creates the shaders and rendering states necessary for rendering and blending with the volume.
-
-
Field Summary
Fields Modifier and Type Field Description private int
annotationHeight
private byte[][]
annotationTexture
private int
annotationWidth
private boolean
m_bClipped
private boolean
m_bClippedA
private boolean
m_bShowText
private boolean
m_bUpdateDisplay
private float
m_fAnnotationScale
private float
m_fOpacity
private WildMagic.LibFoundation.Mathematics.Vector3f
m_kBillboardPos
private WildMagic.LibFoundation.Mathematics.Vector3f
m_kClip
Sets the Color.private WildMagic.LibFoundation.Mathematics.Vector3f
m_kClipInv
private WildMagic.LibFoundation.Mathematics.ColorRGB
m_kColor
private VolumeVOIEffect
m_kTextEffect
private VOIBase
m_kVOI
private WildMagic.LibGraphics.SceneGraph.Polyline
m_kVOILine
private VolumePreRenderEffect
m_kVOIPreShader
private VolumeVOIEffect
m_kVOIShader
private WildMagic.LibGraphics.SceneGraph.Polyline
m_kVOITicMarks
private WildMagic.LibFoundation.Mathematics.Vector3f
m_kVolumeScale
private WildMagic.LibGraphics.Rendering.ZBufferState
m_kZState
private boolean
volumeClip
private float
volumeClipRadius
-
Fields inherited from class gov.nih.mipav.view.renderer.WildMagic.Render.VolumeObject
m_bDisplay, m_bPickable, m_bTransparent, m_fVolumeDiv, m_fVolumeMult, m_fX, m_fY, m_fZ, m_kAlpha, m_kAlphaTransparency, m_kCull, m_kDeleteList, m_kLightShader, m_kLocalScale, m_kPolygonOffset, m_kResolutions, m_kScene, m_kTranslate, m_kVolumeImageA, m_kVolumeImageB, m_kVolumeTrans, m_kWireframe, m_kZBuffer, m_kZBufferTransparency
-
-
Constructor Summary
Constructors Constructor Description VolumeVOI(VolumeImage kImageA, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, VOIBase kVOI, WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
Constructor for the VolumeVOI object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
Delete local memory.WildMagic.LibFoundation.Mathematics.Vector3f
GetBillboardPosition()
boolean
GetClipped()
float
GetClipRadius()
WildMagic.LibFoundation.Mathematics.ColorRGBA
getColor()
Returns the current color of the VOI.private int
getCoords(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd, float fraction, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer, int iPos)
Sets up the line annotations.float
getDepth(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)
private int
getEndLines(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer, int iPos)
Sets up the line annotations for the end-points of the line (arrows).private int
getEndLines2(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer, int iPos)
Sets up the protractor annotations for the end-points of the protractor (arrows).java.lang.String
GetName()
Return the name of this object.VOIBase
getVOI()
Returns the VOIBase object rendered by this VolumVOI object.private void
lineAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd)
Creates the line annotations.boolean
needsUpdate()
void
needsUpdate(boolean update)
private void
protractorAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kMiddle, WildMagic.LibFoundation.Mathematics.Vector3f kEnd)
Creates the protractor annotations.void
Render(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)
Render the object.private void
renderAnnotationToTexture(VOIText text)
private void
scaleVOI()
Creates the scene graph for displaying the VOIBase object.void
SetBillboardPosition(WildMagic.LibFoundation.Mathematics.Vector3f volumePt)
void
setBlend(float fBlend)
Sets the transparency.void
SetClip(int iWhich, float data, boolean bEnable)
Sets axis-aligned clipping for the VolumeShaderEffect.void
SetClipArb(float[] afEquation, float[] afEquationInv, boolean bEnable)
void
SetClipEye(float[] afEquation, boolean bEnable)
void
SetClipEyeInv(float[] afEquation, boolean bEnable)
void
setSlice(boolean bUseSlice, int iWhichSlice, float fSlice)
Sets the slice information for the shader.void
setVOI(VOIBase kVOI)
Sets and updates the VOIBase displayed by this VolumeVOI.void
setVOI(VOIBase kVOI, boolean bForceReload)
Sets and updates the VOIBase displayed by this VolumeVOI.void
setVolumeClip(boolean clip)
void
setVolumeClipRadius(float radius)
void
setZCompare(boolean bOn)
Turns the ZBufferState compare mode on or off.void
showTextBox(boolean bShow)
Turns displaying the text on or off.private void
textAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd)
Creates the text annotations (arrow)void
update(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
Set the color of the VolumeVOI object.void
updateText()
-
Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.Render.VolumeObject
Blend, Dropper, Erase, GetBackface, GetDisplay, GetMesh, GetPickable, GetPolygonMode, GetScene, getTexCoord, GetTranslate, localToScannerCoords, localToVolumeCoords, Paint, PostRender, scale, SetBackface, SetColor, SetDisplay, SetFrontface, setImageB, SetLight, SetPickable, SetPolygonMode, SetTranslate, Translate, volumeToLocalCoords
-
-
-
-
Field Detail
-
m_kVOI
private VOIBase m_kVOI
-
m_kVOILine
private WildMagic.LibGraphics.SceneGraph.Polyline m_kVOILine
-
m_kVOITicMarks
private WildMagic.LibGraphics.SceneGraph.Polyline m_kVOITicMarks
-
m_kVOIShader
private VolumeVOIEffect m_kVOIShader
-
m_kVOIPreShader
private VolumePreRenderEffect m_kVOIPreShader
-
m_kZState
private WildMagic.LibGraphics.Rendering.ZBufferState m_kZState
-
m_kVolumeScale
private WildMagic.LibFoundation.Mathematics.Vector3f m_kVolumeScale
-
m_kColor
private WildMagic.LibFoundation.Mathematics.ColorRGB m_kColor
-
m_fOpacity
private float m_fOpacity
-
m_kTextEffect
private VolumeVOIEffect m_kTextEffect
-
m_fAnnotationScale
private float m_fAnnotationScale
-
m_kBillboardPos
private WildMagic.LibFoundation.Mathematics.Vector3f m_kBillboardPos
-
m_bShowText
private boolean m_bShowText
-
m_bUpdateDisplay
private boolean m_bUpdateDisplay
-
annotationTexture
private byte[][] annotationTexture
-
annotationWidth
private int annotationWidth
-
annotationHeight
private int annotationHeight
-
volumeClip
private boolean volumeClip
-
volumeClipRadius
private float volumeClipRadius
-
m_kClip
private WildMagic.LibFoundation.Mathematics.Vector3f m_kClip
Sets the Color.
-
m_kClipInv
private WildMagic.LibFoundation.Mathematics.Vector3f m_kClipInv
-
m_bClipped
private boolean m_bClipped
-
m_bClippedA
private boolean m_bClippedA
-
-
Constructor Detail
-
VolumeVOI
public VolumeVOI(VolumeImage kImageA, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, VOIBase kVOI, WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
Constructor for the VolumeVOI object.- Parameters:
kImageA
-kTranslate
-kVOI
-kColor
-
-
-
Method Detail
-
dispose
public void dispose(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
Delete local memory.- Overrides:
dispose
in classVolumeObject
-
getColor
public WildMagic.LibFoundation.Mathematics.ColorRGBA getColor()
Returns the current color of the VOI.- Returns:
-
GetName
public java.lang.String GetName()
Description copied from class:VolumeObject
Return the name of this object.- Overrides:
GetName
in classVolumeObject
- Returns:
- name of this object.
-
needsUpdate
public boolean needsUpdate()
-
needsUpdate
public void needsUpdate(boolean update)
-
getVOI
public VOIBase getVOI()
Returns the VOIBase object rendered by this VolumVOI object.- Returns:
-
Render
public void Render(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)
Description copied from class:VolumeObject
Render the object.- Specified by:
Render
in classVolumeObject
- Parameters:
kRenderer
- the OpenGLRenderer object.kCuller
- the Culler object.
-
getDepth
public float getDepth(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)
- Overrides:
getDepth
in classVolumeObject
-
setBlend
public void setBlend(float fBlend)
Sets the transparency.- Parameters:
fBlend
-
-
SetClip
public void SetClip(int iWhich, float data, boolean bEnable)
Sets axis-aligned clipping for the VolumeShaderEffect.- Parameters:
afClip
- the clipping parameters for axis-aligned clipping.
-
SetClipEye
public void SetClipEye(float[] afEquation, boolean bEnable)
-
SetClipEyeInv
public void SetClipEyeInv(float[] afEquation, boolean bEnable)
-
SetClipArb
public void SetClipArb(float[] afEquation, float[] afEquationInv, boolean bEnable)
-
setVolumeClip
public void setVolumeClip(boolean clip)
-
GetClipped
public boolean GetClipped()
-
setVolumeClipRadius
public void setVolumeClipRadius(float radius)
-
GetClipRadius
public float GetClipRadius()
-
setSlice
public void setSlice(boolean bUseSlice, int iWhichSlice, float fSlice)
Sets the slice information for the shader.- Parameters:
bUseSlice
-iWhichSlice
-fSlice
-
-
setVOI
public void setVOI(VOIBase kVOI, boolean bForceReload)
Sets and updates the VOIBase displayed by this VolumeVOI.- Parameters:
kVOI
-
-
setVOI
public void setVOI(VOIBase kVOI)
Sets and updates the VOIBase displayed by this VolumeVOI.- Parameters:
kVOI
-
-
GetBillboardPosition
public WildMagic.LibFoundation.Mathematics.Vector3f GetBillboardPosition()
-
SetBillboardPosition
public void SetBillboardPosition(WildMagic.LibFoundation.Mathematics.Vector3f volumePt)
-
setZCompare
public void setZCompare(boolean bOn)
Turns the ZBufferState compare mode on or off.- Parameters:
bOn
-
-
showTextBox
public void showTextBox(boolean bShow)
Turns displaying the text on or off.- Parameters:
bShow
-
-
update
public void update(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
Set the color of the VolumeVOI object.- Parameters:
kColor
-
-
updateText
public void updateText()
-
getCoords
private int getCoords(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd, float fraction, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer, int iPos)
Sets up the line annotations.- Parameters:
kStart
-kEnd
-fraction
-kVBuffer
-iPos
-- Returns:
-
getEndLines
private int getEndLines(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer, int iPos)
Sets up the line annotations for the end-points of the line (arrows).- Parameters:
kStart
-kEnd
-
-
getEndLines2
private int getEndLines2(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer, int iPos)
Sets up the protractor annotations for the end-points of the protractor (arrows).- Parameters:
kStart
-kEnd
-
-
lineAnnotations
private void lineAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd)
Creates the line annotations.- Parameters:
kStart
-kEnd
-
-
protractorAnnotations
private void protractorAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kMiddle, WildMagic.LibFoundation.Mathematics.Vector3f kEnd)
Creates the protractor annotations.- Parameters:
kStart
-kMiddle
-kEnd
-
-
scaleVOI
private void scaleVOI()
Creates the scene graph for displaying the VOIBase object.
-
textAnnotations
private void textAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd)
Creates the text annotations (arrow)- Parameters:
kStart
-kEnd
-
-
renderAnnotationToTexture
private void renderAnnotationToTexture(VOIText text)
-
-