edu.uthscsa.ric.visualization.surface
Interface SurfaceController


public interface SurfaceController


Method Summary
 void addToDisplay(SurfacePlugin plugin)
          Registers this plugin instance so that its display method will be called.
 BufferedImage captureImage(Surface surface, boolean showLinesAndPoints)
          Returns a BufferedImage of the specified surface.
 javax.vecmath.Point3d convertViewerCoordinateToSurfacePoint(Coordinate coor, boolean isWorld)
          Convert viewer coordinate to surface coordinate.
 GLCanvas getCanvas()
          Returns the canvas instance.
 float[] getLightingValues()
          Returns the lighting values (ambient, diffuse, specular, directionX, directionY, directionZ).
 float[] getMaterialValues(Surface surface)
          Returns the material values (red, green, blue, shininess, emissivity, transparency).
 Surface[] getSurfaces()
          Returns a list of all surfaces being rendered (starts with the base surface).
 JFrame getSurfaceViewerFrame()
          Returns the surface viewer frame.
 float getThreshold()
          Returns the threshold used to build the surface.
 BasicController getViewerController()
          Returns the associated viewer controller
 double[] getViewTransform()
          Returns a 4x4 of the view transform.
 void removeFromDisplay(SurfacePlugin plugin)
          Unregisters this plugin instance.
 void setLightingValues(float ambient, float diffuse, float specular, float[] direction)
          Sets the lighting values.
 void setMaterialValues(Surface surface, float[] color, float shininess, float emissivity, float transparency)
          Sets the material values.
 void setViewTransform(double[] xform)
          Sets the view transform.
 void updateSurface()
          Redraws the surface.
 

Method Detail

addToDisplay

void addToDisplay(SurfacePlugin plugin)
Registers this plugin instance so that its display method will be called.

Parameters:
plugin - the plugin

captureImage

BufferedImage captureImage(Surface surface,
                           boolean showLinesAndPoints)
Returns a BufferedImage of the specified surface.

Parameters:
surface - the surface to capture or null to capture all
showLinesAndPoints - true to include added lines and points in capture, false otherwise
Returns:
the capture as a BufferedImage

convertViewerCoordinateToSurfacePoint

javax.vecmath.Point3d convertViewerCoordinateToSurfacePoint(Coordinate coor,
                                                            boolean isWorld)
Convert viewer coordinate to surface coordinate.

Parameters:
coor - the viewer coordinate
isWorld - true if the coordinate is in world space
Returns:
the surface point

getCanvas

GLCanvas getCanvas()
Returns the canvas instance.

Returns:
the canvas

getLightingValues

float[] getLightingValues()
Returns the lighting values (ambient, diffuse, specular, directionX, directionY, directionZ).

Returns:
the lighting values

getMaterialValues

float[] getMaterialValues(Surface surface)
Returns the material values (red, green, blue, shininess, emissivity, transparency).

Parameters:
surface - the surface from which the material values should be returned
Returns:
the material values

getSurfaces

Surface[] getSurfaces()
Returns a list of all surfaces being rendered (starts with the base surface).

Returns:
a list of all surfaces

getSurfaceViewerFrame

JFrame getSurfaceViewerFrame()
Returns the surface viewer frame.

Returns:
the surface viewer frame

getThreshold

float getThreshold()
Returns the threshold used to build the surface.

Returns:
the threshold used to build the surface

getViewerController

BasicController getViewerController()
Returns the associated viewer controller

Returns:
the associated vidwer controller

getViewTransform

double[] getViewTransform()
Returns a 4x4 of the view transform.

Returns:
the view transform

removeFromDisplay

void removeFromDisplay(SurfacePlugin plugin)
Unregisters this plugin instance. After this call, the plugin's display method will no longer be called.

Parameters:
plugin - the plugin to remove

setLightingValues

void setLightingValues(float ambient,
                       float diffuse,
                       float specular,
                       float[] direction)
Sets the lighting values.

Parameters:
ambient - the ambient lighting value
diffuse - the diffuse lighting value
specular - the specular lighting value
direction - x, y, z

setMaterialValues

void setMaterialValues(Surface surface,
                       float[] color,
                       float shininess,
                       float emissivity,
                       float transparency)
Sets the material values.

Parameters:
surface - the surface to apply the changes
color - red, green, blue
shininess - the shininess material value
emissivity - the emissivity material value
transparency - the transparency material value

setViewTransform

void setViewTransform(double[] xform)
Sets the view transform.

Parameters:
xform - a 4x4 transform

updateSurface

void updateSurface()
Redraws the surface. This is the same as calling getCanvas().display().