Class FlowDisplayable

All Implemented Interfaces:
GridDisplayable
Direct Known Subclasses:
WindBarbDisplayable

public class FlowDisplayable extends RGBDisplayable implements GridDisplayable
Provides support for a Displayable displays wind data (u,v) or (spd, dir) as wind vectors.
Author:
IDV Development Team
  • Field Details

    • FLOW_TYPE

      public static final String FLOW_TYPE
      The name of the "real-type" property.
      See Also:
    • COLOR

      public static String COLOR
      The name of the color property.
    • NH_ORIENTATION

      public static final int NH_ORIENTATION
      Value for Northern Hemisphere orientation
      See Also:
    • SH_ORIENTATION

      public static final int SH_ORIENTATION
      Value for Southern Hemisphere orientation
      See Also:
    • speedUnit

      protected Unit speedUnit
      max flow range
    • spdIndex

      protected int spdIndex
      speed index
  • Constructor Details

    • FlowDisplayable

      public FlowDisplayable(String name, RealTupleType rTT, float flowscale, boolean useSpeedForColor) throws VisADException, RemoteException
      Constructs from a name for the Displayable and the type of the parameter, and the desired size of "scale"
      Parameters:
      name - The name for the displayable.
      rTT - The VisAD RealTupleType of the parameter. May be null.
      flowscale - A float size for the "flow scale".
      useSpeedForColor - set to true if you want to color by speed
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • FlowDisplayable

      public FlowDisplayable(String name, RealTupleType rTT, float flowscale) throws VisADException, RemoteException
      Constructs from a name for the Displayable and the type of the parameter, and the desired size of "scale"
      Parameters:
      name - The name for the displayable.
      rTT - The VisAD RealTupleType of the parameter. May be null.
      flowscale - A float size for the "flow scale".
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • FlowDisplayable

      public FlowDisplayable(String name, RealTupleType rTT) throws VisADException, RemoteException
      Constructs from a name for the Displayable and the type of the parameter.
      Parameters:
      name - The name for the displayable.
      rTT - The VisAD RealTupleType of the parameter. May be null.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • FlowDisplayable

      protected FlowDisplayable(FlowDisplayable that) throws VisADException, RemoteException
      Constructs from another instance.
      Parameters:
      that - The other instance.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
  • Method Details

    • getFlowTuple

      public RealTupleType getFlowTuple()
      Returns the RealTupleType of the parameter.
      Returns:
      The RealTupleType of the parameter. May be null.
    • getStreamlinesEnabled

      public boolean getStreamlinesEnabled()
      Returns boolean whether streamlines are enabled.
      Returns:
      boolean whether streamlines are enabled.
    • setStreamlinesEnabled

      public void setStreamlinesEnabled(boolean enable)
      Sets whether streamlines are enabled.
      Parameters:
      enable - boolean whether streamlines are enabled.
    • setTrojectoriesEnabled

      public void setTrojectoriesEnabled(boolean enable, float mSize, boolean refresh)
      sets trajectory parms if the enable is true.
      Parameters:
      enable - boolean whether trajectories are enabled.
      mSize - _more_
      refresh - _more_
    • setTrojectoriesEnabled

      public void setTrojectoriesEnabled(boolean enable, boolean markerOn, float mSize, boolean refresh)
      sets trajectory parms if the enable is true.
      Parameters:
      enable - boolean is true if it is traj or cvector.
      markerOn - _more_
      mSize - _more_
      refresh - _more_
    • setIsTrajectories

      public void setIsTrajectories(boolean isTrajectories)
      _more_
      Parameters:
      isTrajectories - _more_
    • setStreamline

      public void setStreamline(boolean streamline)
      _more_
      Parameters:
      streamline - _more_
    • resetTrojectories

      public void resetTrojectories()
      resets trajectory parms
    • getBarbOrientation

      public int getBarbOrientation()
      Returns indicator whether wind barb style is that used in the northern hemisphere or the southern hemisphere.
      Returns:
      NH_ORIENTATION or SH_ORIENTATION
    • setBarbOrientation

      public void setBarbOrientation(int style)
      Set indicator whether wind barb style is that used in the northern hemisphere or the southern hemisphere.
      Parameters:
      style - either NH_ORIENTATION or SH_ORIENTATION.
    • getAdjustFlow

      public boolean getAdjustFlow()
      Returns indicator whether the flow should be adjusted to the earth
      Returns:
      true to adjust
    • setAdjustFlow

      public void setAdjustFlow(boolean adjust)
      Set indicator whether winds should be adusted or not
      Overrides:
      setAdjustFlow in class Displayable
      Parameters:
      adjust - true to adjust
    • setStreamlineDensity

      public void setStreamlineDensity(float density)
      Set the density of the streamlines
      Parameters:
      density - typically roughly .1 to 2.
    • setFlowScale

      public void setFlowScale(float scale)
      Set the length of shaft on vector or on wind barb.
      Parameters:
      scale - typically roughly 0.05 to 0.15.
    • setArrowHead

      public void setArrowHead(boolean onoff)
      _more_
      Parameters:
      onoff - _more_
    • setArrowHeadSize

      public void setArrowHeadSize(float size)
      _more_
      Parameters:
      size - _more_
    • setTracerType

      public void setTracerType(int type)
      _more_
      Parameters:
      type - _more_
    • setVectorLength

      public void setVectorLength(float len)
      _more_
      Parameters:
      len - _more_
    • setTrajOffset

      public void setTrajOffset(float offset)
      _more_
      Parameters:
      offset - _more_
    • setSmoothFactor

      public void setSmoothFactor(int factor)
      _more_
      Parameters:
      factor - _more_
    • setTrajFormType

      public void setTrajFormType(int formType)
      _more_
      Parameters:
      formType - _more_
    • setTrajStartLevel

      public void setTrajStartLevel(int startLevel)
      _more_
      Parameters:
      startLevel - _more_
    • getTrajStartLevel

      public int getTrajStartLevel()
      _more_
      Returns:
      _more_
    • setTrajWidth

      public void setTrajWidth(float width)
      _more_
      Parameters:
      width - _more_
    • getTrajWidth

      public float getTrajWidth()
      _more_
      Returns:
      _more_
    • setRibbonWidth

      public void setRibbonWidth(float width)
      _more_
      Parameters:
      width - _more_
    • getRibbonWidth

      public float getRibbonWidth()
      _more_
      Returns:
      _more_
    • setZskip

      public void setZskip(int skip)
      _more_
      Parameters:
      skip - _more_
    • getZskip

      public int getZskip()
      _more_
      Returns:
      _more_
    • getForward

      public boolean getForward()
      _more_
      Returns:
      _more_
    • setForward

      public void setForward(boolean forw)
      _more_
      Parameters:
      forw - _more_
    • setTrajStartPointType

      public void setTrajStartPointType(RealTupleType type)
      _more_
      Parameters:
      type - _more_
    • getTrajStartPointType

      public RealTupleType getTrajStartPointType()
      _more_
      Returns:
      _more_
    • setTrajStartPoints

      public void setTrajStartPoints(float[][] pts)
      _more_
      Parameters:
      pts - _more_
    • getTrajStartPoints

      public float[][] getTrajStartPoints()
      _more_
      Returns:
      _more_
    • setAutoScale

      public void setAutoScale(boolean auto)
      Set the autoscale property
      Parameters:
      auto - the autoscale property
    • setScalarMaps

      protected void setScalarMaps(ScalarMapSet maps) throws BadMappingException
      Sets the set of ScalarMap-s of this instance. The ScalarMap-s of this instance will be added to the set before the SCALAR_MAP_SET property is set. This method fires a PropertyChangeEvent for SCALAR_MAP_SET with null for the old value and the new set of ScalarMap-s for the new Value. Intermediate subclasses that have their own ScalarMap-s should override this method and invoke super.setScalarMaps(ScalarMapSet).
      Overrides:
      setScalarMaps in class RGBDisplayable
      Parameters:
      maps - The set of ScalarMap-s to be added.
      Throws:
      BadMappingException - The types of the maps have not been set or its ScalarMap is already in the set.
    • getSpeedTypeIndex

      public int getSpeedTypeIndex()
      Get the index of the speed type if this is not a cartesian wind
      Returns:
      the speed index or -1 if cartesian or not set
    • setFlowMaps

      protected void setFlowMaps() throws RemoteException, VisADException
      Make ScalarMaps for flow, for 1st and 2nd components of wind vector input data. If data is of form u,v (both components have units convertible with m/s) make map for 1st comp to Display.Flow1X and 2nd comp to Display.Flow1Y. If data is dir,spd or spd, dir, make map for dir comp to Display.Flow1Azimuth and spd comp to Display.Flow1Radial. Note - makes bad plot if data is v,u form
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • setFlowRange

      public void setFlowRange(Range flowRange) throws VisADException, RemoteException
      Set the range of the flow maps
      Parameters:
      flowRange - range for flow maps
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • setFlowRange

      public void setFlowRange(double min, double max) throws VisADException, RemoteException
      Set the range of the flow maps
      Parameters:
      min - min value
      max - max value
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • setGrid3D

      public void setGrid3D(FieldImpl field) throws VisADException, RemoteException
      Set the 3d grid (a FlatField) data into the Displayable
      Parameters:
      field - a VisAD FlatField with a 3D nature
      Throws:
      VisADException - from construction of VisAd objects
      RemoteException - from construction of VisAD objects
    • loadData

      public void loadData(FieldImpl field) throws VisADException, RemoteException
      Set the data into the Displayable
      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
    • loadTopoData

      public void loadTopoData(FieldImpl topo) throws VisADException, RemoteException
      _more_
      Parameters:
      topo - _more_
      Throws:
      RemoteException - _more_
      VisADException - _more_
    • setColor

      public void setColor(Color color) throws VisADException, RemoteException
      Sets the color of the vectors. Only overrides super.setColor to fire the property change event for backward compatibility.
      Overrides:
      setColor in class RGBDisplayable
      Parameters:
      color - color for the vectors.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • setType

      protected void setType(RealTupleType rTT) throws RemoteException, VisADException
      Sets the RealType of the parameter.
      Parameters:
      rTT - The new RealTupleType of the parameter. May not be null.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • 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.
    • isCartesianWind

      public boolean isCartesianWind()
      Check to see if the wind data is cartesian (u,v) or if it's polar (spd, dir).
      Returns:
      true if the wind is cartesian
    • get3DFlow

      public boolean get3DFlow()
      Check to see if this is 3D flow
      Returns:
      true if the flow is 3D
    • set3DFlow

      public void set3DFlow(boolean threeD)
      Set to use 3D flow
      Parameters:
      threeD - true if the flow is 3D
    • useDisplayUnitForColor

      protected boolean useDisplayUnitForColor()
      Does this object use the displayUnit (or the colorUnit) for its display unit. If we have the case where this wind field is colored by another field then this returns false.
      Overrides:
      useDisplayUnitForColor in class RGBDisplayable
      Returns:
      true if the display unit should be used for color
    • setColoredByAnother

      public void setColoredByAnother(boolean yesno)
      Set whether this GridDisplayable should have the data colored by another parameter.
      Specified by:
      setColoredByAnother in interface GridDisplayable
      Parameters:
      yesno - true if colored by another
    • setUseSpeedForColor

      public void setUseSpeedForColor(boolean yesno)
      Set whether this GridDisplayable should have the data colored by speed.
      Parameters:
      yesno - true if colored by speed
    • setIgnoreExtraParameters

      public void setIgnoreExtraParameters(boolean yesno)
      Set whether this GridDisplayable should ignore extra parameters
      Parameters:
      yesno - true if extra params should be ignored
    • setStartPoints

      public void setStartPoints(RealTupleType types, float[][] stp)
      _more_
      Parameters:
      types - _more_
      stp - _more_
    • setStartLevel

      public void setStartLevel(int startLevel)
      _more_
      Parameters:
      startLevel - _more_