LuciadCPillar 2026.1.02
Loading...
Searching...
No Matches
luciad::ComplexStrokeLineStyle::Builder Class Referencefinal

A builder to create ComplexStrokeLineStyle objects. More...

#include <luciad/layers/styles/complexstrokes/ComplexStrokeLineStyle.h>

Public Member Functions

 Builder (Builder &&other) noexcept
 Move constructor.
 Builder (const Builder &other)
 Copy constructor.
 ~Builder ()
Builder & addDecoration (const ComplexStrokePattern &pattern, double relativePosition)
 Add a decoration to be painted along the line.
Builder & addDecoration (const ComplexStrokePattern &pattern, double relativePosition, HorizontalAlignment alignment)
 Add a decoration to be painted along the line.
Builder & bloom (BloomStyle bloom)
 Sets a bloom style to use.
ComplexStrokeLineStyle build ()
 Build the ComplexStrokeLineStyle as configured.
Builder & fallback (const ComplexStrokePattern &pattern)
 The pattern that is painted if no decoration or regular pattern can be painted.
Builder & inMeters ()
 Interpret the sizes and offsets of the stroke patterns as meters instead of pixels.
Builder & operator= (Builder other) noexcept
Builder & orientation (ComplexStrokeOrientation orientation)
 The orientation of the area that is used to render the complex stroke on for 3D lines.
Builder & regular (const ComplexStrokePattern &pattern)
 The pattern that is repeated along the line.
Builder & scale (double scaleFactor)
 Applies a scale factor to the sizes and offsets of the stroke patterns.
Builder & sharpAngleThreshold (double sharpAngleThreshold)
 The threshold that is used to determine if angles are sharp or not.

Detailed Description

A builder to create ComplexStrokeLineStyle objects.

Since
2023.1

Constructor & Destructor Documentation

◆ Builder() [1/2]

luciad::ComplexStrokeLineStyle::Builder::Builder ( const Builder & other)

Copy constructor.

Parameters
otherthe builder to copy.

◆ Builder() [2/2]

luciad::ComplexStrokeLineStyle::Builder::Builder ( Builder && other)
noexcept

Move constructor.

Parameters
otherthe builder to move from.

◆ ~Builder()

luciad::ComplexStrokeLineStyle::Builder::~Builder ( )

Member Function Documentation

◆ addDecoration() [1/2]

Builder & luciad::ComplexStrokeLineStyle::Builder::addDecoration ( const ComplexStrokePattern & pattern,
double relativePosition )

Add a decoration to be painted along the line.

A decoration is a pattern.

This method can be called multiple times to add multiple decorations. If this method isn't called, no decorations are added.

The alignment is automatically determined based on relativePosition. Left if the position is 0.0, Right if the location is 1.0, and Center if otherwise.

Parameters
patternthe decoration to be added.
relativePositionthe relative position of the decoration on the line, where 0.0 is the start and 1.0 is the end of the entire line.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionrelativePosition must be in range [0,1].

◆ addDecoration() [2/2]

Builder & luciad::ComplexStrokeLineStyle::Builder::addDecoration ( const ComplexStrokePattern & pattern,
double relativePosition,
HorizontalAlignment alignment )

Add a decoration to be painted along the line.

A decoration is a pattern.

This method can be called multiple times to add multiple decorations. If this method isn't called, no decorations are added.

Parameters
patternthe decoration to be added.
relativePositionthe relative position of the decoration on the line, where 0.0 is the start and 1.0 is the end of the entire line.
alignmentdetermines how the pattern is aligned to its location. If you use HorizontalAlignment::Center, the middle of the pattern will coincide with the specified location. If you use HorizontalAlignment::Right, the right of the pattern will coincide with the specified location. This means that it will appear at the left of the location.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionrelativePosition must be in range [0,1].

◆ bloom()

Builder & luciad::ComplexStrokeLineStyle::Builder::bloom ( BloomStyle bloom)

Sets a bloom style to use.

This method is optional. If it is not called, no bloom is used.

Parameters
bloomthe bloom style.
Returns
this builder.
Since
2026.1

◆ build()

ComplexStrokeLineStyle luciad::ComplexStrokeLineStyle::Builder::build ( )

