LuciadCPillar 2023.1.04
luciad::WavePatternBuilder Class Reference

Creates a pattern with a wave shape. More...

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

Public Member Functions

WavePatternBuilderamplitude (double amplitude)
 The amplitude or height of the wave. More...
 
WavePatternBuilderangle (double angle)
 The angle of the wave pattern in degrees. More...
 
ComplexStrokePattern build ()
 Build the wave pattern as configured. More...
 
WavePatternBuilderfillColor (Color color)
 Sets the fill color. More...
 
WavePatternBuilderfixedLength (double fixedLength)
 Set the length of the pattern in pixels. More...
 
WavePatternBuilderlineColor (Color color)
 Sets the line color. More...
 
WavePatternBuilderlineWidth (double lineWidth)
 Sets the line width. More...
 
WavePatternBuilderrelativeLength (double relativeLength)
 Set the length of the pattern relative to the length of the entire line, as a value between 0 and 1. More...
 
WavePatternBuilderstartAngle (Angle startAngle)
 This determines at which point on the sine function the wave begins. More...
 

Detailed Description

Creates a pattern with a wave shape.

See also
ComplexStrokePatternFactory::waveBuilder()
Since
2023.1

Member Function Documentation

◆ amplitude()

WavePatternBuilder & luciad::WavePatternBuilder::amplitude ( double  amplitude)

The amplitude or height of the wave.

Parameters
amplitudeThe amplitude of the wave. This is a value in pixels, relative to the base line. Defaults to 10.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionamplitude must be >0.

◆ angle()

WavePatternBuilder & luciad::WavePatternBuilder::angle ( double  angle)

The angle of the wave pattern in degrees.

When values greater than 360 degrees are used the pattern keeps going, e.g. an angle of 720 will result in two complete waves.

Parameters
angleThe angle of the wave, defaults to 360 degrees.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionangle must be >=0.

◆ build()

ComplexStrokePattern luciad::WavePatternBuilder::build ( )

Build the wave pattern as configured.

Returns
the ComplexStrokePattern.

◆ fillColor()

WavePatternBuilder & luciad::WavePatternBuilder::fillColor ( Color  color)

Sets the fill color.

Parameters
colorthe fill color, by default there is no fill.
Returns
this builder.

◆ fixedLength()

WavePatternBuilder & luciad::WavePatternBuilder::fixedLength ( double  fixedLength)

Set the length of the pattern in pixels.

The length cannot be both fixed and relative, if both methods are used, only the last one affects the result.

If no length is set, a 10 pixel fixed length will be used as default.

Parameters
fixedLengththe length in pixels.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionfixedLength must be >=0.

◆ lineColor()

WavePatternBuilder & luciad::WavePatternBuilder::lineColor ( Color  color)

Sets the line color.

Parameters
colorthe line's color, defaults to black.
Returns
this builder.

◆ lineWidth()

WavePatternBuilder & luciad::WavePatternBuilder::lineWidth ( double  lineWidth)

Sets the line width.

Parameters
lineWidththe line's width, defaults to 1.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionlineWidth must be >0.

◆ relativeLength()

WavePatternBuilder & luciad::WavePatternBuilder::relativeLength ( double  relativeLength)

Set the length of the pattern relative to the length of the entire line, as a value between 0 and 1.

The length cannot be both fixed and relative, if both methods are used, only the last one affects the result.

If no length is set, a 10 pixel fixed length will be used as default.

Parameters
relativeLengtha value in [0,1].
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionrelativeLength must be in range [0,1].

◆ startAngle()

WavePatternBuilder & luciad::WavePatternBuilder::startAngle ( Angle  startAngle)

This determines at which point on the sine function the wave begins.

0 is on the baseline, 90 is above the baseline at the max amplitude. A startAngle of 180 will result in a wave that starts on the baseline, but first goes to the right of the baseline instead of to the left.

Parameters
startAngleThe start angle of the wave, defaults to 0 degrees.
Returns
this builder.