edu.uthscsa.ric.visualization
Interface SurfaceController


public interface SurfaceController

SurfaceController is used to access the surface data as well as setting surface window controls.


Field Summary
static float TRANSPARENCY_LEVEL
           
 
Method Summary
 void addedShapeAddSurfaceOverlay(SurfaceShape shape, SurfaceOverlay so)
          This will add a SurfaceOverlay to this shape.
 void addedShapeOverlayChanged(SurfaceShape shape, Object overlay)
          If registered with a ScreenImage, this method notifies an added shape when the overlay range has been changed.
 void addedShapeOverlayRemoved(SurfaceShape shape, Object image)
          If registered with an image, this method notifies the shape when the overlay has been removed from the viewer.
 void addedShapeRemoveAllSurfaceOverlays(SurfaceShape shape)
          This will remove all SurfaceOverlays from this shape.
 void addedShapeRemoveSurfaceOverlay(SurfaceShape shape, SurfaceOverlay so)
          This will remove a SurfaceOverlay from this shape.
 void addShape(J3DBuffer points, J3DBuffer normals, int[] triangles, String name, float[] color, boolean asIndices)
          Adds a shape from data (such as read from file).
 void addShape(SurfaceShape shape)
          Adds a shape from a SurfaceShape
 void addSurfaceOverlay(SurfaceOverlay so)
          This will add a SurfaceOverlay to the surface.
 void doClickMenuItem(String name)
          Used to programmatically click a surface menu item.
 SurfaceShape getAddedShape(String name)
          Returns an added shape by name.
 SurfaceShape[] getAllAddedShapes()
          Returns an array of added shapes or null if there are none.
 float getAmbient()
          Returns the ambient level (0.0 - 1.0).
 float[] getAngleState()
          Deprecated. use getCurrentRotation()
 Color3f getColor()
          Returns the color.
 float[] getCurrentRotation()
          Returns a copy of the current rotation transform.
 float[] getCurrentTranslation()
          Returns a copy of the current translate transform.
 float[] getCurrentZoom()
          Returns a copy of the current zoom transform.
 float[] getCurrentZoomScroll()
          Returns a copy of the current zoom scroll transform.
 float getDiffuse()
          Returns the diffuse level (0.0 - 1.0).
 float getEmissive()
          Returns the emissive level (0.0 - 1.0).
 OverlayListener getOverlayListener()
          Returns the OverlayListener associated with the base surface.
 int getPolygonType()
          Returns the polygon type (fill, line, or point).
 float[] getSavedRotation()
          Returns a copy of the saved rotation transform.
 float[] getSavedTranslation()
          Returns a copy of the saved translate transform.
 float[] getSavedZoom()
          Returns a copy of the saved zoom transform.
 float[] getSavedZoomScroll()
          Returns a copy of the saved zoom scroll transform.
 float getShininess()
          Returns the shininess (specular scattering exponent) level (0.0 - 128.0).
 float getSpecular()
          Returns the specular (highlights) level (0.0 - 1.0).
 SurfaceData getSurfaceData()
          Returns the SurfaceData.
 Vector<SurfaceOverlay> getSurfaceOverlays()
          Returns the SurfaceOverlay collection.
 BasicController getViewerController()
          Returns the viewer controller associated with this surface.
 void gotoAngleState()
          Deprecated. use gotoSavedPosition();
 void gotoSavedPosition()
          Moves the rendering to the last saved position (see savePosition()).
 boolean isIgnoringVertexColors()
          Returns true if this shape is not using vertex colors.
 boolean isOrientationVisible()
          Returns true if the orientation markers are visible.
 boolean isShowingAllPlanes()
          Returns true if all viewer slice planes are shown.
 boolean isShowingCutPlanes()
          Returns true if only the viewer slice planes that are also cut planes are being shown.
 boolean isShowingMainPlane()
          Returns true if only the viewer's main slice plane is shown.
 boolean isShowingShapes()
          Returns true if added shapes are being shown.
 boolean isShowingSurface()
          Returns true if the surface is being shown.
 boolean isSmoothShading()
          Returns true if using Gouraud (smooth) shading or false if using flat shading.
 boolean isUsingAxialCutPlane()
          Returns true if the axial cut plane is being used.
 boolean isUsingCoronalCutPlane()
          Returns true if the coronal cut plane is being used.
 boolean isUsingSagittalCutPlane()
          Returns true if the sagittal cut plane is being used.
 boolean isUsingTransparency()
          Returns true if the surface is using transparency.
 void overlayChanged(Object overlay)
          If registered with a ScreenImage, this method notifies the shape when the overlay has been changed.
 void overlayRemoved(Object overlay)
          If registered with a ScreenImage, this method notifies the shape when the overlay has been removed from the viewer.
 void rebuildSurface(SurfaceBuildParameters params)
          Build a surface.
 void rememberAngleState()
          Deprecated. use savePosition()
 void removeShape(String name)
          Removes an added shape by name.
 void removeSurfaceOverlay(SurfaceOverlay so)
          This will remove a SurfaceOverlay from the surface.
 void savePosition()
          Internally saves the current position.
 void setColor(Color3f col)
          Sets the color.
 void setIgnoreVertexColors(boolean bool)
          Set to true to ignore vertex colors and render shape with solid color.
 void setLightingParameters(float ambientVal, float diffuseVal, float emissiveVal, float specularVal, float shininessVal)
          Sets the lighting parameters (ambient, diffuse, emissive, specular, shininess).
 void setOrientationVisible(boolean show)
          Set to true to show the orientation markers or false to hide them.
 void setPolygonType(int type)
          Sets the polygon type (fill, line, or point).
 void setShowingAllPlanes(boolean show)
          Set to true to show all viewer slice planes.
 void setShowingCutPlanes(boolean show)
          Set to true to show only the viewer slice planes that are also cut planes.
 void setShowingMainPlane(boolean show)
          Set to true to show only the viewer's main slice plane.
 void setShowingShapes(boolean show)
          Set to true to show added shapes or false to hide them.
 void setShowingSurface(boolean show)
          Set to true to show the surface or false to hide it.
 void setTransparency(boolean useTrans)
          Sets whether the surface uses transparency or not.
 void setUseSmoothShading(boolean useSmooth)
          Sets the smooth shading state.
 void setUsingAxialCutPlane(boolean use)
          Set to true to use the axial cut plane.
 void setUsingCoronalCutPlane(boolean use)
          Set to true to use the coronal cut plane.
 void setUsingSagittalCutPlane(boolean use)
          Set to true to use the sagittal cut plane.
 void updateSurfaceView()
          Updates the surface.
 

