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.ObjectVolumeObect: 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 booleanm_bDisplayboolean to turn rendering on/off for this object.protected booleanm_bPickableboolean to turn picking on/off for this object.protected booleanm_bTransparentprotected floatm_fVolumeDivprotected floatm_fVolumeMultprotected floatm_fXVolume coordinates of the data (extents * resolutions):protected floatm_fYVolume coordinates of the data (extents * resolutions):protected floatm_fZVolume coordinates of the data (extents * resolutions):protected WildMagic.LibGraphics.Rendering.AlphaStatem_kAlphaAlpha blending for this object.protected WildMagic.LibGraphics.Rendering.AlphaStatem_kAlphaTransparencyAlpha blending for this object.protected WildMagic.LibGraphics.Rendering.CullStatem_kCullCulling of this object (front-face, back-face, none)protected java.util.Vector<WildMagic.LibGraphics.SceneGraph.Spatial>m_kDeleteListprotected MipavLightingEffectm_kLightShaderSurface light shader for rendering objects without volume-texture mapping.protected WildMagic.LibFoundation.Mathematics.Vector3fm_kLocalScaleprotected WildMagic.LibGraphics.Rendering.PolygonOffsetStatem_kPolygonOffsetPolygonOffset blending for this object.protected WildMagic.LibFoundation.Mathematics.Vector3fm_kResolutionsprotected WildMagic.LibGraphics.SceneGraph.Nodem_kScenethe scene-graph node containing the rendered object.protected WildMagic.LibFoundation.Mathematics.Vector3fm_kTranslatelocal translation in the parent scene-graph.protected VolumeImagem_kVolumeImageAa reference to the VolumeImage containing the shared data and textures for display.protected VolumeImagem_kVolumeImageBa reference to the VolumeImage containing the shared data and textures for display.protected WildMagic.LibFoundation.Mathematics.Vector3fm_kVolumeScaleprotected WildMagic.LibFoundation.Mathematics.Vector3fm_kVolumeTransprotected WildMagic.LibGraphics.Rendering.WireframeStatem_kWireframeWire-frame for this object.protected WildMagic.LibGraphics.Rendering.ZBufferStatem_kZBufferprotected WildMagic.LibGraphics.Rendering.ZBufferStatem_kZBufferTransparencyZbuffer 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 voidBlend(float fValue)Set object blend value.voiddispose(WildMagic.LibGraphics.Rendering.Renderer kRenderer)delete local memory.voidDropper(WildMagic.LibGraphics.Collision.PickRecord kRecord, WildMagic.LibFoundation.Mathematics.ColorRGBA rkDropperColor, WildMagic.LibFoundation.Mathematics.Vector3f rkPickPoint)Paint can support.voidErase(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.Collision.PickRecord kRecord, int iBrushSize)Erase paint.booleanGetBackface()Return true if back-face culling is on, false otherwise.floatgetDepth(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)booleanGetDisplay()Get the object display either on/off.WildMagic.LibGraphics.SceneGraph.TriMeshGetMesh()Return the TriMesh object (if, any) associated with this object.java.lang.StringGetName()Return the name of this object.booleanGetPickable()Get the object display either on/off.WildMagic.LibGraphics.Rendering.WireframeState.FillModeGetPolygonMode()Return the Wireframe fill mode (FILL, LINE, POINT).WildMagic.LibGraphics.SceneGraph.NodeGetScene()Get the object's parent node in the scene graph.WildMagic.LibFoundation.Mathematics.Vector3fgetTexCoord(WildMagic.LibFoundation.Mathematics.Vector3f pos)WildMagic.LibFoundation.Mathematics.Vector3fGetTranslate()Return the translation vector.voidlocalToScannerCoords(WildMagic.LibFoundation.Mathematics.Vector3f kPt)Converts the input point from local coordinates used to display the object in the volume renderer to scanner coordinates.voidlocalToVolumeCoords(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.voidPaint(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.Collision.PickRecord kRecord, WildMagic.LibFoundation.Mathematics.ColorRGBA kPaintColor, int iBrushSize)Painting support.voidPostRender(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)Render the object after all other objects have been rendererd.abstract voidRender(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)Render the object.protected voidscale(WildMagic.LibGraphics.SceneGraph.VertexBuffer kVertexBuffer)voidSetBackface(boolean bOn)Set back-face culling on/off.voidSetColor(WildMagic.LibFoundation.Mathematics.ColorRGB kColor, boolean bUpdate)Set the object color.voidSetDisplay(boolean bDisplay)Set the object display to on/off.voidSetFrontface(boolean bOn)Sets front-face culling on/off.voidsetImageB(VolumeImage imageB)voidSetLight(java.lang.String kLightType, float[] afType)Sets the light for the EllipsoidsShader.voidSetPickable(boolean bPickable)Enables/disables picking for this object.voidSetPolygonMode(boolean bEnable, WildMagic.LibGraphics.Rendering.WireframeState.FillMode eType)Enables/disables wireframe and sets the mode: FILL, LINE, POINT.voidSetTranslate(WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)Copy translation vector.voidTranslate(WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)Add to the object translation vector.voidvolumeToLocalCoords(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)
-
-