Class TLspParameterizedIconStyle.Builder<B extends TLspParameterizedIconStyle.Builder<B>>

java.lang.Object
com.luciad.view.lightspeed.style.ALspStyle.Builder<B>
com.luciad.view.lightspeed.style.TLspParameterizedIconStyle.Builder<B>
All Implemented Interfaces:
ILspEffectsHintStyle.Builder, ILspWorldElevationStyle.Builder
Enclosing class:
TLspParameterizedIconStyle

public static class TLspParameterizedIconStyle.Builder<B extends TLspParameterizedIconStyle.Builder<B>> extends ALspStyle.Builder<B> implements ILspWorldElevationStyle.Builder, ILspEffectsHintStyle.Builder
Since:
2018.0
See Also:
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • icon

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

      If an icon provided by the expression is an ILcdAnchoredIcon, the anchor point will automatically become the point of rotation, as well as the anchor point of the icon in the view.

      Parameters:
      aIcon - An expression of type ILcdIcon
      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.

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

      public B scale(ILcdExpression<Float> aScaleFactorExpression)
      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.

      Parameters:
      aScaleFactorExpression - An expression of type Float
      Returns:
      this
    • scalingMode

      public B scalingMode(TLspIconStyle.ScalingMode aScalingMode)
      Sets the scaling mode of the icons. By default this is set to ScalingMode.VIEW_SCALING.
      Parameters:
      aScalingMode - a scaling mode
      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
    • offset

      public B offset(ILcdExpression<Float> aOffsetX, ILcdExpression<Float> aOffsetY)

      Sets expressions that determine the icon offsets in 2D view coordinates. This offset is applied after all other transformations have been applied. In other words: Scaling and rotation are applied first. Then this offset is done as a post-effect.

      To support anchored icons, and rotations of icons around a specific point in the icon, please supply the icon(ILcdExpression) method with an expression that provides ILcdAnchoredIcon.

      Parameters:
      aOffsetX - the offset in X direction
      aOffsetY - the offset in Y direction
      Returns:
      this;
      See Also:
    • zOrder

      public B zOrder(int aZOrder)
      Sets the Z-order of this style. Styles should be painted from lowest to highest Z-order.

      Increasing the number of different Z-orders can negatively impact painting performance. By default, it is set to 0.

      Parameters:
      aZOrder - the z order
      Returns:
      this
    • minimumPixelSize

      public B minimumPixelSize(ILcdExpression<Integer> aMinimumPixelSize)
      Sets the expression that determines the minimum icon pixel size. This size only affects the style if the scaling mode is set to ScalingMode.WORLD_SCALING_CLAMPED or ScalingMode.WORLD_SCALING. As soon as the largest dimension (i.e. width or height) of the icon is smaller than this minimum pixel size, the icon will be scaled to satisfy this minimum size.

      By default this value is set to 0, which indicates that no minimum size will be enforced.

      Parameters:
      aMinimumPixelSize - An expression of type Float
      Returns:
      this
    • worldSize

      public B worldSize(ILcdExpression<Float> aWorldSize)
      Sets the expression that determines the icon size in meters. This size only affects the style if the scaling mode is set to ScalingMode.WORLD_SCALING or ScalingMode.WORLD_SCALING_CLAMPED.

      By default this is set to 50000m.

      Parameters:
      aWorldSize - An expression of type Float.
      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
    • opacity

      public B opacity(ILcdExpression<Float> aOpacity)
      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:
      aOpacity - An expression of type Float
      Returns:
      this
    • build

      Description copied from class: ALspStyle.Builder
      Builds the style with the set parameters.
      Specified by:
      build in class ALspStyle.Builder<B extends TLspParameterizedIconStyle.Builder<B>>
      Returns:
      the resulting style
    • effectsHints

      public B effectsHints(ILspEffectsHintStyle.EffectsHint... aEffectsHints)
      Description copied from interface: ILspEffectsHintStyle.Builder
      Specifies the effects hints to be added to the style.
      Specified by:
      effectsHints in interface ILspEffectsHintStyle.Builder
      Parameters:
      aEffectsHints - the effects hints to be added to the style
      Returns:
      this
    • elevationMode

      public B elevationMode(ILspWorldElevationStyle.ElevationMode aMode)
      Description copied from interface: ILspWorldElevationStyle.Builder
      Specifies the elevation mode. The default mode depends on the specific implementation.
      Specified by:
      elevationMode in interface ILspWorldElevationStyle.Builder
      Parameters:
      aMode -
      Returns:
      this
    • all

      public B all(ALspStyle aStyle)
      Sets all builder parameters to the properties of the provided style.
      Specified by:
      all in class ALspStyle.Builder<B extends TLspParameterizedIconStyle.Builder<B>>
      Parameters:
      aStyle - the style to copy
      Returns:
      this