LuciadCPillar 2023.1.04
luciad::IconPatternBuilder Class Reference

Creates a pattern containing an icon. More...

#include <luciad/layers/styles/complexstrokes/builders/IconPatternBuilder.h>

Public Member Functions

ComplexStrokePattern build ()
 Build the icon pattern as configured. More...
 
IconPatternBuildericon (std::shared_ptr< IIcon > icon)
 Sets the icon to be displayed. More...
 
IconPatternBuilderoffset (double offset)
 Sets the offset of the icon, relative to the base line, in pixels. More...
 
IconPatternBuilderopacity (double opacity)
 The opacity of the icon, determines how transparent an icon will be painted. More...
 
IconPatternBuilderrotateUp (bool rotateUp)
 Indicates if the icon should be flipped when it is turned upside down. More...
 
IconPatternBuilderrotation (Angle rotation)
 The rotation angle around the center of the icon's image, specified in degrees. More...
 
IconPatternBuilderscale (double scale)
 Sets the factor by which the icon will be scaled. More...
 

Detailed Description

Creates a pattern containing an icon.

The icon must be set by calling the icon method before calling build. All other methods are optional.

See also
ComplexStrokePatternFactory::iconBuilder()
Since
2023.1

Member Function Documentation

◆ build()

ComplexStrokePattern luciad::IconPatternBuilder::build ( )

Build the icon pattern as configured.

Returns
the ComplexStrokePattern.
Exceptions
luciad::LogicExceptionwhen the icon has not been set.

◆ icon()

IconPatternBuilder & luciad::IconPatternBuilder::icon ( std::shared_ptr< IIcon icon)

Sets the icon to be displayed.

May not be nullptr.

Parameters
iconthe icon to be displayed.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionicon may not be nullptr.

◆ offset()

IconPatternBuilder & luciad::IconPatternBuilder::offset ( double  offset)

Sets the offset of the icon, relative to the base line, in pixels.

Defaults to 0.

Parameters
offsetthe offset of the icon.
Returns
this builder.

◆ opacity()

IconPatternBuilder & luciad::IconPatternBuilder::opacity ( double  opacity)

The opacity of the icon, determines how transparent an icon will be painted.

It needs to be specified between 0 and 1. 0 indicates that the icon is painted completely transparent and 1 indicates that the original opacity of the icon is used.

Parameters
opacitythe icon's opacity in the [0,1] interval, defaults to 1.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionopacity must be in range [0,1].

◆ rotateUp()

IconPatternBuilder & luciad::IconPatternBuilder::rotateUp ( bool  rotateUp)

Indicates if the icon should be flipped when it is turned upside down.

Defaults to false.

Parameters
rotateUpIndicates if the icon should be flipped when it is turned upside down.
Returns
this builder.

◆ rotation()

IconPatternBuilder & luciad::IconPatternBuilder::rotation ( Angle  rotation)

The rotation angle around the center of the icon's image, specified in degrees.

Rotations are applied in a clock-wise fashion relatively to the direction of the underlying line. When rotateUp is set to true, the flipping occurs on the already rotated icon. The default is 0, which implies the icon is not rotated.

Parameters
rotationthe rotation, defaults to 0 degrees.
Returns
this builder.

◆ scale()

IconPatternBuilder & luciad::IconPatternBuilder::scale ( double  scale)

Sets the factor by which the icon will be scaled.

Defaults to 1 (no scaling).

Parameters
scalethe scale factor.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionscale must be >0.