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 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:
  • invalid reference
    VolumeRayCast.java
  • invalid reference
    VolumeBoundingBox.java
  • invalid reference
    VolumeClip.java
  • invalid reference
    VolumeDTI.java
  • invalid reference
    VolumeOrientationCube.java
  • invalid reference
    VolumeSlices.java
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    boolean to turn rendering on/off for this object.
    protected boolean
    boolean to turn picking on/off for this object.
    protected boolean
     
    protected float
     
    protected float
     
    protected float
    Volume coordinates of the data (extents * resolutions):
    protected float
    Volume coordinates of the data (extents * resolutions):
    protected float
    Volume coordinates of the data (extents * resolutions):
    protected WildMagic.LibGraphics.Rendering.AlphaState
    Alpha blending for this object.
    protected WildMagic.LibGraphics.Rendering.AlphaState
    Alpha blending for this object.
    protected WildMagic.LibGraphics.Rendering.CullState
    Culling of this object (front-face, back-face, none)
    protected Vector<WildMagic.LibGraphics.SceneGraph.Spatial>
     
    Surface light shader for rendering objects without volume-texture mapping.
    protected WildMagic.LibFoundation.Mathematics.Vector3f
     
    protected WildMagic.LibGraphics.Rendering.PolygonOffsetState
    PolygonOffset blending for this object.
    protected WildMagic.LibFoundation.Mathematics.Vector3f
     
    protected WildMagic.LibGraphics.SceneGraph.Node
    the scene-graph node containing the rendered object.
    protected WildMagic.LibFoundation.Mathematics.Vector3f
    local translation in the parent scene-graph.
    protected VolumeImage
    a reference to the VolumeImage containing the shared data and textures for display.
    protected VolumeImage
    a reference to the VolumeImage containing the shared data and textures for display.
    protected WildMagic.LibFoundation.Mathematics.Vector3f
     
    protected WildMagic.LibFoundation.Mathematics.Vector3f
     
    protected WildMagic.LibGraphics.Rendering.WireframeState
    Wire-frame for this object.
    protected WildMagic.LibGraphics.Rendering.ZBufferState
     
    protected WildMagic.LibGraphics.Rendering.ZBufferState
    Zbuffer for this object.
  • Constructor Summary

    Constructors
    Constructor
    Description
    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

    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
    Return true if back-face culling is on, false otherwise.
    float
    getDepth(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)
     
    boolean
    Get the object display either on/off.
    WildMagic.LibGraphics.SceneGraph.TriMesh
    Return the TriMesh object (if, any) associated with this object.
    Return the name of this object.
    boolean
    Get the object display either on/off.
    WildMagic.LibGraphics.Rendering.WireframeState.FillMode
    Return the Wireframe fill mode (FILL, LINE, POINT).
    WildMagic.LibGraphics.SceneGraph.Node
    Get the object's parent node in the scene graph.
    WildMagic.LibFoundation.Mathematics.Vector3f
    getTexCoord(WildMagic.LibFoundation.Mathematics.Vector3f pos)
     
    WildMagic.LibFoundation.Mathematics.Vector3f
    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
     
    void
    SetLight(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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 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 Details

    • 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 Details

    • 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.
      rkPickPoint - , picked point.
      kPaintColor - paint color.
    • 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 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(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)