Class TLspLineStyle.Builder<B extends TLspLineStyle.Builder<B>>
- All Implemented Interfaces:
ILspEffectsHintStyle.Builder
,ILspTexturedStyle.Builder
,ILspWorldElevationStyle.Builder
- Direct Known Subclasses:
TLspPinLineStyle.Builder
- Enclosing class:
TLspLineStyle
ILspWorldElevationStyle.ElevationMode.OBJECT_DEPENDENT
and not blended together when multiple lines overlap.
Example usages:
To create the default line style: TLspLineStyle whiteOnePixelNotDraped = TLspLineStyle.newBuilder().build();
To create a 4-pixel wide red line style for shapes that are draped:TLspLineStyle redFourPixelsDraped = TLspLineStyle.newBuilder().color(Color.red).lineWidth(4f).elevationMode(ON_TERRAIN).build();
To style objects based its properties use TLspParameterizedLineStyle
- Since:
- 2012.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets all parameters on the builder based on the given style.blendOverlap
(boolean aBlendOverlap) Deprecated.blendOverlap
(TLspLineStyle.BlendOverlapMode aBlendOverlap) Sets whether different lines that are painted with the same style and that cover the same pixels are blended together or not.build()
Builds the style with the set parameters.Sets the color.dashPattern
(TLspLineStyle.DashPattern aDashPattern) Sets the dash pattern.effectsHints
(ILspEffectsHintStyle.EffectsHint... aEffectsHints) Specifies the effects hints to be added to the style.Specifies the elevation mode.opacity
(float aOpacity) Sets the opacity (alpha) value for the color.pixelOffset
(double aPixels) Sets the offset in pixels.repeatTexture
(boolean aRepeatTexture) Specifies whether the texture map should be repeated (tiled) or not.rotateTexture
(double aAlpha) Rotates the texture.scaleTexture
(double aSX, double aSY, double aSZ) Scales the texture.texture
(RenderedImage aTexture) Specifies the image to be used as a texture map.Specifies whether the texture coordinates computed to apply the texture map should be relative to the bounds of the object or not.textureInterpolationType
(ELcdInterpolationType aInterpolationType) Specifies whether linear or nearest neighbor interpolation should be used for the texture.textureMatrix
(double[] aTextureMatrix) Specifies the 4x4 matrix that should be applied to the texture coordinates when mapping the texture given by this style.textureObject
(ALsp2DTextureObject aTextureObject) Specifies the texture object to be used.toString()
translateTexture
(double aDX, double aDY, double aDZ) Translates the textures.width
(double aLineWidth) Sets the line width (pixels).zOrder
(int aZOrder) Sets the Z-order of this style.Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle.Builder
equals, hashCode
-
Constructor Details
-
Builder
protected Builder()Default constructor.
-
-
Method Details
-
color
Sets the color. Should not benull
.- Parameters:
aColor
- the color- Returns:
this
- Throws:
IllegalArgumentException
-if aColor==null
-
opacity
Sets the opacity (alpha) value for the color. This is a convenience method: One could equally well use thecolor(...)
method. However, this method leaves the RGB values intact and only modifies the alpha value. Note that, the other way around, thecolor(...)
method does override the set alpha value.- Parameters:
aOpacity
- the alpha value. Must be contained in the [0,1] interval (0 is fully transparent, 1 is fully opaque).- Returns:
this
-
width
Sets the line width (pixels). Should be greater than 0.- Parameters:
aLineWidth
- the line width- Returns:
this
-
zOrder
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
-
pixelOffset
Sets the offset in pixels. The line will be drawn at a distance ofaPixels
from the original geometry. By default, no offset is used. A positive offset will result in a line that is painted to the left of the original line, or on the outside of the original polygon/ring. A negative offset will paint the line to the right or on the inside.- Parameters:
aPixels
- an offset in pixels.- Returns:
this
- Since:
- 2012.1
-
blendOverlap
Deprecated.Sets whether different lines that are painted with the same style and that cover the same pixels are blended together or not.When set to
false
, all pixels covered will receive the same color, even if this color is transparent and if multiple lines cover the same pixel. If set totrue
, overlapping (transparent) lines will be blended together resulting in a less transparent color at their crossings.For example, when painting street data, you do not want the color to change at a crossroad. In that case, you would set this parameter to
false
to ensure that different streets are not blended together.When painting 3D trajectories however, you do want to accumulate the transparent color of overlapping trajectories. In that case, set this parameter to
true
.The default value is
false
.- Parameters:
aBlendOverlap
- whether or not overlapping lines are blended together- Returns:
this
-
blendOverlap
Sets whether different lines that are painted with the same style and that cover the same pixels are blended together or not.When set to
BlendOverlapMode#NEVER
, all pixels covered will receive the same color, even if this color is transparent and if multiple lines cover the same pixel. If set toBlendOverlapMode#ALWAYS
, overlapping (transparent) lines will be blended together resulting in a less transparent color at their crossings.Finally the
BlendOverlapMode#AUTO
chooses the mode that gives the best results depending on the context. For instance, lines that are not draped in a 3D view should be blended. Lines that are draped, or painted in a 2D view will not be blended.For example, when painting street data, you do not want the color to change at a crossroad. In that case, you would set this parameter to
BlendOverlapMode#NEVER
to ensure that different streets are not blended together.When painting 3D trajectories however, you do want to accumulate the transparent color of overlapping trajectories. In that case, set this parameter to
BlendOverlapMode#ALWAYS
.In both cases, you can also use
BlendOverlapMode#AUTO
. You only need to explicitly set the mode in case the automatic mode does not produce the desired result.The default value is
BlendOverlapMode#AUTO
.- Parameters:
aBlendOverlap
- whether or not overlapping lines are blended together- Returns:
this
- Since:
- 2012.1
-
elevationMode
Description copied from interface:ILspWorldElevationStyle.Builder
Specifies the elevation mode. The default mode depends on the specific implementation.- Specified by:
elevationMode
in interfaceILspWorldElevationStyle.Builder
- Parameters:
aMode
-- Returns:
this
-
texture
Description copied from interface:ILspTexturedStyle.Builder
Specifies the image to be used as a texture map. A new texture will be created for the specified image. For reusing an existing textureILspTexturedStyle.Builder.textureObject(ALsp2DTextureObject)
can be used. This image should never be modified. To change the texture you should create a new style with a different image instance. If a texture object was set viaILspTexturedStyle.Builder.textureObject(ALsp2DTextureObject)
before calling this, it will be replaced by a texture created from the image.- Specified by:
texture
in interfaceILspTexturedStyle.Builder
- Parameters:
aTexture
- the image to be used as a texture map- Returns:
this
-
textureObject
Description copied from interface:ILspTexturedStyle.Builder
Specifies the texture object to be used. This can be used to reuse already existing textures. When a new texture needs to be created for an imageILspTexturedStyle.Builder.texture(RenderedImage)
can be used. To change the texture you should create a new style with a different texture object instance. If an image to be used as a texture was set viaILspTexturedStyle.Builder.texture(RenderedImage)
before calling this, it will be replaced by this texture.- Specified by:
textureObject
in interfaceILspTexturedStyle.Builder
- Parameters:
aTextureObject
- the texture object.- Returns:
this
-
repeatTexture
Description copied from interface:ILspTexturedStyle.Builder
Specifies whether the texture map should be repeated (tiled) or not.- Specified by:
repeatTexture
in interfaceILspTexturedStyle.Builder
- Parameters:
aRepeatTexture
- whether the texture map should be repeated (tiled) or not- Returns:
this
-
textureInterpolationType
Description copied from interface:ILspTexturedStyle.Builder
Specifies whether linear or nearest neighbor interpolation should be used for the texture. The default is linear.- Specified by:
textureInterpolationType
in interfaceILspTexturedStyle.Builder
- Parameters:
aInterpolationType
- the interpolation method to use for the texture (note thatCUBIC
is not currently supported)- Returns:
this
-
textureCoordinatesMode
Description copied from interface:ILspTexturedStyle.Builder
Specifies whether the texture coordinates computed to apply the texture map should be relative to the bounds of the object or not. In the former case, the map is scaled and offset such that it fills the bounds (in model coordinates) of the object. In the latter case, the model coordinates of the object are used as texture coordinates unmodified.- Specified by:
textureCoordinatesMode
in interfaceILspTexturedStyle.Builder
- Parameters:
aMode
- specifies whether the texture coordinates computed to apply the texture map should be relative to the bounds of the object or correspond to the object's model coordinates.- Returns:
this
-
scaleTexture
Description copied from interface:ILspTexturedStyle.Builder
Scales the texture.- Specified by:
scaleTexture
in interfaceILspTexturedStyle.Builder
- Parameters:
aSX
- amount by which the x-coordinates of the texture are scaledaSY
- amount by which the x-coordinates of the texture are scaledaSZ
- amount by which the x-coordinates of the texture are scaled- Returns:
this
-
rotateTexture
Description copied from interface:ILspTexturedStyle.Builder
Rotates the texture.- Specified by:
rotateTexture
in interfaceILspTexturedStyle.Builder
- Parameters:
aAlpha
- the amount by which the texture is rotated, in radians.- Returns:
this
-
translateTexture
Description copied from interface:ILspTexturedStyle.Builder
Translates the textures.- Specified by:
translateTexture
in interfaceILspTexturedStyle.Builder
- Parameters:
aDX
- amount by which the x-coordinates of the texture are translatedaDY
- amount by which the y-coordinates of the texture are translatedaDZ
- amount by which the z-coordinates of the texture are translated- Returns:
this
-
textureMatrix
Description copied from interface:ILspTexturedStyle.Builder
Specifies the 4x4 matrix that should be applied to the texture coordinates when mapping the texture given by this style. This can be used to scale, rotate or otherwise transform the texture. This matrix will override any previously set transformation. This interface also provides a number of convenience methods to specify common texture coordinate transformations.- Specified by:
textureMatrix
in interfaceILspTexturedStyle.Builder
- Parameters:
aTextureMatrix
- Specifies the 4x4 matrix that should be applied to the texture coordinates when mapping the texture given by this style- Returns:
this
- See Also:
-
dashPattern
Sets the dash pattern.- Parameters:
aDashPattern
- a dash pattern. Must not benull
- Returns:
this
-
effectsHints
Description copied from interface:ILspEffectsHintStyle.Builder
Specifies the effects hints to be added to the style.- Specified by:
effectsHints
in interfaceILspEffectsHintStyle.Builder
- Parameters:
aEffectsHints
- the effects hints to be added to the style- Returns:
this
-
all
Description copied from class:ALspStyle.Builder
Sets all parameters on the builder based on the given style. This is useful for example to create a new style that has almost all properties equal to another style.- Specified by:
all
in classALspStyle.Builder<B extends TLspLineStyle.Builder<B>>
- Parameters:
aLineStyle
- the style to copy- Returns:
this
-
build
Description copied from class:ALspStyle.Builder
Builds the style with the set parameters.- Specified by:
build
in interfaceILspTexturedStyle.Builder
- Specified by:
build
in classALspStyle.Builder<B extends TLspLineStyle.Builder<B>>
- Returns:
- the resulting style
-
toString
-
blendOverlap(TLspLineStyle.BlendOverlapMode)