Build the ComplexStrokeLineStyle as configured.

At least one of fallback, regular or addDecoration must be called. If none of these are called, a logic exception is thrown.

Returns
the ComplexStrokeLineStyle.
Exceptions
luciad::LogicExceptionwhen neither a regular or a fallback pattern has been set and no decorations have been added.

◆ fallback()

Builder & luciad::ComplexStrokeLineStyle::Builder::fallback ( const ComplexStrokePattern & pattern)

The pattern that is painted if no decoration or regular pattern can be painted.

This can happen if a line is too curved, or if there is not enough space to paint the regular pattern.

Some patterns influence whether the fallback pattern is painted or not, and where it is painted. For more information, see the combineWithFallback and combineWithRegular patterns.

Note that the fallback pattern can be cut off, e.g. when reaching the end of the line, instead of being omitted. This means that a base pattern can be partially drawn.

Parameters
patternthe fallback pattern.
Returns
this builder.

◆ inMeters()

Builder & luciad::ComplexStrokeLineStyle::Builder::inMeters ( )

Interpret the sizes and offsets of the stroke patterns as meters instead of pixels.

This method is optional. By default, the pattern sizes and offsets are interpreted as device independent pixels.

Returns
this builder.
Since
2026.1

◆ operator=()

Builder & luciad::ComplexStrokeLineStyle::Builder::operator= ( Builder other)
noexcept

◆ orientation()

Builder & luciad::ComplexStrokeLineStyle::Builder::orientation ( ComplexStrokeOrientation orientation)

The orientation of the area that is used to render the complex stroke on for 3D lines.

See ComplexStrokeLineStyle for more information.

The default, the complex stroke faces the camera for 3D lines.

Parameters
orientationthe orientation
Returns
this builder

◆ regular()

Builder & luciad::ComplexStrokeLineStyle::Builder::regular ( const ComplexStrokePattern & pattern)

The pattern that is repeated along the line.

A regular pattern is painted where no decoration is painted, because decorations have priority over the regular pattern.

If there is not enough space to place the regular pattern, the fallback pattern is painted.

Some patterns influence whether the regular pattern is painted or not, and where it is painted. For more information, see the combineWithRegular pattern wrapper.

Note that, unlike the fallback stroke, (patterns part of) the regular pattern will not be cut off. That is, each base pattern will always be fully painted or not at all. This is different from the atomic pattern which is about a composite pattern being painted together or not at all.

Parameters
patternthe regular pattern.
Returns
this builder.

◆ scale()

Builder & luciad::ComplexStrokeLineStyle::Builder::scale ( double scaleFactor)

Applies a scale factor to the sizes and offsets of the stroke patterns.

This method is optional. If it is not called, no scaling is performed (that is, a scale of 1.0 is used).

The scale is applied to the pattern sizes and offsets, before they are interpreted as pixels or meters.

Parameters
scaleFactorthe scale factor to apply to the pattern sizes and offsets. This value must be > 0.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionwhen scaleFactor is <= 0.
Since
2026.1

◆ sharpAngleThreshold()

Builder & luciad::ComplexStrokeLineStyle::Builder::sharpAngleThreshold ( double sharpAngleThreshold)

The threshold that is used to determine if angles are sharp or not.

It is interpreted as an angle in degrees between two line segments. In the context of complex stroking, sharp corners are handled differently than non-sharp corners.

In general, a non-sharp corner is handled as if there were no corner at all. This means that any stroke can just be painted along the corner. As a side-effect, strokes may be deformed. This deformation is small for corners that are close to 180 degrees wide, meaning for line segments that are almost parallel. The deformation can become quite large for sharper corners though, so take care when you adjust this value.

On the other hand, when a corner is considered sharp, strokes will not be deformed, but they may be dropped instead.

This setting is useful when complex strokes use a uniform shape and color, for example. When you are painting an airspace border using a rectangular stroke along the length of the line, you can set the threshold to 0, for instance.

The value should always be in the [0, 180] degrees range. The default value is 155 degrees.

Parameters
sharpAngleThresholdthe sharpAngleThreshold.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionsharpAngleThreshold must be in range [0,180].