com.vodafone.v10.graphics.j3d
Class Effect3D

java.lang.Object
  |
  +--com.vodafone.v10.graphics.j3d.Effect3D

public class Effect3D
extends java.lang.Object

Graphical effects information class.
This class stores information on light source, shading type, and whether semi-transparency is enabled.


Field Summary
static int NORMAL_SHADING
          Normal shading
static int TOON_SHADING
          Toon shading
 
Constructor Summary
Effect3D()
          FigureLayout constructor
No light used, NORMAL_SHADING, semi-transparency feature enabled.
Effect3D(Light light, int shading, boolean isEnabled, Texture sphereMap)
          FigureLayout constructor
Set to null if sphere mapping is not used.
 
Method Summary
 Light getLight()
          Gets the light source.
 int getShading()
          Gets the shading type.
 Texture getSphereMap()
          Gets the sphere mapping.
 int getThreshold()
          Gets the current threshold for toon shading.
 int getThresholdHigh()
          Gets the current "RGB setting when level is above threshold" for toon shading.
 int getThresholdLow()
          Gets the current "RGB setting when level is below threshold" for toon shading.
 boolean isSemiTransparentEnabled()
          Gets the semi-transparency feature status.
 void setLight(Light light)
          Sets the light source.
 void setSemiTransparentEnabled(boolean isEnabled)
          Sets the semi-transparency feature to enabled or disabled.
 void setShading(int shading)
          Sets the shading type.
 void setSphereMap(Texture sphereMap)
          Sets sphere mapping.
If not used, null is set.
 void setThreshold(int threshold, int high, int low)
          Sets the toon shading threshold level.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL_SHADING

public static final int NORMAL_SHADING
Normal shading

TOON_SHADING

public static final int TOON_SHADING
Toon shading
Constructor Detail

Effect3D

public Effect3D()
FigureLayout constructor
No light used, NORMAL_SHADING, semi-transparency feature enabled.

Effect3D

public Effect3D(Light light,
                int shading,
                boolean isEnabled,
                Texture sphereMap)
FigureLayout constructor
Set to null if sphere mapping is not used.
Parameters:
light - Light source (null if light not used)
shading - Shading type
enableSemiTransparent - true: Semi-transparency feature enabled
sphereMap - New sphere mapping
Throws:
IllegalArgumentException - if shading type is illegal.
IllegalArgumentException - if sphereMap is not a sphere mapping texture.
Method Detail

getLight

public Light getLight()
Gets the light source.
Returns:
Light - The current light setting

setLight

public void setLight(Light light)
Sets the light source.
Parameters:
light - Light (null if none used)

getShading

public int getShading()
Gets the shading type.
Returns:
int - The currently set shading

setShading

public void setShading(int shading)
Sets the shading type.
Parameters:
shading - The shading type
Throws:
IllegalArgumentException - if the shading type is illegal

getThreshold

public int getThreshold()
Gets the current threshold for toon shading.
Returns:
int - Threshold level (0 to 255)

getThresholdHigh

public int getThresholdHigh()
Gets the current "RGB setting when level is above threshold" for toon shading.
Returns:
int - RGB setting when level is above threshold (0 to 255)

getThresholdLow

public int getThresholdLow()
Gets the current "RGB setting when level is below threshold" for toon shading.
Returns:
int - RGB setting when level is below threshold (0 to 255)

setThreshold

public void setThreshold(int threshold,
                         int high,
                         int low)
Sets the toon shading threshold level.
Parameters:
threshold - Threshold level (0 to 255)
high - RGB setting when level is above threshold (0 to 255; 100% at 255)
low - RGB setting when level is below threshold (0 to 255; 100% at 255)
Throws:
IllegalArgumentException - if a value outside range is set.

isSemiTransparentEnabled

public boolean isSemiTransparentEnabled()
Gets the semi-transparency feature status.
Returns:
boolean - The current semi-transparency feature status (true: enabled)

setSemiTransparentEnabled

public void setSemiTransparentEnabled(boolean isEnabled)
Sets the semi-transparency feature to enabled or disabled.
Parameters:
isEnabled - true: Semi-transparency feature enabled

getSphereMap

public Texture getSphereMap()
Gets the sphere mapping.
Returns:
Texture - The current sphere mapping

setSphereMap

public void setSphereMap(Texture sphereMap)
Sets sphere mapping.
If not used, null is set.
Parameters:
sphereMap - New sphere mapping
Throws:
IllegalArgumentException - if sphereMap is not a sphere mapping texture.


Copyright 2002,2003 Aplix Corporation. All rights reserved. Aplix Confidential and Restricted.