Field Detail

TRANSPARENCY_LEVEL

static final float TRANSPARENCY_LEVEL
See Also:
Constant Field Values
Method Detail

rebuildSurface

void rebuildSurface(SurfaceBuildParameters params)
Build a surface.

Parameters:
params -

getSurfaceData

SurfaceData getSurfaceData()
Returns the SurfaceData. It conatins points, normals, triangles (strip counts), name, and color.

Returns:
the SurfaceData

isShowingShapes

boolean isShowingShapes()
Returns true if added shapes are being shown.

Returns:
true if added shapes are being shown

setShowingShapes

void setShowingShapes(boolean show)
Set to true to show added shapes or false to hide them.

Parameters:
show - true to show added shapes or false to hide them

isShowingSurface

boolean isShowingSurface()
Returns true if the surface is being shown.

Returns:
true if the surface is being shown

setShowingSurface

void setShowingSurface(boolean show)
Set to true to show the surface or false to hide it.

Parameters:
show - true to show the surface or false to hide it

isOrientationVisible

boolean isOrientationVisible()
Returns true if the orientation markers are visible.

Returns:
true if the orientation markers are visible

setOrientationVisible

void setOrientationVisible(boolean show)
Set to true to show the orientation markers or false to hide them.

Parameters:
show - true to show the orientation markers or false to hide them

isShowingAllPlanes

boolean isShowingAllPlanes()
Returns true if all viewer slice planes are shown.

Returns:
true if all viewer slice planes are shown

setShowingAllPlanes

void setShowingAllPlanes(boolean show)
Set to true to show all viewer slice planes.

Parameters:
show - true to show all viewer slice planes

isShowingMainPlane

boolean isShowingMainPlane()
Returns true if only the viewer's main slice plane is shown.

Returns:
true if only the viewer's main slice plane is shown

setShowingMainPlane

void setShowingMainPlane(boolean show)
Set to true to show only the viewer's main slice plane.

Parameters:
show - true to show only the viewer's main slice plane.

isShowingCutPlanes

boolean isShowingCutPlanes()
Returns true if only the viewer slice planes that are also cut planes are being shown.

Returns:
true if only the viewer slice planes that are also cut planes are being shown

setShowingCutPlanes

void setShowingCutPlanes(boolean show)
Set to true to show only the viewer slice planes that are also cut planes.

Parameters:
show - true to show only the viewer slice planes that are also cut planes

isUsingAxialCutPlane

boolean isUsingAxialCutPlane()
Returns true if the axial cut plane is being used.

Returns:
true if the axial cut plane is being used.

setUsingAxialCutPlane

