|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uthscsa.ric.visualization.SurfaceShape
public class SurfaceShape
SurfaceShape, like SurfaceData, is a container for surface-related data and is intended to store shapes that have been added to the base image surface. In addition to SurfaceData, it contains methods to set lighting and color parameters, visibility, and transparency of the shape.
Field Summary | |
---|---|
static float |
DEFAULT_AMBIENT
|
static float |
DEFAULT_AMBIENT_D3D
|
static float |
DEFAULT_BRIGHTNESS
|
static float |
DEFAULT_DIFFUSE
|
static float |
DEFAULT_DIFFUSE_D3D
|
static float |
DEFAULT_EMISSIVE
|
static float |
DEFAULT_EMISSIVE_D3D
|
static float |
DEFAULT_SHININESS
|
static float |
DEFAULT_SHININESS_D3D
|
static float |
DEFAULT_SPECULAR
|
static float |
DEFAULT_SPECULAR_D3D
|
static float |
TRANSPARENCY_LEVEL
|
Constructor Summary | |
---|---|
SurfaceShape(Shape3D shape,
SurfaceController sc,
Color3f col,
String name)
Constructor. |
Method Summary | |
---|---|
void |
addSurfaceOverlay(SurfaceOverlay so)
This will add a SurfaceOverlay to this shape. |
void |
clear()
Clears data contained in this shape. |
float |
getAmbient()
Returns the ambient level (0.0 - 1.0). |
BranchGroup |
getBranch()
Returns the BranchGroup that contains this shape. |
String |
getBuildString()
Returns the build string (a description of the build parameters) |
double |
getBuildTime()
Returns the build time (for info purposes) in seconds. |
Color3f |
getColor()
Returns the color. |
double |
getDecimationPercent()
Returns the amount of decimation (smoothing) used in building this shape (default = 0). |
Color3f |
getDefaultColor()
Returns the color initialized in the constructor. |
float |
getDiffuse()
Returns the diffuse level (0.0 - 1.0). |
float |
getEmissive()
Returns the emissive level (0.0 - 1.0). |
String |
getName()
Returns the name of the shape. |
int |
getNumTriangles()
Returns the number of triangles in this shape (default = 0). |
int |
getPolygonType()
Returns the polygon type (fill, line, or point). |
Shape3D |
getShape()
Returns the Shape3D object containing the geometry of this shape. |
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 for this shape. |
Vector<SurfaceOverlay> |
getSurfaceOverlays()
Returns the SurfaceOverlay collection. |
TransformGroup |
getTransformGroup()
Returns the TransformGroup that contains this shape. |
boolean |
isIgnoringVertexColors()
Returns true if this shape is not using vertex colors. |
boolean |
isSmoothShading()
Returns true if using Gouraud (smooth) shading or false if using flat shading. |
boolean |
isUsingOverlayTransform()
Returns true if the shape responds to changes in the viewer transform. |
boolean |
isUsingTransparency()
Returns the transparency mode. |
boolean |
isVisible()
Returns true if the shape visibility flag is set. |
void |
overlayChanged(Object image)
If registered with a ScreenImage, this method notifies the shape when the overlay has been changed. |
void |
overlayColorTableChanged(Object overlay)
|
void |
overlayRemoved(Object image)
If registered with a ScreenImage, this method notifies the shape when the overlay has been removed from the viewer. |
void |
overlayTransformChanged(Object image)
If registered with a ScreenImage, this method notifies the shape when the overlay has been removed from the viewer. |
void |
removeAllSurfaceOverlays()
This will remove all SurfaceOverlays from this shape. |
void |
removeSurfaceOverlay(SurfaceOverlay so)
This will remove a SurfaceOverlay from this shape. |
void |
setBranch(BranchGroup group)
Sets the BranchGroup that contains this shape. |
void |
setBuildString(String string)
Sets build string (a description of the build parameters) |
void |
setBuildTime(long val)
Sets the build time (for info purposes) in milliseconds. |
void |
setColor(Color3f col)
Sets the color. |
void |
setDecimationPercent(double val)
Sets the amount of decimation (smoothing) used in building this shape. |
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 |
setName(String name)
Sets the name of the shape. |
void |
setNumTriangles(int num)
Sets the number of triangles in this shape. |
void |
setPolygonType(int type)
Sets the polygon type (fill, line, or point). |
void |
setTransformGroup(TransformGroup group)
Sets the TransformGroup that contains this shape. |
void |
setTransparency(boolean doTransparency)
Sets the transparency mode. |
void |
setUseSmoothShading(boolean useSmooth)
Sets the smooth shading state. |
void |
setUsesOverlayTransform(boolean use)
Sets the shape flag for responding to viewer transforms. |
void |
setVisible(boolean vis)
Sets the shape visibility flag. |
protected void |
updateVisible()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float DEFAULT_AMBIENT
public static final float DEFAULT_DIFFUSE
public static final float DEFAULT_SPECULAR
public static final float DEFAULT_EMISSIVE
public static final float DEFAULT_SHININESS
public static final float DEFAULT_AMBIENT_D3D
public static final float DEFAULT_DIFFUSE_D3D
public static final float DEFAULT_SPECULAR_D3D
public static final float DEFAULT_EMISSIVE_D3D
public static final float DEFAULT_SHININESS_D3D
public static final float DEFAULT_BRIGHTNESS
public static final float TRANSPARENCY_LEVEL
Constructor Detail |
---|
public SurfaceShape(Shape3D shape, SurfaceController sc, Color3f col, String name)
shape
- contains shape geometrysc
- the SurfaceController associated with this shapecol
- the color of the shape; default color is set to col as wellname
- the name of the shapeMethod Detail |
---|
public void clear()
public String getName()
public void setName(String name)
name
- the name of the shapepublic double getBuildTime()
public void setBuildTime(long val)
val
- the build time in millisecondspublic Color3f getColor()
public void setColor(Color3f col)
col
- the colorpublic float getAmbient()
public float getDiffuse()
public float getSpecular()
public float getShininess()
public float getEmissive()
public void setLightingParameters(float ambientVal, float diffuseVal, float emissiveVal, float specularVal, float shininessVal)
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)public boolean isUsingTransparency()
public void setTransparency(boolean doTransparency)
doTransparency
- true if transparency is used, false otherwisepublic boolean isSmoothShading()
public void setUseSmoothShading(boolean useSmooth)
useSmooth
- set to true to use Gouraud (smooth) shading or false to use flat shadingpublic boolean isVisible()
public void setVisible(boolean vis)
vis
- set to true to set the visibility flag, or false to unset the flagpublic boolean isUsingOverlayTransform()
public void setUsesOverlayTransform(boolean use)
use
- setting to true will make this shape respond to changes in the viewer transformpublic BranchGroup getBranch()
public void setBranch(BranchGroup group)
group
- the BranchGroup that contains this shapepublic TransformGroup getTransformGroup()
public void setTransformGroup(TransformGroup group)
group
- the TransformGroup that contains this shapepublic Shape3D getShape()
public Color3f getDefaultColor()
public SurfaceData getSurfaceData()
public int getNumTriangles()
public void setNumTriangles(int num)
num
- the number of trianglespublic void setDecimationPercent(double val)
val
- the amount of decimationpublic double getDecimationPercent()
public void setBuildString(String string)
string
- the build stringpublic String getBuildString()
public int getPolygonType()
public void setPolygonType(int type)
type
- the polygon typepublic boolean isIgnoringVertexColors()
public void setIgnoreVertexColors(boolean bool)
bool
- true to ignore vertex colors, false to use vertex colorspublic void overlayChanged(Object image)
overlayChanged
in interface OverlayListener
image
- the overlaypublic void overlayRemoved(Object image)
overlayRemoved
in interface OverlayListener
image
- the overlaypublic void overlayTransformChanged(Object image)
image
- the overlaypublic void addSurfaceOverlay(SurfaceOverlay so)
so
- the SurfaceOverlay to addpublic void removeSurfaceOverlay(SurfaceOverlay so)
so
- the SurfaceOverlay to removepublic void removeAllSurfaceOverlays()
public Vector<SurfaceOverlay> getSurfaceOverlays()
protected void updateVisible()
public void overlayColorTableChanged(Object overlay)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |