visad.java3d
Class GraphicsModeControlJ3D

java.lang.Object
  extended by visad.Control
      extended by visad.GraphicsModeControl
          extended by visad.java3d.GraphicsModeControlJ3D
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class GraphicsModeControlJ3D
extends GraphicsModeControl

GraphicsModeControlJ3D is the VisAD class for controlling various mode settings for rendering.

A GraphicsModeControlJ3D is not linked to any DisplayRealType or ScalarMap. It is linked to a DisplayImpl.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class visad.GraphicsModeControl
AVERAGE_COLOR_MODE, DASH_DOT_STYLE, DASH_STYLE, DOT_STYLE, SOLID_STYLE, SUM_COLOR_MODE
 
Constructor Summary
GraphicsModeControlJ3D(DisplayImpl d)
          Construct a GraphicsModeControlJ3D associated with the input display
 
Method Summary
 java.lang.Object clone()
          clone this GraphicsModeControlJ3D
 boolean equals(java.lang.Object o)
          Check to see if this GraphicsModeControlJ3D is equal to the object in question.
 int getColorMode()
          Get the color mode used for combining color values.
 int getCurvedSize()
          Get the undersampling factor of surface shape for curved texture maps
 int getLineStyle()
          Get the current line style used for LineAttributes.
 float getLineWidth()
          Get the current line width used for LineAttributes.
 boolean getMissingTransparent()
          See whether missing values are rendered as transparent or not.
 boolean getMode2D()
          See if the display is being rendered in 2D mode
 boolean getPointMode()
          Gets the point mode.
 float getPointSize()
          Get the current point size used for PointAttributes.
 int getPolygonMode()
          Get the current polygon rasterization mode.
 int getProjectionPolicy()
          Get the current projection policy for the display.
 boolean getScaleEnable()
          Get whether display scales are enabled or not
 boolean getTextureEnable()
          See if texture mapping is enabled or not
 int getTransparencyMode()
          Get the current transparency mode
 void setColorMode(int mode)
          Set the color mode used for combining color values.
 void setCurvedSize(int curved_size)
          Set the undersampling factor of surface shape for curved texture maps
 void setLineStyle(int style)
          Set the line style used for LineAttributes.
 void setLineStyle(int style, boolean dummy)
          Set the line style used for LineAttributes.
 void setLineWidth(float width)
          Set the line width used for LineAttributes.
 void setLineWidth(float width, boolean dummy)
          Set the line width used for LineAttributes.
 void setMissingTransparent(boolean missing)
          Set the transparency of missing values.
 void setPointMode(boolean mode)
          Sets the point mode and updates the display.
 void setPointSize(float size)
          Get the point size used for PointAttributes.
 void setPointSize(float size, boolean dummy)
          Get the point size used for PointAttributes.
 void setPolygonMode(int mode)
          Sets the polygon rasterization mode.
 void setProjectionPolicy(int policy)
          Sets the projection policy for the display.
 void setScaleEnable(boolean enable)
          Toggle the axis scales in the display
 void setTextureEnable(boolean enable)
          Set whether texture mapping should be used or not.
 void setTransparencyMode(int mode)
          Sets the transparency mode.
 void syncControl(Control rmt)
          Copy the state of a remote control to this control
 java.lang.String toString()
          Return a string representation of this GraphicsModeControlJ3D
 
Methods inherited from class visad.GraphicsModeControl
getSaveString, setSaveString
 
Methods inherited from class visad.Control
addControlListener, animation_string, changeControl, checkTicks, getDisplay, getDisplayRenderer, getInstanceNumber, incTick, nullControl, peekTicks, removeControlListener, resetTicks, setTicks, subCheckTicks, subPeekTicks, subResetTicks, subSetTicks
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphicsModeControlJ3D

public GraphicsModeControlJ3D(DisplayImpl d)
Construct a GraphicsModeControlJ3D associated with the input display

Parameters:
d - display associated with this GraphicsModeControlJ3D
Method Detail

getMode2D

public boolean getMode2D()
See if the display is being rendered in 2D mode

Specified by:
getMode2D in class GraphicsModeControl
Returns:
true if display is rendered as 2D
See Also:
DisplayRenderer.getMode2D()

getLineWidth

public float getLineWidth()
Get the current line width used for LineAttributes. The default is 1.0.

Specified by:
getLineWidth in class GraphicsModeControl
Returns:
line width (>= 1.0)

setLineWidth

public void setLineWidth(float width)
                  throws VisADException,
                         java.rmi.RemoteException
Set the line width used for LineAttributes. Calls changeControl and resets the display.

