Class TLspParameterizedLineStyle

All Implemented Interfaces:
ILspEffectsHintStyle, ILspWorldElevationStyle, ILspStyler

public final class TLspParameterizedLineStyle extends ALspStyle implements ILspWorldElevationStyle, ILspEffectsHintStyle
Style used to style ILcdPolyline. Most properties of this style can be controlled through expressions.

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

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

  • Visibility: determines whether the object is displayed or not
  • Color: the color of the line
  • Opacity: transparency of the line
Additionally, you can enable other behavior:
  • Width: determines the width of the line in pixels

For defaults, see TLspParameterizedLineStyle.Builder.

   ILcdExpression color = attribute("ColorAttribute", Color.class, new TLcdExpressionFactory.AttributeValueProvider() {
      public Color getValue(Object aDomainObject, Object aGeometry) {
         throw new RuntimeException("Not used for lines");

      public Color getValue(Object aDomainObject, Object aGeometry, int aIndex) {
        return aIndex % 2 == 0 ? :;
     TLspParameterizedLineStyle style = TLspParameterizedLineStyle.newBuilder()
In this example, the even vertices will be assigned a green color, while uneven will be blue. Between vertices the color will be interpolated between green and blue.

Note: -When using TLcdExpressionFactory.viewPositionAttribute(), the view position is calculated for each vertex of the line. - TLcdExpressionFactory.viewPositionAttribute() must not be used when the elevation mode is set to ILspWorldElevationStyle.ElevationMode.ON_TERRAIN or when the elevation mode is ILspWorldElevationStyle.ElevationMode.OBJECT_DEPENDENT and all z-values of the geometry are 0.
  • Method Details

    • newBuilder

      public static TLspParameterizedLineStyle.Builder<?> newBuilder()
      Creates a new builder with the default values.
      the new builder.
    • asBuilder

      public TLspParameterizedLineStyle.Builder<?> asBuilder()
      Creates a new builder initialized with all the properties of this style.
      Specified by:
      asBuilder in class ALspStyle
      the new builder.
    • getColor

      public ILcdExpression<Color> getColor()
      Gets the color expression.
      the color
    • getOpacity

      public ILcdExpression<Float> getOpacity()
      Returns the expression that determines transparency of the line.
      The expression
    • getVisibility

      public ILcdExpression<Boolean> getVisibility()
      Returns the expression that determines whether the object should be displayed or not.
      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
      whether or not this style is transparent
    • getWidth

      public double getWidth()
      Gets the line width (pixels). The returned value is always strictly positive.
      the line width
    • getDashPattern

      public TLspLineStyle.DashPattern getDashPattern()
      Gets the dash pattern.
      the dash pattern
    • getElevationMode

      public ILspWorldElevationStyle.ElevationMode getElevationMode()
      Description copied from interface: ILspWorldElevationStyle
      Returns the elevation mode of this style.
      Specified by:
      getElevationMode in interface ILspWorldElevationStyle
      The elevation mode.
    • 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
      the effects hints specified for this style
    • isCompatible

      public boolean isCompatible(TLspPaintPass aPaintPass)
      Description copied from class: ALspStyle
      Utility method to determine whether the style is compatible with the given paint pass.

      A style and paint pass are compatible if they use or request the same terrain and transparency properties.

      isCompatible in class ALspStyle
      aPaintPass - the paint pass
      true if the style can be used in the given paint pass, false otherwise.
    • equals

      public boolean equals(Object obj)
      equals in class ALspStyle
    • hashCode

      public int hashCode()
      hashCode in class ALspStyle
    • toString

      public String toString()
      toString in class Object