void setUsingAxialCutPlane(boolean use)
Set to true to use the axial cut plane. This cut plane corresponds to the axial slice location in the viewer.

Parameters:
use - true to use the axial cut plane

isUsingCoronalCutPlane

boolean isUsingCoronalCutPlane()
Returns true if the coronal cut plane is being used.

Returns:
true if the coronal cut plane is being used.

setUsingCoronalCutPlane

void setUsingCoronalCutPlane(boolean use)
Set to true to use the coronal cut plane. This cut plane corresponds to the coronal slice location in the viewer.

Parameters:
use - true to use the coronal cut plane

isUsingSagittalCutPlane

boolean isUsingSagittalCutPlane()
Returns true if the sagittal cut plane is being used.

Returns:
true if the sagittal cut plane is being used.

setUsingSagittalCutPlane

void setUsingSagittalCutPlane(boolean use)
Set to true to use the sagittal cut plane. This cut plane corresponds to the sagittal slice location in the viewer.

Parameters:
use - true to use the sagittal cut plane

savePosition

void savePosition()
Internally saves the current position.


gotoSavedPosition

void gotoSavedPosition()
Moves the rendering to the last saved position (see savePosition()).


rememberAngleState

void rememberAngleState()
Deprecated. use savePosition()

Internally saves the current rotation transform.


gotoAngleState

void gotoAngleState()
Deprecated. use gotoSavedPosition();

Moves the rendering to the last saved (see rememberAngleState()) rotation transform.


getAngleState

float[] getAngleState()
Deprecated. use getCurrentRotation()

Returns a copy of the current rotation transform.

Returns:
a copy of the current rotation transform

getSavedRotation

float[] getSavedRotation()
Returns a copy of the saved rotation transform.

Returns:
a copy of the saved rotation transform

getSavedZoom

float[] getSavedZoom()
Returns a copy of the saved zoom transform.

Returns:
a copy of the saved zoom transform

getSavedZoomScroll

float[] getSavedZoomScroll()
Returns a copy of the saved zoom scroll transform.

Returns:
a copy of the saved zoom scroll transform

getSavedTranslation

float[] getSavedTranslation()
Returns a copy of the saved translate transform.

Returns:
a copy of the saved translate scroll transform

getCurrentRotation

float[] getCurrentRotation()
Returns a copy of the current rotation transform.

Returns:
a copy of the current rotation transform

getCurrentZoom

float[] getCurrentZoom()
Returns a copy of the current zoom transform.

Returns:
a copy of the current zoom transform

getCurrentZoomScroll

float[] getCurrentZoomScroll()
Returns a copy of the current zoom scroll transform.

Returns:
a copy of the current zoom scroll transform

getCurrentTranslation

float[] getCurrentTranslation()
Returns a copy of the current translate transform.

Returns:
a copy of the current translate scroll transform

setLightingParameters

void setLightingParameters(float ambientVal,
                           float diffuseVal,
                           float emissiveVal,
                           float specularVal,
                           float shininessVal)
Sets the lighting parameters (ambient, diffuse, emissive, specular, shininess).

Parameters:
ambientVal - the ambient level (0.0 - 1.0)
diffuseVal - the diffuse level (0.0 - 1.0)
emissiveVal - the emissive level (0.0 - 1.0)
specularVal - the specular level (0.0 - 1.0)
shininessVal - the shininess level (0.0 - 128.0)

setTransparency

void setTransparency(boolean useTrans)
Sets whether the surface uses transparency or not.

Parameters:
useTrans - true if the surface should use transparency, false otherwise

isUsingTransparency

boolean isUsingTransparency()
Returns true if the surface is using transparency.

Returns:
true if the surface is using transparency

getColor

Color3f getColor()
Returns the color.

Returns:
the color

setColor

void setColor(Color3f col)
Sets the color.

Parameters:
col - the color

getAmbient

float getAmbient()
Returns the ambient level (0.0 - 1.0).

Returns:
the ambient level

getDiffuse

float getDiffuse()
Returns the diffuse level (0.0 - 1.0).

Returns:
the diffuse level

getSpecular

float getSpecular()
Returns the specular (highlights) level (0.0 - 1.0).

Returns:
the specular (highlights) level

getShininess

float getShininess()
Returns the shininess (specular scattering exponent) level (0.0 - 128.0).

Returns:
the shininess (specular scattering exponent) level

getEmissive

float getEmissive()
Returns the emissive level (0.0 - 1.0).

Returns:
the emissive level

isSmoothShading

boolean isSmoothShading()
Returns true if using Gouraud (smooth) shading or false if using flat shading.

Returns:
true if using Gouraud (smooth) shading or false if using flat shading

setUseSmoothShading

