Class VolumeObject
- java.lang.Object
-
- gov.nih.mipav.view.renderer.WildMagic.Render.VolumeObject
-
- Direct Known Subclasses:
VolumeBoundingBox
,VolumeClip
,VolumeDTI
,VolumeNode
,VolumeOrientationCube
,VolumeRayCast
,VolumeSlices
,VolumeSurface
,VolumeVOI
public abstract class VolumeObject extends java.lang.Object
VolumeObect: abstract base class for all rendered objects in the Volume Tri-Planar view. Stores the reference to the shared VolumeImage object which contains the volume data and the shared textures needed to render the data.- See Also:
VolumeRayCast.java
,VolumeBoundingBox.java
,VolumeClip.java
,VolumeDTI.java
,VolumeOrientationCube.java
,VolumeSlices.java
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_bDisplay
boolean to turn rendering on/off for this object.protected boolean
m_bPickable
boolean to turn picking on/off for this object.protected boolean
m_bTransparent
protected float
m_fVolumeDiv
protected float
m_fVolumeMult
protected float
m_fX
Volume coordinates of the data (extents * resolutions):protected float
m_fY
Volume coordinates of the data (extents * resolutions):protected float
m_fZ
Volume coordinates of the data (extents * resolutions):protected WildMagic.LibGraphics.Rendering.AlphaState
m_kAlpha
Alpha blending for this object.protected WildMagic.LibGraphics.Rendering.AlphaState
m_kAlphaTransparency
Alpha blending for this object.protected WildMagic.LibGraphics.Rendering.CullState
m_kCull
Culling of this object (front-face, back-face, none)protected java.util.Vector<WildMagic.LibGraphics.SceneGraph.Spatial>
m_kDeleteList
protected MipavLightingEffect
m_kLightShader
Surface light shader for rendering objects without volume-texture mapping.protected WildMagic.LibFoundation.Mathematics.Vector3f
m_kLocalScale
protected WildMagic.LibGraphics.Rendering.PolygonOffsetState
m_kPolygonOffset
PolygonOffset blending for this object.protected WildMagic.LibFoundation.Mathematics.Vector3f
m_kResolutions
protected WildMagic.LibGraphics.SceneGraph.Node
m_kScene
the scene-graph node containing the rendered object.protected WildMagic.LibFoundation.Mathematics.Vector3f
m_kTranslate
local translation in the parent scene-graph.protected VolumeImage
m_kVolumeImageA
a reference to the VolumeImage containing the shared data and textures for display.protected VolumeImage
m_kVolumeImageB
a reference to the VolumeImage containing the shared data and textures for display.protected WildMagic.LibFoundation.Mathematics.Vector3f
m_kVolumeScale
protected WildMagic.LibFoundation.Mathematics.Vector3f
m_kVolumeTrans
protected WildMagic.LibGraphics.Rendering.WireframeState
m_kWireframe
Wire-frame for this object.protected WildMagic.LibGraphics.Rendering.ZBufferState
m_kZBuffer
protected WildMagic.LibGraphics.Rendering.ZBufferState
m_kZBufferTransparency
Zbuffer for this object.
-
Constructor Summary
Constructors Constructor Description VolumeObject(VolumeImage kImageA, VolumeImage kImageB)
Create a new VolumeObject with the VolumeImage parameter.VolumeObject(VolumeImage kImageA, VolumeImage kImageB, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, float fX, float fY, float fZ)
Create a new VolumeObject with the VolumeImage parameter.VolumeObject(VolumeImage kImageA, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, float fX, float fY, float fZ)
Create a new VolumeObject with the VolumeImage parameter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
Blend(float fValue)
Set object blend value.void
dispose(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
delete local memory.void
Dropper(WildMagic.LibGraphics.Collision.PickRecord kRecord, WildMagic.LibFoundation.Mathematics.ColorRGBA rkDropperColor, WildMagic.LibFoundation.Mathematics.Vector3f rkPickPoint)
Paint can support.void
Erase(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.Collision.PickRecord kRecord, int iBrushSize)
Erase paint.boolean
GetBackface()
Return true if back-face culling is on, false otherwise.float
getDepth(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)
boolean
GetDisplay()
Get the object display either on/off.WildMagic.LibGraphics.SceneGraph.TriMesh
GetMesh()
Return the TriMesh object (if, any) associated with this object.java.lang.String
GetName()
Return the name of this object.boolean
GetPickable()
Get the object display either on/off.WildMagic.LibGraphics.Rendering.WireframeState.FillMode
GetPolygonMode()
Return the Wireframe fill mode (FILL, LINE, POINT).WildMagic.LibGraphics.SceneGraph.Node
GetScene()
Get the object's parent node in the scene graph.WildMagic.LibFoundation.Mathematics.Vector3f
getTexCoord(WildMagic.LibFoundation.Mathematics.Vector3f pos)
WildMagic.LibFoundation.Mathematics.Vector3f
GetTranslate()
Return the translation vector.void
localToScannerCoords(WildMagic.LibFoundation.Mathematics.Vector3f kPt)
Converts the input point from local coordinates used to display the object in the volume renderer to scanner coordinates.void
localToVolumeCoords(WildMagic.LibFoundation.Mathematics.Vector3f kPt)
Converts the input point from local coordinates used to display the object in the volume renderer into volume-index coordinates.void
Paint(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.Collision.PickRecord kRecord, WildMagic.LibFoundation.Mathematics.ColorRGBA kPaintColor, int iBrushSize)
Painting support.void
PostRender(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)
Render the object after all other objects have been rendererd.abstract void
Render(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)
Render the object.protected void
scale(WildMagic.LibGraphics.SceneGraph.VertexBuffer kVertexBuffer)
void
SetBackface(boolean bOn)
Set back-face culling on/off.void
SetColor(WildMagic.LibFoundation.Mathematics.ColorRGB kColor, boolean bUpdate)
Set the object color.void
SetDisplay(boolean bDisplay)
Set the object display to on/off.void
SetFrontface(boolean bOn)
Sets front-face culling on/off.void
setImageB(VolumeImage imageB)
void
SetLight(java.lang.String kLightType, float[] afType)
Sets the light for the EllipsoidsShader.void
SetPickable(boolean bPickable)
Enables/disables picking for this object.void
SetPolygonMode(boolean bEnable, WildMagic.LibGraphics.Rendering.WireframeState.FillMode eType)
Enables/disables wireframe and sets the mode: FILL, LINE, POINT.void
SetTranslate(WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
Copy translation vector.void
Translate(WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
Add to the object translation vector.void
volumeToLocalCoords(WildMagic.LibFoundation.Mathematics.Vector3f kVolume)
Converts the input point from volume-index coordinates into local coordinates used to display the object in the volume renderer.
-
-
-
Field Detail
-
m_bDisplay
protected boolean m_bDisplay
boolean to turn rendering on/off for this object.
-
m_bPickable
protected boolean m_bPickable
boolean to turn picking on/off for this object.
-
m_kScene
protected WildMagic.LibGraphics.SceneGraph.Node m_kScene
the scene-graph node containing the rendered object.
-
m_kVolumeImageA
protected VolumeImage m_kVolumeImageA
a reference to the VolumeImage containing the shared data and textures for display.
-
m_kVolumeImageB
protected VolumeImage m_kVolumeImageB
a reference to the VolumeImage containing the shared data and textures for display.
-
m_kTranslate
protected WildMagic.LibFoundation.Mathematics.Vector3f m_kTranslate
local translation in the parent scene-graph.
-
m_kCull
protected WildMagic.LibGraphics.Rendering.CullState m_kCull
Culling of this object (front-face, back-face, none)
-
m_kAlpha
protected WildMagic.LibGraphics.Rendering.AlphaState m_kAlpha
Alpha blending for this object.
-
m_kZBuffer
protected WildMagic.LibGraphics.Rendering.ZBufferState m_kZBuffer
-
m_kPolygonOffset
protected WildMagic.LibGraphics.Rendering.PolygonOffsetState m_kPolygonOffset
PolygonOffset blending for this object.
-
m_kAlphaTransparency
protected WildMagic.LibGraphics.Rendering.AlphaState m_kAlphaTransparency
Alpha blending for this object.
-
m_kZBufferTransparency
protected WildMagic.LibGraphics.Rendering.ZBufferState m_kZBufferTransparency
Zbuffer for this object.
-
m_bTransparent
protected boolean m_bTransparent
-
m_kWireframe
protected WildMagic.LibGraphics.Rendering.WireframeState m_kWireframe
Wire-frame for this object.
-
m_fX
protected float m_fX
Volume coordinates of the data (extents * resolutions):
-
m_fY
protected float m_fY
Volume coordinates of the data (extents * resolutions):
-
m_fZ
protected float m_fZ
Volume coordinates of the data (extents * resolutions):
-
m_kLightShader
protected MipavLightingEffect m_kLightShader
Surface light shader for rendering objects without volume-texture mapping.
-
m_kDeleteList
protected java.util.Vector<WildMagic.LibGraphics.SceneGraph.Spatial> m_kDeleteList
-
m_kVolumeScale
protected WildMagic.LibFoundation.Mathematics.Vector3f m_kVolumeScale
-
m_kVolumeTrans
protected WildMagic.LibFoundation.Mathematics.Vector3f m_kVolumeTrans
-
m_kLocalScale
protected WildMagic.LibFoundation.Mathematics.Vector3f m_kLocalScale
-
m_kResolutions
protected WildMagic.LibFoundation.Mathematics.Vector3f m_kResolutions
-
m_fVolumeDiv
protected float m_fVolumeDiv
-
m_fVolumeMult
protected float m_fVolumeMult
-
-
Constructor Detail
-
VolumeObject
public VolumeObject(VolumeImage kImageA, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, float fX, float fY, float fZ)
Create a new VolumeObject with the VolumeImage parameter.- Parameters:
kImageA
- the VolumeImage containing shared data and textures for rendering.kTranslate
- translation in the scene-graph for this object.fX
- the size of the volume in the x-dimension (extent * resolutions)fY
- the size of the volume in the y-dimension (extent * resolutions)fZ
- the size of the volume in the z-dimension (extent * resolutions)
-
VolumeObject
public VolumeObject(VolumeImage kImageA, VolumeImage kImageB)
Create a new VolumeObject with the VolumeImage parameter.- Parameters:
kImageA
- the VolumeImage containing shared data and textures for rendering.
-
VolumeObject
public VolumeObject(VolumeImage kImageA, VolumeImage kImageB, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, float fX, float fY, float fZ)
Create a new VolumeObject with the VolumeImage parameter.- Parameters:
kImageA
- the VolumeImage containing shared data and textures for rendering.kTranslate
- translation in the scene-graph for this object.fX
- the size of the volume in the x-dimension (extent * resolutions)fY
- the size of the volume in the y-dimension (extent * resolutions)fZ
- the size of the volume in the z-dimension (extent * resolutions)
-
-
Method Detail
-
Blend
public void Blend(float fValue)
Set object blend value.- Parameters:
fValue
- blend value.
-
dispose
public void dispose(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
delete local memory.
-
Dropper
public void Dropper(WildMagic.LibGraphics.Collision.PickRecord kRecord, WildMagic.LibFoundation.Mathematics.ColorRGBA rkDropperColor, WildMagic.LibFoundation.Mathematics.Vector3f rkPickPoint)
Paint can support.- Parameters:
kRecord
- pick record.kPaintColor
- paint color.rkPickPoint
- , picked point.
-
Erase
public void Erase(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.Collision.PickRecord kRecord, int iBrushSize)
Erase paint.- Parameters:
kRenderer
- Renderer.kRecord
- pick record.iBrushSize
- brush size.
-
GetBackface
public boolean GetBackface()
Return true if back-face culling is on, false otherwise.- Returns:
- true if back-face culling is on, false otherwise.
-
GetDisplay
public boolean GetDisplay()
Get the object display either on/off.- Returns:
- when true display this object, when false do not display the object.
-
GetMesh
public WildMagic.LibGraphics.SceneGraph.TriMesh GetMesh()
Return the TriMesh object (if, any) associated with this object.- Returns:
- the TriMesh object (if, any) associated with this object.
-
GetName
public java.lang.String GetName()
Return the name of this object.- Returns:
- name of this object.
-
GetPickable
public boolean GetPickable()
Get the object display either on/off.- Returns:
- when true display this object, when false do not display the object.
-
GetPolygonMode
public WildMagic.LibGraphics.Rendering.WireframeState.FillMode GetPolygonMode()
Return the Wireframe fill mode (FILL, LINE, POINT).- Returns:
- the Wireframe fill mode (FILL, LINE, POINT).
-
GetScene
public WildMagic.LibGraphics.SceneGraph.Node GetScene()
Get the object's parent node in the scene graph.- Parameters:
m_kScene
- the Node containing this object.
-
GetTranslate
public WildMagic.LibFoundation.Mathematics.Vector3f GetTranslate()
Return the translation vector.- Returns:
- translation vector.
-
Paint
public void Paint(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.Collision.PickRecord kRecord, WildMagic.LibFoundation.Mathematics.ColorRGBA kPaintColor, int iBrushSize)
Painting support.- Parameters:
kRenderer
- Renderer.kRecord
- pick record.kPaintColor
- paint color.iBrushSize
- brush size.
-
PostRender
public void PostRender(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)
Render the object after all other objects have been rendererd. Useful for screen-space objects such as the eye-clip plane.- Parameters:
kRenderer
- the OpenGLRenderer object.kCuller
- the Culler object.
-
Render
public abstract void Render(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)
Render the object.- Parameters:
kRenderer
- the OpenGLRenderer object.kCuller
- the Culler object.
-
getDepth
public float getDepth(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)
-
SetBackface
public void SetBackface(boolean bOn)
Set back-face culling on/off.- Parameters:
bOn
- on/off.
-
SetColor
public void SetColor(WildMagic.LibFoundation.Mathematics.ColorRGB kColor, boolean bUpdate)
Set the object color.- Parameters:
kColor
- new color.
-
SetDisplay
public void SetDisplay(boolean bDisplay)
Set the object display to on/off.- Parameters:
bDisplay
- when true display this object, when false do not display the object.
-
SetFrontface
public void SetFrontface(boolean bOn)
Sets front-face culling on/off.- Parameters:
bOn
- on/off.
-
setImageB
public void setImageB(VolumeImage imageB)
-
SetLight
public void SetLight(java.lang.String kLightType, float[] afType)
Sets the light for the EllipsoidsShader.- Parameters:
kLightType
- the name of the light to set (Light0, Light1, etc.)afType
- the type of light (Ambient = 0, Directional = 1, Point = 2, Spot = 3).
-
SetPickable
public void SetPickable(boolean bPickable)
Enables/disables picking for this object.- Parameters:
bPickable
- picking on/off.
-
SetPolygonMode
public void SetPolygonMode(boolean bEnable, WildMagic.LibGraphics.Rendering.WireframeState.FillMode eType)
Enables/disables wireframe and sets the mode: FILL, LINE, POINT.- Parameters:
bEnable
- turns the Wireframe State on/off.eType
- wireframe mode: FILL, LINE, POINT.
-
SetTranslate
public void SetTranslate(WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
Copy translation vector.- Parameters:
kTranslate
- new translation amount.
-
Translate
public void Translate(WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
Add to the object translation vector.- Parameters:
kTranslate
- new translation amount.
-
getTexCoord
public WildMagic.LibFoundation.Mathematics.Vector3f getTexCoord(WildMagic.LibFoundation.Mathematics.Vector3f pos)
-
volumeToLocalCoords
public void volumeToLocalCoords(WildMagic.LibFoundation.Mathematics.Vector3f kVolume)
Converts the input point from volume-index coordinates into local coordinates used to display the object in the volume renderer. The input position is overwritten in the process.- Parameters:
kVolume
- the input position.
-
localToVolumeCoords
public void localToVolumeCoords(WildMagic.LibFoundation.Mathematics.Vector3f kPt)
Converts the input point from local coordinates used to display the object in the volume renderer into volume-index coordinates. The input position is overwritten in the process.- Parameters:
kVolume
- the input position.
-
localToScannerCoords
public void localToScannerCoords(WildMagic.LibFoundation.Mathematics.Vector3f kPt)
Converts the input point from local coordinates used to display the object in the volume renderer to scanner coordinates. The input position is overwritten in the process.- Parameters:
kVolume
- the input position.
-
scale
protected void scale(WildMagic.LibGraphics.SceneGraph.VertexBuffer kVertexBuffer)
-
-