Specified by:
setLineWidth in class GraphicsModeControl
Parameters:
width - width to use (>= 1.0)
Throws:
VisADException - couldn't set the line width on local display
java.rmi.RemoteException - couldn't set the line width on remote display

setLineWidth

public void setLineWidth(float width,
                         boolean dummy)
Set the line width used for LineAttributes. Does not update display.

Specified by:
setLineWidth in class GraphicsModeControl
Parameters:
width - width to use (>= 1.0)

getPointSize

public float getPointSize()
Get the current point size used for PointAttributes. The default is 1.0.

Specified by:
getPointSize in class GraphicsModeControl
Returns:
point size (>= 1.0)

setPointSize

public void setPointSize(float size)
                  throws VisADException,
                         java.rmi.RemoteException
Get the point size used for PointAttributes. Calls changeControl and updates the display.

Specified by:
setPointSize in class GraphicsModeControl
Parameters:
size - size to use (>= 1.0)
Throws:
VisADException - couldn't set the point size on local display
java.rmi.RemoteException - couldn't set the point size on remote display

setPointSize

public void setPointSize(float size,
                         boolean dummy)
Get the point size used for PointAttributes. Doesn't update the display.

Specified by:
setPointSize in class GraphicsModeControl
Parameters:
size - size to use (>= 1.0)

getLineStyle

public int getLineStyle()
Get the current line style used for LineAttributes. The default is GraphicsModeControl.SOLID_STYLE.

Specified by:
getLineStyle in class GraphicsModeControl
Returns:
line style (SOLID_STYLE, DASH_STYLE, DOT_STYLE or DASH_DOT_STYLE)

setLineStyle

public void setLineStyle(int style)
                  throws VisADException,
                         java.rmi.RemoteException
Set the line style used for LineAttributes. Calls changeControl and resets the display.

Specified by:
setLineStyle in class GraphicsModeControl
Parameters:
style - style to use (SOLID_STYLE, DASH_STYLE, DOT_STYLE or DASH_DOT_STYLE)
Throws:
VisADException - couldn't set the line style on local display
java.rmi.RemoteException - couldn't set the line style on remote display

setLineStyle

public void setLineStyle(int style,
                         boolean dummy)
Set the line style used for LineAttributes. Does not update display.

Specified by:
setLineStyle in class GraphicsModeControl
Parameters:
style - style to use (SOLID_STYLE, DASH_STYLE, DOT_STYLE or DASH_DOT_STYLE)

getColorMode

public int getColorMode()
Get the color mode used for combining color values. The default is GraphicsModeControl.AVERAGE_COLOR_MODE.

Specified by:
getColorMode in class GraphicsModeControl
Returns:
color mode (AVERAGE_COLOR_MODE or SUM_COLOR_MODE)

setColorMode

public void setColorMode(int mode)
                  throws VisADException,
                         java.rmi.RemoteException
Set the color mode used for combining color values.

Specified by:
setColorMode in class GraphicsModeControl
Parameters:
mode - mode to use (AVERAGE_COLOR_MODE or SUM_COLOR_MODE)
Throws:
VisADException
java.rmi.RemoteException

getPointMode

public boolean getPointMode()
Gets the point mode.

Specified by:
getPointMode in class GraphicsModeControl
Returns:
True if the display is using points rather than connected lines or surfaces for rendering.

setPointMode

public void setPointMode(boolean mode)
                  throws VisADException,
                         java.rmi.RemoteException
Sets the point mode and updates the display.

Specified by:
setPointMode in class GraphicsModeControl
Parameters:
mode - true if the display should use points rather than connected lines or surfaces for rendering.
Throws:
VisADException
java.rmi.RemoteException

setTextureEnable

public void setTextureEnable(boolean enable)
                      throws VisADException,
                             java.rmi.RemoteException
Set whether texture mapping should be used or not.

Specified by:
setTextureEnable in class GraphicsModeControl
Parameters:
enable - true to use texture mapping (the default)
Throws:
VisADException
java.rmi.RemoteException

getTextureEnable

public boolean getTextureEnable()
See if texture mapping is enabled or not

Specified by:
getTextureEnable in class GraphicsModeControl
Returns:
true if texture mapping is enabled.

setScaleEnable

public void setScaleEnable(boolean enable)
                    throws VisADException,
                           java.rmi.RemoteException
Toggle the axis scales in the display

Specified by:
setScaleEnable in class GraphicsModeControl
Parameters:
enable - true to enable, false to disable
Throws:
VisADException - couldn't change state of scale enablement
java.rmi.RemoteException - couldn't change state of scale enablement on remote display

