Class PbDataMapping

Direct Known Subclasses:
PbLinearDataMapping, PbNonLinearDataMapping, PbNonLinearDataMapping2

public class PbDataMapping extends PbBase
Abstract class for data mapping. Data mapping defines an association between colors, transparencies and floating-point values. Giving transparencies is not compulsory. When they are not given, they are supposed to be equal to 0 , i.e. each color is opaque.

Whichever data mapping, two threshold values can be defined, threshold_min and threshold_max. One color (cmin) and one transparency (transp_min) are associated to threshold_min . As well, cmax and transp_max are associated to threshold_max. For a given value vi <= threshold_min, the associated color ci is cmin and the associated transparency ti is transp_min. As well, for a given value vi >= threshold_max, the associated color ci is cmax and the associated transparency ti is transp_max.

By default min and max thresholds are disabled, threshold_min = 0 and threshold_max = 1 and no color is associated to threshold_min and threshold_max. Each part of primitive of which transparency is greater or equal 0.95 is deleted. This default value can be changed by the method setTransparencyValueDeletedParts().

  • Method Details

    • setMinThreshold

      public void setMinThreshold(float threshold_min, float[] cmin)
      Calls setMinThreshold(threshold_min, cmin, (float)0.0).
    • setMaxThreshold

      public void setMaxThreshold(float threshold_max, SbColor cmax)
      Calls setMaxThreshold(threshold_max, cmax, (float)0.0).
    • setMinThreshold

      public void setMinThreshold(float threshold_min, SbColor cmin)
      Calls setMinThreshold(threshold_min, cmin, (float)0.0).
    • setMaxThreshold

      public void setMaxThreshold(float threshold_max, float[] cmax)
      Calls setMaxThreshold(threshold_max, cmax, (float)0.0).
    • setMinThreshold

      public void setMinThreshold(float threshold_min, SbColor cmin, float transp_min)
      Sets a minimum threshold, associated to a RGB color and a transparency value.
    • setMinThreshold

      public void setMinThreshold(float threshold_min, float[] cmin, float transp_min)
      Sets a minimum threshold, associated to a HLS color and a transparency value.
    • setMaxThreshold

      public void setMaxThreshold(float threshold_max, float[] cmax, float transp_max)
      Sets a maximum threshold, associated to a HLS color and a transparency value.
    • setMaxThreshold

      public void setMaxThreshold(float threshold_max, SbColor cmax, float transp_max)
      Sets a maximum threshold, associated to a RGB color and a transparency value.
    • setMaxThreshold

      public void setMaxThreshold(float threshold_max)
      Sets a maximum threshold. No color is associated to this threshold.
    • setMinThreshold

      public void setMinThreshold(float threshold_min)
      Sets a minimum threshold. No color is associated to this threshold.
    • getHLSColor

      public float[] getHLSColor(float value)
      Gets HLS color associated with a value. If the returned value is NULL, this means that there is no color associated with this value.
    • thresholdsEnabled

      public boolean[] thresholdsEnabled()
      Returns min=true if the minimum threshold is enabled, otherwise false. Idem with max.
    • enableTransparency

      public void enableTransparency(boolean flag)
      Enable/Disable the taking into account of transparency. If it is disable, the different shape are always opaque.
    • enableThresholds

      public void enableThresholds(boolean min, boolean max)
      Enable/Disable the taking into account of threshold values.
    • getTransparencyValueDeletedParts

      public float getTransparencyValueDeletedParts()
      Gets a value that defines the following property : each primitive part of which transparency >= value, is deleted.
    • isTransparencyEnabled

      public boolean isTransparencyEnabled()
      Returns true if transparency is enabled, otherwise false.
    • setTransparencyValueDeletedParts

      public void setTransparencyValueDeletedParts(float value)
      Sets a value that defines the following property : each primitive part of which transparency >= value, is deleted. value = 0.95 by default.