Class TLspParameterizedIconStyle

java.lang.Object
com.luciad.view.lightspeed.style.ALspStyle
com.luciad.view.lightspeed.style.TLspParameterizedIconStyle
All Implemented Interfaces:
ILspEffectsHintStyle, ILspWorldElevationStyle, ILspStyler

public final class TLspParameterizedIconStyle extends ALspStyle implements ILspWorldElevationStyle, ILspEffectsHintStyle
Style used to style points as a flat icon (also known as a point sprite). Most properties of this style can be controlled through expressions.

Construction of this style is done through its TLspParameterizedIconStyle.Builder.

The following properties of this style are calculated by an expression:

  • Visibility: determines whether the object is displayed or not
  • Icon: determines the icon to display
  • Scale: a scale factor applied to the icon
  • Color: a modulation color applied to the icon
  • Opacity: additional transparency applied to the icon
  • Offset: offsets in 2D view coordinates
  • World size: determines the icon size in meters when using a world scaling mode
  • Minimum size: determines the minimum icon pixel size
Additionally, you can enable other behavior:
  • Orientation: whether the icons should be rotated to match the orientation of the domain object, or be aligned with the screen.
  • Scaling mode: determines the scaling mode of the icons.

For defaults, see TLspParameterizedIconStyle.Builder.

Example:

   ILcdExpression<Boolean> visibilityExpression = eq(idAttribute, constant(43));
   ILcdIcon[] icons = {someIcon, otherIcon};
   ILcdExpression<Integer> attributeExpression = attribute(Integer.class, dataProperty);
   ILcdExpression<ILcdIcon> iconExpression = map(attributeExpression, icons, defaultIcon);
   ILcdExpression<Float> opacityExpression = fraction(fuelBurnAttribute, 0, 13000);
   TLspParameterizedIconStyle style = TLspParameterizedIconStyle.newBuilder()
                                        .visibility(visibilityExpression)
                                        .icon(iconExpression)
                                        .opacity(opacityExpression)
                                        .build();
 
In this example, the object is visible if its ID is 43. The icon is determined by a class attribute, and the opacity depends on its fuel burn attribute.

Note: - For large static data sets it's recommended to use TLspPlotLayerBuilder with an TLspPlotStyle. - TLcdExpressionFactory.viewPositionAttribute() must not be used when the elevation mode is set to ILspWorldElevationStyle.ElevationMode.ON_TERRAIN.
Since:
2018.0
See Also:
  • Method Details

    • newBuilder

      public static TLspParameterizedIconStyle.Builder<?> newBuilder()
      Creates a new builder with the default values.
      Returns:
      the new builder.
      See Also:
    • getIcon

      public ILcdExpression<? extends ILcdIcon> getIcon()
      Returns the expression that determines what icon to use.
      Returns:
      The expression
    • getScale

      public ILcdExpression<Float> getScale()
      Returns the expression that determines factor by which the icon width and height are scaled. This scaling is applied in view coordinates, which makes it independent of the map scale. By default, icons are shown in their native size.

      This scaling only affects the icon if the scaling mode is set to VIEW_SCALING or WORLD_SCALING_CLAMPED.

      Returns:
      the factor by which the icons are scaled
      See Also:
    • getModulationColor

      public ILcdExpression<Color> getModulationColor()
      Gets the expression that determines the color that is modulated with the icon. For example using an icon with gray-scale colors and a red modulation color will result in a resulting painted icon with red hues.
      Returns:
      the modulation color
    • getOpacity

      public ILcdExpression<Float> getOpacity()
      Returns the expression that determines transparency added to the icon.
      Returns:
      The expression
    • isTransparent

      public boolean isTransparent()
      Description copied from class: ALspStyle
      Determines whether this style is transparent.

      Shapes that are transparent can be painted in a different paint phase than shapes that are not transparent.

      Specified by:
      isTransparent in class ALspStyle
      Returns:
      whether or not this style is transparent
    • getOffsetX

      public ILcdExpression<Float> getOffsetX()
      Gets the expression that determines icon view offset in X direction.
      Returns:
      the icon view offset in X direction
    • getOffsetY

      public ILcdExpression<Float> getOffsetY()
      Gets the expression that determines the icon view offset in Y direction.
      Returns:
      the icon view offset in Y direction
    • usesOrientation

      public boolean usesOrientation()
      Returns whether the icon respects its orientation
      Returns:
      true if the icon respects its orientation, false otherwise
    • getScalingMode

      public TLspIconStyle.ScalingMode getScalingMode()
      Returns the scaling mode of this style.
      Returns:
      an icon scaling mode.
    • getWorldSize

      public ILcdExpression<Float> getWorldSize()
      Returns 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.

      Returns:
      A positive number expressing the icon size in meters.
    • getMinimumPixelSize

      public ILcdExpression<Integer> getMinimumPixelSize()
      Returns the expression that determines the minimum icon size in pixels. 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.

      Returns:
      A positive number expressing the minimum icon size in pixels.
    • getVisibility

      public ILcdExpression<Boolean> getVisibility()
      Returns the expression that determines whether the object should be displayed or not.
      Returns:
      The expression
    • asBuilder

      public TLspParameterizedIconStyle.Builder<?> asBuilder()
      Description copied from class: ALspStyle
      Creates a new builder initialized with all the properties of this style.
      Specified by:
      asBuilder in class ALspStyle
      Returns:
      the new builder.
    • getEffectsHints

      public Collection<ILspEffectsHintStyle.EffectsHint> getEffectsHints()
      Description copied from interface: ILspEffectsHintStyle
      Returns the effects hints specified for this style.
      Specified by:
      getEffectsHints in interface ILspEffectsHintStyle
      Returns:
      the effects hints specified for this style
    • getElevationMode

      public ILspWorldElevationStyle.ElevationMode getElevationMode()
      Description copied from interface: ILspWorldElevationStyle
      Returns the elevation mode of this style.
      Specified by:
      getElevationMode in interface ILspWorldElevationStyle
      Returns:
      The elevation mode.
    • equals

      public boolean equals(Object aO)
      Overrides:
      equals in class ALspStyle
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ALspStyle