getScaleEnable

public boolean getScaleEnable()
Get whether display scales are enabled or not

Specified by:
getScaleEnable in class GraphicsModeControl
Returns:
true if enabled, otherwise false

getTransparencyMode

public int getTransparencyMode()
Get the current transparency mode

Specified by:
getTransparencyMode in class GraphicsModeControl
Returns:
DisplayImplJ3D.FASTEST, DisplayImplJ3D.NICEST

setTransparencyMode

public void setTransparencyMode(int mode)
                         throws VisADException,
                                java.rmi.RemoteException
Sets the transparency mode.

Specified by:
setTransparencyMode in class GraphicsModeControl
Parameters:
mode - transparency mode to use. Legal values are DisplayImplJ3D.FASTEST, DisplayImplJ3D.NICEST
Throws:
VisADException - bad mode or couldn't create necessary VisAD object
java.rmi.RemoteException - couldn't create necessary remote object

setProjectionPolicy

public void setProjectionPolicy(int policy)
                         throws VisADException,
                                java.rmi.RemoteException
Sets the projection policy for the display. PARALLEL_PROJECTION will display a parallel view while PERSPECTIVE_PROJECTION will create a perspective view. The default is a perspective view.

Specified by:
setProjectionPolicy in class GraphicsModeControl
Parameters:
policy - policy to be used (DisplayImplJ3D.PARALLEL_PROJECTION or DisplayImplJ3D.PERSPECTIVE_PROJECTION
Throws:
VisADException - bad policy or can't create the necessary VisAD object
java.rmi.RemoteException - change policy on remote display

getProjectionPolicy

public int getProjectionPolicy()
Get the current projection policy for the display.

Specified by:
getProjectionPolicy in class GraphicsModeControl
Returns:
DisplayImplJ3D.PARALLEL_PROJECTION or DisplayImplJ3D.PERSPECTIVE_PROJECTION

setPolygonMode

public void setPolygonMode(int mode)
                    throws VisADException,
                           java.rmi.RemoteException
Sets the polygon rasterization mode.

Specified by:
setPolygonMode in class GraphicsModeControl
Parameters:
mode - the polygon rasterization mode to be used; one of DisplayImplJ3D.POLYGON_FILL, DisplayImplJ3D.POLYGON_LINE, or DisplayImplJ3D.POLYGON_POINT
Throws:
VisADException - bad mode or can't create the necessary VisAD object
java.rmi.RemoteException - can't change mode on remote display

getPolygonMode

public int getPolygonMode()
Get the current polygon rasterization mode.

Specified by:
getPolygonMode in class GraphicsModeControl
Returns:
DisplayImplJ3D.POLYGON_FILL, DisplayImplJ3D.POLYGON_LINE, or DisplayImplJ3D.POLYGON_POINT

getMissingTransparent

public boolean getMissingTransparent()
See whether missing values are rendered as transparent or not.

Specified by:
getMissingTransparent in class GraphicsModeControl
Returns:
true if missing values are transparent.

setMissingTransparent

public void setMissingTransparent(boolean missing)
Set the transparency of missing values.

Specified by:
setMissingTransparent in class GraphicsModeControl
Parameters:
missing - true if missing values should be rendered transparent.

getCurvedSize

public int getCurvedSize()
Get the undersampling factor of surface shape for curved texture maps

Specified by:
getCurvedSize in class GraphicsModeControl
Returns:
undersampling factor (default 10)

setCurvedSize

public void setCurvedSize(int curved_size)
Set the undersampling factor of surface shape for curved texture maps

Specified by:
setCurvedSize in class GraphicsModeControl
Parameters:
curved_size - undersampling factor (default 10)

clone

public java.lang.Object clone()
clone this GraphicsModeControlJ3D

Specified by:
clone in class GraphicsModeControl

syncControl

public void syncControl(Control rmt)
                 throws VisADException
Copy the state of a remote control to this control

Specified by:
syncControl in class Control
Parameters:
rmt - remote control to sync with this one
Throws:
VisADException - rmt == null or rmt is not a GraphicsModeControlJ3D or couldn't tell if control was changed.

equals

public boolean equals(java.lang.Object o)
Check to see if this GraphicsModeControlJ3D is equal to the object in question.

Overrides:
equals in class Control
Parameters:
o - object in question
Returns:
false if the objects are not the same and/or their states are not equal.

toString

public java.lang.String toString()
Return a string representation of this GraphicsModeControlJ3D

Overrides:
toString in class Control
Returns:
string that represents the state of this object.