Package com.luciad.view.lightspeed.style
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
- 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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder used to create parameterized icon styles.Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.style.ILspEffectsHintStyle
ILspEffectsHintStyle.EffectsHint
Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.style.ILspWorldElevationStyle
ILspWorldElevationStyle.ElevationMode
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new builder initialized with all the properties of this style.boolean
Returns the effects hints specified for this style.Returns the elevation mode of this style.ILcdExpression
<? extends ILcdIcon> getIcon()
Returns the expression that determines what icon to use.Returns the expression that determines the minimum icon size in pixels.Gets the expression that determines the color that is modulated with the icon.Gets the expression that determines icon view offset in X direction.Gets the expression that determines the icon view offset in Y direction.Returns the expression that determines transparency added to the icon.getScale()
Returns the expression that determines factor by which the icon width and height are scaled.Returns the scaling mode of this style.Returns the expression that determines whether the object should be displayed or not.Returns the expression that determines the icon size in meters.int
hashCode()
boolean
Determines whether this style is transparent.static TLspParameterizedIconStyle.Builder
<?> Creates a new builder with the default values.boolean
Returns whether the icon respects its orientationMethods inherited from class com.luciad.view.lightspeed.style.ALspStyle
addStyleChangeListener, getZOrder, isCompatible, removeStyleChangeListener, style
-
Method Details
-
newBuilder
Creates a new builder with the default values.- Returns:
- the new builder.
- See Also:
-
getIcon
Returns the expression that determines what icon to use.- Returns:
- The expression
-
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 toVIEW_SCALING
orWORLD_SCALING_CLAMPED
.- Returns:
- the factor by which the icons are scaled
- See Also:
-
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
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 classALspStyle
- Returns:
- whether or not this style is transparent
-
getOffsetX
Gets the expression that determines icon view offset in X direction.- Returns:
- the icon view offset in X direction
-
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
Returns the scaling mode of this style.- Returns:
- an icon scaling mode.
-
getWorldSize
Returns the expression that determines the icon size in meters. This size only affects the style if the scaling mode is set toScalingMode.WORLD_SCALING
orScalingMode.WORLD_SCALING_CLAMPED
. By default this is set to 50000m.- Returns:
- A positive number expressing the icon size in meters.
-
getMinimumPixelSize
Returns the expression that determines the minimum icon size in pixels. This size only affects the style if the scaling mode is set toScalingMode.WORLD_SCALING_CLAMPED
orScalingMode.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
Returns the expression that determines whether the object should be displayed or not.- Returns:
- The expression
-
asBuilder
Description copied from class:ALspStyle
Creates a new builder initialized with all the properties of this style. -
getEffectsHints
Description copied from interface:ILspEffectsHintStyle
Returns the effects hints specified for this style.- Specified by:
getEffectsHints
in interfaceILspEffectsHintStyle
- Returns:
- the effects hints specified for this style
-
getElevationMode
Description copied from interface:ILspWorldElevationStyle
Returns the elevation mode of this style.- Specified by:
getElevationMode
in interfaceILspWorldElevationStyle
- Returns:
- The elevation mode.
-
equals
-
hashCode
public int hashCode()
-