void setUseSmoothShading(boolean useSmooth)
Sets the smooth shading state.

Parameters:
useSmooth - set to true to use Gouraud (smooth) shading or false to use flat shading

getPolygonType

int getPolygonType()
Returns the polygon type (fill, line, or point). See javax.media.j3d.PolygonAttributes.

Returns:
the polygon type

setPolygonType

void setPolygonType(int type)
Sets the polygon type (fill, line, or point). See javax.media.j3d.PolygonAttributes.

Parameters:
type - the polygon type

getAllAddedShapes

SurfaceShape[] getAllAddedShapes()
Returns an array of added shapes or null if there are none.

Returns:
an array of added shapes or null if there are none

addShape

void addShape(SurfaceShape shape)
Adds a shape from a SurfaceShape

Parameters:
shape - the shape to be added

addShape

void addShape(J3DBuffer points,
              J3DBuffer normals,
              int[] triangles,
              String name,
              float[] color,
              boolean asIndices)
Adds a shape from data (such as read from file).

Parameters:
points - a J3DBuffer containing a java.nio.FloatBuffer of points
normals - a J3DBuffer containing a java.nio.FloatBuffer of normals
triangles - triangle data array
color - a three float array containing RGB values
asIndices - true if the triangle array contains point indices describing triangles, false if it contains strip counts

removeShape

void removeShape(String name)
Removes an added shape by name.

Parameters:
name - the name of the shape to be removed

getAddedShape

SurfaceShape getAddedShape(String name)
Returns an added shape by name.

Parameters:
name - the name of the shape to fetch.

doClickMenuItem

void doClickMenuItem(String name)
Used to programmatically click a surface menu item.

Parameters:
name - menu item name

updateSurfaceView

void updateSurfaceView()
Updates the surface.


isIgnoringVertexColors

boolean isIgnoringVertexColors()
Returns true if this shape is not using vertex colors.

Returns:
true if this shape is not using vertex colors

setIgnoreVertexColors

void setIgnoreVertexColors(boolean bool)
Set to true to ignore vertex colors and render shape with solid color.

Parameters:
bool - true to ignore vertex colors, false to use vertex colors

getOverlayListener

OverlayListener getOverlayListener()
Returns the OverlayListener associated with the base surface.

Returns:
the overlay listener

addedShapeOverlayChanged

void addedShapeOverlayChanged(SurfaceShape shape,
                              Object overlay)
If registered with a ScreenImage, this method notifies an added shape when the overlay range has been changed.

Parameters:
shape - the shape
overlay - the overlay

addedShapeOverlayRemoved

void addedShapeOverlayRemoved(SurfaceShape shape,
                              Object image)
If registered with an image, this method notifies the shape when the overlay has been removed from the viewer.

Parameters:
shape - the shape
image - the overlay

addedShapeAddSurfaceOverlay

void addedShapeAddSurfaceOverlay(SurfaceShape shape,
                                 SurfaceOverlay so)
This will add a SurfaceOverlay to this shape.

Parameters:
shape - the shape
so - the SurfaceOverlay to add

addedShapeRemoveSurfaceOverlay

void addedShapeRemoveSurfaceOverlay(SurfaceShape shape,
                                    SurfaceOverlay so)
This will remove a SurfaceOverlay from this shape.

Parameters:
shape - the shape
so - the SurfaceOverlay to remove

addedShapeRemoveAllSurfaceOverlays

void addedShapeRemoveAllSurfaceOverlays(SurfaceShape shape)
This will remove all SurfaceOverlays from this shape.

Parameters:
shape - the shape

overlayChanged

void overlayChanged(Object overlay)
If registered with a ScreenImage, this method notifies the shape when the overlay has been changed.

Parameters:
overlay - the overlay

overlayRemoved

void overlayRemoved(Object overlay)
If registered with a ScreenImage, this method notifies the shape when the overlay has been removed from the viewer.

Parameters:
overlay - the overlay

addSurfaceOverlay

void addSurfaceOverlay(SurfaceOverlay so)
This will add a SurfaceOverlay to the surface.

Parameters:
so - the SurfaceOverlay to add

removeSurfaceOverlay

void removeSurfaceOverlay(SurfaceOverlay so)
This will remove a SurfaceOverlay from the surface.

Parameters:
so - the SurfaceOverlay to remove

getSurfaceOverlays

Vector<SurfaceOverlay> getSurfaceOverlays()
Returns the SurfaceOverlay collection.

Returns:
the SurfaceOverlay collection

getViewerController

BasicController getViewerController()
Returns the viewer controller associated with this surface. Image data can be accessed via ViewerController.

Returns:
the viewer controller