Class Grid2DDisplayable

All Implemented Interfaces:
GridDisplayable
Direct Known Subclasses:
ImageSequenceDisplayable

public class Grid2DDisplayable extends RGBDisplayable implements GridDisplayable
A class to support showing 2D gridded data as color on a plane in a DisplayMaster.
Version:
$Revision: 1.33 $
Author:
Stuart Wier
  • Constructor Details

    • Grid2DDisplayable

      public Grid2DDisplayable(String name, boolean alphaflag) throws VisADException, RemoteException
      Constructs an instance with the supplied name.
      Parameters:
      name - a String identifier
      alphaflag - boolean flag whether to use transparency
      Throws:
      VisADException - from construction of super class
      RemoteException - from construction of super class
    • Grid2DDisplayable

      public Grid2DDisplayable(String name, RealType rgbRealType, float[][] colorPalette, boolean alphaflag) throws VisADException, RemoteException
      Constructs from a name for the Displayable and the type of the RGB parameter.
      Parameters:
      name - The name for the displayable.
      rgbRealType - The type of the RGB parameter. May be null.
      colorPalette - The initial colorPalette to use. May be null (Vis5D palette used as default).
      alphaflag - boolean - use Display.RBGA if true
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • Grid2DDisplayable

      protected Grid2DDisplayable(Grid2DDisplayable that) throws VisADException, RemoteException
      Constructs from another instance. The following attributes are set from the other instance: color palette, the color RealType.
      Parameters:
      that - The other instance.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
  • Method Details

    • setGrid2D

      public void setGrid2D(FieldImpl field) throws VisADException, RemoteException
      Set the data into the Displayable
      Parameters:
      field - a VisAD FlatField with a 2D nature
      Throws:
      VisADException - from construction of VisAd objects
      RemoteException - from construction of VisAD objects deprecated Should use setData now.
    • loadData

      public void loadData(FieldImpl field) throws VisADException, RemoteException
      Set the data into the Displayable; set RGB Type
      Specified by:
      loadData in interface GridDisplayable
      Parameters:
      field - a VisAD FlatField with a 2D nature
      Throws:
      VisADException - from construction of VisAd objects
      RemoteException - from construction of VisAD objects
    • cloneForDisplay

      public Displayable cloneForDisplay() throws RemoteException, VisADException
      Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.
      Overrides:
      cloneForDisplay in class DisplayableData
      Returns:
      A semi-deep clone of this instance.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • getDataRenderer

      protected DataRenderer getDataRenderer() throws VisADException
      Obtains the DataRenderer for this displayable.
      Overrides:
      getDataRenderer in class DisplayableData
      Returns:
      The DataRenderer for this displayable.
      Throws:
      VisADException - VisAD failure.
    • setTextureEnable

      public void setTextureEnable(boolean enable) throws VisADException, RemoteException
      Set whether this should be shown as color shading or as a texture map.
      Parameters:
      enable - true to enable texturing
      Throws:
      RemoteException
      VisADException
    • myAddConstantMaps

      protected void myAddConstantMaps(ConstantMap[] newMaps) throws VisADException, RemoteException
      Adds this instance's data references to the associated VisAD display if possible. This method does not verify that the VisAD display has been set.
      Overrides:
      myAddConstantMaps in class DisplayableData
      Parameters:
      newMaps - new maps
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • makeTextureMap

      protected ConstantMap makeTextureMap(boolean enable) throws VisADException, RemoteException
      Create a ConstantMap for texture mapping
      Parameters:
      enable - true to enable texture mapping
      Returns:
      ConstantMap for Texture mapping based on enable
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • getTextureEnable

      public boolean getTextureEnable()
      Get whether this is textured or smoothed
      Returns:
      true is textured
    • setMissingTransparent

      public void setMissingTransparent(boolean enable) throws VisADException, RemoteException
      Set whether missing values should be shown as transparent or not
      Parameters:
      enable - true enable missing transparency
      Throws:
      RemoteException
      VisADException
    • getMissingTransparent

      public boolean getMissingTransparent()
      Get whether this is textured or smoothed
      Returns:
      true is textured
    • setUseDefaultRenderer

      public void setUseDefaultRenderer(boolean use)
      Set whether to always use default renderer instead of specialized one.
      Parameters:
      use - true to always use the default renderer
    • getUseDefaultRenderer

      public boolean getUseDefaultRenderer()
      Get whether to always use default renderer instead of specialized one.
      Returns:
      true to always use the default renderer
    • setTextureProperties

      public void setTextureProperties(FieldImpl grid) throws VisADException, RemoteException
      A method that subclasses can call to set the texture properties on a Grid2DDisplayable. Checks to see if the grid is too big to not do texture mapping.
      Parameters:
      grid - grid to use to set the properties. Can be null.
      Throws:
      RemoteException
      VisADException
    • setColoredByAnother

      public void setColoredByAnother(boolean yesno)
      Set whether this GridDisplayable should have the data colored by another parameter. This implementation is a no-op.
      Specified by:
      setColoredByAnother in interface GridDisplayable
      Parameters:
      yesno - true if colored by another
    • setCurvedSize

      public void setCurvedSize(int size)
      Set the default texture curve size
      Overrides:
      setCurvedSize in class RGBDisplayable
      Parameters:
      size - size of texture
    • getCurvedSize

      public int getCurvedSize()
      Get the default texture curve size
      Overrides:
      getCurvedSize in class RGBDisplayable
      Returns:
      size of curved texture