Class TLspPlotStyle.Builder<B extends TLspPlotStyle.Builder<B>>

java.lang.Object
com.luciad.view.lightspeed.style.ALspStyle.Builder<B>
com.luciad.view.lightspeed.style.TLspPlotStyle.Builder<B>
All Implemented Interfaces:
ILspWorldElevationStyle.Builder
Direct Known Subclasses:
TLspPlotStyle.Builder
Enclosing class:
TLspPlotStyle

public static class TLspPlotStyle.Builder<B extends TLspPlotStyle.Builder<B>> extends ALspStyle.Builder<B> implements ILspWorldElevationStyle.Builder
Builder used to create plot styles.

Default values:

Since:
2014.0
See Also:
  • Constructor Details

    • Builder

      protected Builder()
  • Method Details

    • all

      public B all(ALspStyle aStyle)
      Description copied from class: ALspStyle.Builder
      Sets all parameters on the builder based on the given style.

      This is useful for example to create a new style that has almost all properties equal to another style.

      Specified by:
      all in class ALspStyle.Builder<B extends TLspPlotStyle.Builder<B>>
      Parameters:
      aStyle - the style to copy
      Returns:
      this
    • build

      public TLspPlotStyle build()
      Description copied from class: ALspStyle.Builder
      Builds the style with the set parameters.
      Specified by:
      build in class ALspStyle.Builder<B extends TLspPlotStyle.Builder<B>>
      Returns:
      the resulting style
    • elevationMode

      public B elevationMode(ILspWorldElevationStyle.ElevationMode aMode)
      Specifies the elevation mode. The default mode depends on the specific implementation.

      Only 'ON_TERRAIN' and 'ABOVE_ELLIPSOID' are supported for this style.

      Specified by:
      elevationMode in interface ILspWorldElevationStyle.Builder
      Parameters:
      aMode -
      Returns:
      this
    • visibility

      public B visibility(ILcdExpression<Boolean> aVisibilityExpression)
      Sets the expression that determines whether objects should be displayed or not.

      If not set, all objects in view are always displayed.

      Parameters:
      aVisibilityExpression - An expression of type Boolean
      Returns:
      this
    • scale

      public B scale(ILcdExpression<Float> aScaleExpression)
      Sets the expression that determines the scale factor to apply to the icons.

      • Scale 1 corresponds to the original size of the icon.
      • Scale <1 will shrink the icon.
      • Scale >1 will enlarge the icon.

      If not set, icons are never re-scaled.

      Note that you can apply automaticScaling(double) based on zoom level.

      Parameters:
      aScaleExpression - An expression of type Float
      Returns:
      this
    • scale

      public B scale(float aFixedScale)
      Sets a fixed scale factor to apply to all icons. See scale(ILcdExpression) for more details.
      Parameters:
      aFixedScale - The scale factor to apply
      Returns:
      this
    • density

      public B density(boolean aDensity)
      Sets whether or not density should be painted.

      The default is false.

      Alternatively, use density(IndexColorModel, double) to enable and configure the density plot.

      Turning density on is incompatible with enabling eyeDomeLighting(com.luciad.view.lightspeed.style.TLspEyeDomeLightingSettings) (EDL). Trying to combine both will result in an IllegalStateException to be thrown.

      Parameters:
      aDensity - True if density should be painted, false if density should not be painted.
      Returns:
      this
    • density

      public B density(IndexColorModel aIndexColorModel, double aHardness)
      Sets the density parameters for the density painting. Using this method will also turn density on.

      Turning density on is incompatible with enabling eyeDomeLighting(com.luciad.view.lightspeed.style.TLspEyeDomeLightingSettings) (EDL). Trying to combine both will result in an IllegalStateException to be thrown.

      Parameters:
      aIndexColorModel - a color model to use to visualize density (maps occurrence counts to color)
      aHardness - A value between 0 and 1 to determine how "hard" the density visualization should be. 0 is the softest value, and will result in a smooth transition from one point to the other. 1 is the hardest value, and will result in a sharp transition from one point to the other.
      Returns:
      this
      See Also:
    • automaticScaling

      public B automaticScaling(double aTargetWorldSize)
      Enables automatic scaling of icons based on the zoom level / distance to the camera.

      Icons will be rendered with a given size in world coordinates (typically meters), but will be clamped to their native size in view coordinates (pixels). The effect of this is that icons will get smaller if you zoom out, but will not get magnified if you zoom in. In 3D views, the icons will also be subject to perspective (i.e. icons will get smaller towards the horizon). This is equivalent to TLspIconStyle.ScalingMode.WORLD_SCALING_CLAMPED.

      Enabling this option is strongly recommended:

      • It reduces cluttering when zoomed out (2D), or of far away data (3D)
      • It improves performance

      If not set, icons are not rescaled based on zoom level.

      This setting can be combined with a custom scale(com.luciad.util.expression.ILcdExpression<java.lang.Float>) expression.

      Parameters:
      aTargetWorldSize - the maximum world size icons should be drawn at
      Returns:
      this
    • modulationColor

      public B modulationColor(ILcdExpression<Color> aColorExpression)
      Sets the expression that determines the modulation color to apply to the icons.

      Color Color.white corresponds to the original icon.

      If not set, icons keep their original color.

      Parameters:
      aColorExpression - An expression of type Color
      Returns:
      this
    • modulationColor

      public B modulationColor(Color aFixedColor)
      Sets a fixed modulation color to apply to all icons. See modulationColor(com.luciad.util.expression.ILcdExpression<java.awt.Color>) for more details.
      Parameters:
      aFixedColor - The modulation color to apply to all icons
      Returns:
      this
    • opacity

      public B opacity(ILcdExpression<Float> aOpacityExpression)
      Sets the expression that determines the transparency to apply to the icons. This value is multiplied with the alpha value of the modulation color to determine the transparency of the icon.

      • Opacity 1 corresponds to the original transparency icon.
      • Opacity <1 will make the icons more transparent.
      • Opacity 0 or <0 will make the icons completely transparent.
      • Opacity >1 has no effect.

      If not set, icons keep their original opacity determined by the alpha value of the modulation color.

      Parameters:
      aOpacityExpression - An expression of type Float
      Returns:
      this
    • opacity

      public B opacity(float aFixedOpacity)
      Sets a fixed opacity to apply to all icons. See opacity(ILcdExpression) for more details.
      Parameters:
      aFixedOpacity - The opacity to apply
      Returns:
      this
    • icon

      public B icon(ILcdExpression<? extends ILcdIcon> aIconExpression)
      Sets the expression that determines the icon to use.

      Use null to display dots instead of icons.

      If not set, dots are used (equivalent of null).

      Parameters:
      aIconExpression - An expression of type ILcdIcon
      Returns:
      this
    • icon

      public B icon(ILcdIcon aIcon)
      Sets an icon to use for all objects. See icon(ILcdExpression) for more details.
      Parameters:
      aIcon - The icon to use
      Returns:
      this
    • useOrientation

      public B useOrientation(boolean aOrientationEnabled)
      Sets whether the icon should respect its orientation. By default, this is set to false.

      The actual orientation that is applied to the icon will be retrieved from the ILcdOriented interface. Either the geometry returned by the ALspStyleTargetProvider or the model object should implement this interface. The geometry takes precedence if both objects implement this interface. The orientation is interpreted as an azimuth.

      If the geometry or domain object do not implement ILcdOriented, this option has no effect.

      Parameters:
      aOrientationEnabled - a flag indicating whether or not the icon should respect its orientation
      Returns:
      this
    • eyeDomeLighting

      public B eyeDomeLighting(TLspEyeDomeLightingSettings aEyeDomeLightingSettings)
      Sets the eye-dome lighting (EDL) settings. By default, EDL is disabled. See TLspEyeDomeLightingSettings for more details.

      Enabling EDL is incompatible with a density plot. Trying to combine both will result in an IllegalStateException to be thrown.

      Parameters:
      aEyeDomeLightingSettings - The settings to use
      Returns:
      this
      Since:
      2019.1