public final class StyleExpressionFactory extends Object
style expressions
that can be used when styling data.
and
, or
, not
, eq
, neq
, lt
, lte
, gt
, gte
min
, max
, clamp
, mix
, add
, subtract
, multiply
, divide
, between
, fraction
ifThenElse
, map
, mixMap
, cases
constant
, attribute (double)
, attribute (color)
, attribute (coordinate)
, attribute (position)
, parameter
sin
, cos
, tan
, asin
, acos
, atan
cross product
, dot product
, divide
, multiply
, add
, substract
distance
, length
Example:
if (value1 < value2) { return "Color(255, 55, 55, 127)"; else { return "Color(55, 255, 55, 127)"; }can be converted to an expression:
StyleExpression<Color> expression = StyleExpressionFactory.ifThenElse(
StyleExpressionFactory.lt(StyleExpressionFactory.constant(value1), StyleExpressionFactory.constant(value2)), // comparison
StyleExpressionFactory.constant(color(255, 55, 55, 127)), // then
StyleExpressionFactory.constant(color(55, 255, 55, 127))); // else
Modifier and Type | Method and Description |
---|---|
static StyleExpression<Double> |
abs(StyleExpression<Double> value)
Creates an expression that returns an expression with the absolute value.
|
static <T> StyleExpression<T> |
acos(StyleExpression<T> operand)
Creates an expression that takes the arccosine of another expression.
|
static <T,U> StyleExpression<T> |
add(StyleExpression<T> first,
StyleExpression<U> second)
Creates an expression that adds the values of the two provided expressions.
|
static StyleExpression<Boolean> |
andOp(StyleExpression<Boolean> value1,
StyleExpression<Boolean> value2)
Creates an expression that is the boolean 'and' of its parts.
|
static <T> StyleExpression<T> |
asin(StyleExpression<T> operand)
Creates an expression that takes the arcsine of another expression.
|
static <T> StyleExpression<T> |
atan(StyleExpression<T> operand)
Creates an expression that takes the arcsine of another expression.
|
static StyleExpression<Boolean> |
between(StyleExpression<Double> lowerBound,
StyleExpression<Double> upperBound,
StyleExpression<Double> value)
Creates an expression that evaluates whether the result of the operand is between a lower and upper bound (inclusive).
|
static <T> StyleExpression<T> |
cases(StyleExpression<T> defaultExpression,
List<StyleExpression<Boolean>> conditions,
List<StyleExpression<T>> expressions) |
static <T,U> StyleExpression<T> |
clamp(StyleExpression<T> operand,
StyleExpression<U> lowerBound,
StyleExpression<U> upperBound)
Creates an expression that limits an operand to a range.
|
static StyleExpression<android.graphics.Color> |
colorAttribute(String attributeName)
Creates an attribute expression that represents a color.
|
static <T> StyleExpression<T> |
constant(T value)
Creates an expression that represents a 'constant' value.
|
static StyleExpression<Coordinate> |
coordinateAttribute(String attributeName)
Creates an attribute expression that represents a coordinate.
|
static <T> StyleExpression<T> |
cos(StyleExpression<T> operand)
Creates an expression that takes the cosine of another expression.
|
static StyleExpression<Coordinate> |
crossProduct(StyleExpression<Coordinate> first,
StyleExpression<Coordinate> second)
Creates an expression that calculates the cross product of two expressions representing
Coordinate . |
static StyleExpression<android.graphics.Color> |
defaultColor()
Creates an expression representing the default color that is applied to a mesh.
|
static <T> StyleExpression<Double> |
distance(StyleExpression<T> first,
StyleExpression<T> second)
Creates an expression that calculates the Euclidean distance between two expressions representing points.
|
static <T,U> StyleExpression<T> |
divide(StyleExpression<T> first,
StyleExpression<U> second)
Creates an expression that divides the value of the first expression by the value of the second expression.
|
static <T> StyleExpression<Double> |
dotProduct(StyleExpression<T> first,
StyleExpression<T> second)
Creates an expression that calculates the dot product of the given expressions.
|
static StyleExpression<Double> |
doubleAttribute(String attributeName)
Creates an attribute expression that represents a double.
|
static StyleExpression<Boolean> |
eq(StyleExpression<Double> first,
StyleExpression<Double> second,
StyleExpression<Double> threshold)
Creates an expression that evaluates whether the two given expression evaluate to close values, given some threshold.
|
static <T> StyleExpression<Boolean> |
eq(StyleExpression<T> first,
StyleExpression<T> second)
Creates an expression that evaluates whether the two given expression evaluate to the same value.
|
static <T,U> StyleExpression<T> |
fraction(StyleExpression<T> operand,
StyleExpression<U> lowerBound,
StyleExpression<U> upperBound)
Creates an expression that calculates the fraction of the given operand in the range
[lowerBound, upperBound] evaluates to (operand - lowerBound) / (upperBound - lowerBound) . |
static StyleExpression<Boolean> |
frontFacing()
Creates an expression that determines whether a part of a mesh is facing to or away from the camera.
|
static StyleExpression<Boolean> |
gt(StyleExpression<Double> first,
StyleExpression<Double> second)
Creates an expression that evaluates whether the result of the first expression is strictly greater than the result of the second expression.
|
static StyleExpression<Boolean> |
gte(StyleExpression<Double> first,
StyleExpression<Double> second)
Creates an expression that evaluates whether the result of the first expression is greater than or equal to the result of the second expression.
|
static <T> StyleExpression<T> |
ifThenElse(StyleExpression<Boolean> condition,
StyleExpression<T> thenExpression,
StyleExpression<T> elseExpression)
Creates an expression that implements if-then-else logic.
|
static StyleExpression<Double> |
length(StyleExpression<Coordinate> operand)
Creates an expression that calculates the length of a
Coordinate . |
static <T> StyleExpression<T> |
log(StyleExpression<T> operand)
Creates an expression that takes the natural logarithm of another expression.
|
static StyleExpression<Boolean> |
lt(StyleExpression<Double> first,
StyleExpression<Double> second)
Creates an expression that evaluates whether the result of the first expression is strictly less than the result of the second expression.
|
static StyleExpression<Boolean> |
lte(StyleExpression<Double> first,
StyleExpression<Double> second)
Creates an expression that evaluates whether the result of the first expression is less than or equal to the result of the second expression.
|
static <T> StyleExpression<T> |
map(StyleExpression<Double> indexExpression,
List<StyleExpression<T>> values,
StyleExpression<T> defaultExpression) |
static <T,U> StyleExpression<T> |
max(StyleExpression<T> first,
StyleExpression<U> second)
Creates an expression that returns the maximum of the given expressions.
|
static <T,U> StyleExpression<T> |
min(StyleExpression<T> first,
StyleExpression<U> second)
Creates an expression that returns the minimum of the given expressions.
|
static <T> StyleExpression<T> |
mix(StyleExpression<T> first,
StyleExpression<T> second,
StyleExpression<Double> fraction)
Creates an expression that calculates an interpolated or extrapolated result between the result of first and second based on the result of fraction.
|
static <T> StyleExpression<T> |
mixMap(StyleExpression<Double> fraction,
List<StyleExpression<T>> values) |
static <T,U> StyleExpression<T> |
multiply(StyleExpression<T> first,
StyleExpression<U> second)
Creates an expression that multiplies the values of the two provided expressions.
|
static <T> StyleExpression<Boolean> |
neq(StyleExpression<T> first,
StyleExpression<T> second)
Creates an expression that evaluates whether the two given expression do not evaluate to the same value.
|
static StyleExpression<Coordinate> |
normalize(StyleExpression<Coordinate> operand)
Creates an expression that normalizes a
Coordinate . |
static StyleExpression<Boolean> |
notOp(StyleExpression<Boolean> value)
Creates an expression that is the boolean 'not' of the given expression.
|
static StyleExpression<Boolean> |
orOp(StyleExpression<Boolean> value1,
StyleExpression<Boolean> value2)
Creates an expression that is the boolean 'or' of its parts.
|
static <T> StyleExpression<T> |
parameter(Observable<T> observable)
Creates a parameter expression that is a style expression that can be changed at runtime.
|
static StyleExpression<Coordinate> |
positionAttribute()
Creates an expression that represents the position of the data that is styled.
|
static <T> StyleExpression<T> |
pow(StyleExpression<T> first,
StyleExpression<T> second)
Creates an expression that returns the result of the first expression raised to the power of the result of the second expression.
|
static <T> StyleExpression<T> |
sin(StyleExpression<T> operand)
Creates an expression that takes the sine of another expression.
|
static <T,U> StyleExpression<T> |
subtract(StyleExpression<T> first,
StyleExpression<U> second)
Creates an expression that subtracts the value of the second expression from the value of the first expression.
|
static <T> StyleExpression<T> |
tan(StyleExpression<T> operand)
Creates an expression that takes the tangent of another expression.
|
@NotNull public static <T> StyleExpression<T> constant(@NotNull T value)
T
- the type of the constant: java.lang.Double
, java.lang.Boolean
, Coordinate
or android.graphics.Color
.value
- a value for the constant.@NotNull public static <T> StyleExpression<T> parameter(@NotNull Observable<T> observable)
When it is changed, the styling will be updated to reflect the new value without having to re-create the expressions in which it is used. This makes it possible to make changes to the styling with almost-zero overhead.
T
- the type of the constant: java.lang.Double
, java.lang.Boolean
, Coordinate
or android.graphics.Color
.observable
- an object that represents a mutable value. Users can hold on to this Observable
in order to change the parameter value.@NotNull public static <T> StyleExpression<T> mix(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second, @NotNull StyleExpression<Double> fraction)
T
- the type of the value to mix. Can be java.lang.Double
, Coordinate
or android.graphics.Color
.first
- the first expression that is mixedsecond
- the second expression that is mixedfraction
- the mixing fraction. In range [0, 1] for interpolation. May also be a value outside that interval for extrapolation.@NotNull public static <T> StyleExpression<T> acos(@NotNull StyleExpression<T> operand)
T
- the type of the operand. Can be java.lang.Double
, Coordinate
.operand
- the expression of which to take the arccosine. For Coordinate
, the function is applied to the individual element values.Coordinate
.@NotNull public static <T> StyleExpression<T> asin(@NotNull StyleExpression<T> operand)
T
- the type of the operand. Can be java.lang.Double
, Coordinate
.operand
- the expression of which to take the arcsine. For Coordinate
, the function is applied to the individual element values.Coordinate
.@NotNull public static <T> StyleExpression<T> atan(@NotNull StyleExpression<T> operand)
T
- the type of the operand. Can be java.lang.Double
, Coordinate
.operand
- the expression of which to take the arctangent. For Coordinate
, the function is applied to the individual element values.Coordinate
.@NotNull public static <T> StyleExpression<T> cos(@NotNull StyleExpression<T> operand)
T
- the type of the operand. Can be double or Coordinate
.operand
- the expression of which to take the cosine. For Coordinate
, the function is applied to the individual element values. Values assumed to be in radians.Coordinate
.@NotNull public static <T> StyleExpression<T> sin(@NotNull StyleExpression<T> operand)
T
- the type of the operand. Can be java.lang.Double
, Coordinate
.operand
- the expression of which to take the sine. For Coordinate
, the function is applied to the individual element values. Values assumed to be in radians.Coordinate
.@NotNull public static <T> StyleExpression<T> tan(@NotNull StyleExpression<T> operand)
T
- the type of the operand. Can be java.lang.Double
, Coordinate
.operand
- the expression of which to take the tangent. For Coordinate
, the function is applied to the individual element values. Values assumed to be in radians.Coordinate
.@NotNull public static <T> StyleExpression<T> pow(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second)
The type of the operands should be the same. The (elements of the) first argument must not be less than 0 and if it is 0, the (corresponding elements of the) second argument must be greater than 0.
T
- the type of the expressions: java.lang.Double
, Coordinate
.first
- The first expression to evaluate. Should result in a double, Coordinate
or android.graphics.Color.second
- The second expression to evaluate. Should result in the same type as first.Coordinate
depending on the type of the operands.@NotNull public static <T> StyleExpression<T> log(@NotNull StyleExpression<T> operand)
T
- the type of the operand expression: java.lang.Double
, Coordinate
.operand
- The expression of which to take the natural logarithm. Should result in a double, Coordinate
.@NotNull public static <T,U> StyleExpression<T> min(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
T
- the type of the first expression: java.lang.Double
, Coordinate
or android.graphics.Color
.U
- the type of the second expression. Must be equal to T, or java.lang.Double
.first
- The first expression to evaluate. Should result in a double, point or color.second
- The second expression to evaluate. Should result in the same type as first or a double.android.graphics.Color
, each component is treated as a normalized value ([0, 1]
)).@NotNull public static <T,U> StyleExpression<T> max(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
T
- the type of the first expression: java.lang.Double
, Coordinate
or android.graphics.Color
.U
- the type of the second expression. Must be equal to T, or java.lang.Double
.first
- The first expression to evaluate. Should result in a double, point or color.second
- The second expression to evaluate. Should result in the same type as first or a double.android.graphics.Color
, each component is treated as a normalized value ([0, 1]
)).@NotNull public static <T,U> StyleExpression<T> add(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
If both expressions are of the same type, the values are added as expected. If the first expression is of type Coordinate
or android.graphics.Color
, and second expression is of type double, then the value of second expression is added to every sub element of the first expression (note that for android.graphics.Color
, each component is treated as a normalized value ([0, 1]
)).
T
- the type of the value of the first expression. Can be java.lang.Double
, Coordinate
or android.graphics.Color
.U
- the type of the value of the second expression. Can be the same as T, or java.lang.Double
.first
- the first expression to be addedsecond
- the second expression to be added@NotNull public static <T,U> StyleExpression<T> subtract(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
If both expressions are of the same type, the values are subtracted as expected. If the first expression is of type Coordinate
or android.graphics.Color
, and second expression is of type double, then the value of second expression is subtracted from every sub element of the first expression (note that for android.graphics.Color
, each component is treated as a normalized value ([0, 1]
)).
T
- the type of the value of the first expression. Can be java.lang.Double
, Coordinate
or android.graphics.Color
.U
- the type of the value of the second expression. Can be the same as T, or java.lang.Double
.first
- the expression to be subtracted fromsecond
- the expression to be subtracted@NotNull public static <T,U> StyleExpression<T> multiply(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
If both expressions are of the same type, the values are multiplied component by component. If the first expression is of type Coordinate
or android.graphics.Color
, and second expression is of type double, then the value of second expression is multiplied with every sub element of the first expression (note that for android.graphics.Color
, each component is treated as a normalized value ([0, 1]
)).
T
- the type of the value of the first expression. Can be java.lang.Double
, Coordinate
or android.graphics.Color
.U
- the type of the value of the second expression. Can be the same as T, or java.lang.Double
.first
- the first expression to be multipliedsecond
- the second expression to be multiplied@NotNull public static <T,U> StyleExpression<T> divide(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
If both expressions are of the same type, the values are divided component by component. If the first expression is of type Coordinate
or android.graphics.Color
, and second expression is of type double, then every sub element of the first expression is divided by the value of second expression (note that for android.graphics.Color
, each component is treated as a normalized value ([0, 1]
)).
T
- the type of the value of the first expression. Can be java.lang.Double
, Coordinate
or android.graphics.Color
.U
- the type of the value of the second expression. Can be the same as T, or java.lang.Double
.first
- the dividend expressionsecond
- the divisor expression@NotNull public static <T,U> StyleExpression<T> fraction(@NotNull StyleExpression<T> operand, @NotNull StyleExpression<U> lowerBound, @NotNull StyleExpression<U> upperBound)
[lowerBound, upperBound]
evaluates to (operand - lowerBound) / (upperBound - lowerBound)
.
For values of operand outside the range [lowerBound, upperBound]
, the results will lie outside the range [0, 1]
. If the operand is of type Coordinate
or android.graphics.Color
and the bounds are of type double, the result will be of the same type as the operand with fraction being applied on each component (note that for android.graphics.Color
, each component is treated as a normalized value ([0, 1]
)).
T
- the type of the operand: java.lang.Double
, Coordinate
or android.graphics.Color
.U
- the type of lowerBound and upperBound. Must be equal to T, or java.lang.Double
.operand
- the operand to evaluatelowerBound
- the lowerBound to evaluate.upperBound
- the upperBoundBound to evaluate.@NotNull public static <T,U> StyleExpression<T> clamp(@NotNull StyleExpression<T> operand, @NotNull StyleExpression<U> lowerBound, @NotNull StyleExpression<U> upperBound)
The type of the bounds has to be the same. For Coordinate
or android.graphics.Color
, the clamping is applied to each component independently, either using the corresponding component in the bound (if of the same type as operand) or the bound value if double (note that for android.graphics.Color
, each component is treated as a normalized value ([0, 1]
)).
T
- the type of the operand: java.lang.Double
, Coordinate
or android.graphics.Color
.U
- the type of lowerBound and upperBound. Must be equal to T, or java.lang.Double
.operand
- the operand to evaluate. Should result in a double, point or color.lowerBound
- a double expression representing the lowerBoundupperBound
- a double expression representing the upperBound[lowerBound, upperBound]
. If operand is a android.graphics.Color or Coordinate
and bounds are doubles, the operation is applies to the individual element values.@NotNull public static <T> StyleExpression<Boolean> eq(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second)
Note: in most cases, it is advised to use a threshold when comparing values. This can be done using the eq method that also takes a threshold expression as parameter.
T
- the type of the value of both expressions. Can be java.lang.Boolean
, java.lang.Double
, Coordinate
or android.graphics.Color
.first
- the first expression to be comparedsecond
- the second expression to be compared@NotNull public static <T> StyleExpression<Boolean> neq(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second)
T
- the type of the value of both expressions. Can be java.lang.Boolean
, java.lang.Double
, Coordinate
or android.graphics.Color
.first
- the first expression to be comparedsecond
- the second expression to be compared@NotNull public static <T> StyleExpression<T> ifThenElse(@NotNull StyleExpression<Boolean> condition, @NotNull StyleExpression<T> thenExpression, @NotNull StyleExpression<T> elseExpression)
T
- the type of the value of thenExpression and elseExpression. Can be java.lang.Boolean
, java.lang.Double
, Coordinate
or android.graphics.Color
.condition
- the expression that decides which of the other expressions to takethenExpression
- the expression whose result will be returned if condition is trueelseExpression
- the expression whose result will be returned if condition is false@NotNull public static <T> StyleExpression<T> cases(@NotNull StyleExpression<T> defaultExpression, @NotNull List<StyleExpression<Boolean>> conditions, @NotNull List<StyleExpression<T>> expressions)
@NotNull public static <T> StyleExpression<Double> dotProduct(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second)
The type of the result of the two given expressions should be the same. You can take the dot product of doubles or Coordinate
. Coordinates interpreted as vectors for this operation.
T
- the type of the first and second expressions: double, Coordinate
.first
- The first expression to evaluate. Should result in a double, Coordinate
.second
- The second expression to evaluate. Should result in the same type as first.@NotNull public static <T> StyleExpression<T> map(@NotNull StyleExpression<Double> indexExpression, @NotNull List<StyleExpression<T>> values, @NotNull StyleExpression<T> defaultExpression)
@NotNull public static <T> StyleExpression<T> mixMap(@NotNull StyleExpression<Double> fraction, @NotNull List<StyleExpression<T>> values)
@NotNull public static <T> StyleExpression<Double> distance(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second)
The distance is defined as follows for the following supported types:
abs(second - first)
.
Coordinate
: the regular cartesian distance: sqrt(x*x + y*y + z*z)
.
T
- the type of expressions: java.lang.Double
, Coordinate
.first
- the first expressionsecond
- the second expression@NotNull public static StyleExpression<Double> abs(@NotNull StyleExpression<Double> value)
value
- the input for the abs function@NotNull public static StyleExpression<Boolean> andOp(@NotNull StyleExpression<Boolean> value1, @NotNull StyleExpression<Boolean> value2)
value1
- the first expression to which the 'and' operator is appliedvalue2
- the second expression to which the 'and' operator is applied@NotNull public static StyleExpression<Boolean> orOp(@NotNull StyleExpression<Boolean> value1, @NotNull StyleExpression<Boolean> value2)
value1
- the first expression to which the 'or' operator is appliedvalue2
- the second expression to which the 'or' operator is applied@NotNull public static StyleExpression<Boolean> notOp(@NotNull StyleExpression<Boolean> value)
value
- a boolean expression@NotNull public static StyleExpression<Double> doubleAttribute(@NotNull String attributeName)
Expressions are evaluated for certain objects. Those object may have attributes ascribed to them. This expression allows access to those attributes by name. Which attributes are available depends on the evaluator of the expression, and on the data itself.
For example, for OGC 3D tiles
point cloud data, there is no fixed set of available attributes, but data files can define certain attributes, like 'color' or 'intensity' for each of the points in the point cloud. When these attributes are known up-front, you can use them as part of the style expression, for example to give each point its actual color, or to create a color based on the intensity value.
You can discover which attributes you can use in the documentation of the model decoder of the format that is used. For example:
When you display 3D tiles data
, the layer only loads a subset of the available attributes in memory by default. To make sure that all required attributes are loaded, you must specify
which attributes are used in the style expressions.
attributeName
- the name of the attribute.@NotNull public static StyleExpression<Coordinate> coordinateAttribute(@NotNull String attributeName)
Expressions are evaluated for certain objects. Those object may have attributes ascribed to them. This expression allows access to those attributes by name. Which attributes are available depends on the evaluator of the expression, and on the data itself.
For example, for OGC 3D tiles
point cloud data, there is no fixed set of available attributes, but data files can define certain attributes, like 'color' or 'intensity' for each of the points in the point cloud. When these attributes are known up-front, you can use them as part of the style expression, for example to give each point its actual color, or to create a color based on the intensity value.
You can discover which attributes you can use in the documentation of the model decoder of the format that is used. For example:
When you display 3D tiles data
, the layer only loads a subset of the available attributes in memory by default. To make sure that all required attributes are loaded, you must specify
which attributes are used in the style expressions.
attributeName
- the name of the attribute.@NotNull public static StyleExpression<android.graphics.Color> colorAttribute(@NotNull String attributeName)
Expressions are evaluated for certain objects. Those object may have attributes ascribed to them. This expression allows access to those attributes by name. Which attributes are available depends on the evaluator of the expression, and on the data itself.
For example, for OGC 3D tiles
point cloud data, there is no fixed set of available attributes, but data files can define certain attributes, like 'color' or 'intensity' for each of the points in the point cloud. When these attributes are known up-front, you can use them as part of the style expression, for example to give each point its actual color, or to create a color based on the intensity value.
You can discover which attributes you can use in the documentation of the model decoder of the format that is used. For example:
When you display 3D tiles data
, the layer only loads a subset of the available attributes in memory by default. To make sure that all required attributes are loaded, you must specify
which attributes are used in the style expressions.
attributeName
- the name of the attribute.@NotNull public static StyleExpression<Coordinate> positionAttribute()
For example, for point clouds it represents for the position of an individual point in that point cloud. This for example makes it possible to adapt the transparency of points of a point cloud depending on their distance from an other location.
@NotNull public static StyleExpression<Boolean> lt(@NotNull StyleExpression<Double> first, @NotNull StyleExpression<Double> second)
first
- the first double expression to be comparedsecond
- the second double expression to be compared@NotNull public static StyleExpression<Boolean> lte(@NotNull StyleExpression<Double> first, @NotNull StyleExpression<Double> second)
first
- the first double expression to be comparedsecond
- the second double expression to be compared@NotNull public static StyleExpression<Boolean> gt(@NotNull StyleExpression<Double> first, @NotNull StyleExpression<Double> second)
first
- the first double expression to be comparedsecond
- the second double expression to be compared@NotNull public static StyleExpression<Boolean> gte(@NotNull StyleExpression<Double> first, @NotNull StyleExpression<Double> second)
first
- the first double expression to be comparedsecond
- the second double expression to be compared@NotNull public static StyleExpression<Boolean> eq(@NotNull StyleExpression<Double> first, @NotNull StyleExpression<Double> second, @NotNull StyleExpression<Double> threshold)
The size of the threshold depends on the values you want to compare:
first
- The first expression to evaluatesecond
- The second expression to evaluatethreshold
- The Expression
describing the maximum threshold before considering both values too far from each other.@NotNull public static StyleExpression<Boolean> between(@NotNull StyleExpression<Double> lowerBound, @NotNull StyleExpression<Double> upperBound, @NotNull StyleExpression<Double> value)
In other words, this expression checks whether operand is in the range [lowerBound, upperBound]
.
lowerBound
- a double expression representing the lowerBoundupperBound
- a double expression representing the upperBoundvalue
- the double expression to test[lowerBound, upperBound]
.@NotNull public static StyleExpression<Coordinate> crossProduct(@NotNull StyleExpression<Coordinate> first, @NotNull StyleExpression<Coordinate> second)
Coordinate
.first
- The first expression to evaluate.second
- The second expression to evaluate.Coordinate
(vector).@NotNull public static StyleExpression<android.graphics.Color> defaultColor()
The result depends on what is available in the data. It can be the color of a texture, a color attribute, a constant color default, etc.
This type of expression is only supported for mesh styling
expressions used by TileSet3DLayer
.
@NotNull public static StyleExpression<Boolean> frontFacing()
You can for example use it in a color expression to distinguish front-facing from back-facing pixels, and render those differently. This type of expression is only supported for mesh styling expressions
used by TileSet3DLayer
.
The facing is determined based on triangle winding.
If you simply wish to hide back-faced triangles, use MeshStyle.Builder#facetCulling
with FacetCullingType#BackfaceCulling
as parameter.
@NotNull public static StyleExpression<Coordinate> normalize(@NotNull StyleExpression<Coordinate> operand)
Coordinate
.operand
- The expression to evaluate.Coordinate
.@NotNull public static StyleExpression<Double> length(@NotNull StyleExpression<Coordinate> operand)
Coordinate
.operand
- The expression to evaluate.