LuciadCPillar 2023.1.04
luciad::PolylinePatternBuilder Class Reference

Creates a pattern with a polyline shape. More...

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

Public Member Functions

ComplexStrokePattern build ()
 Build the polyline pattern as configured. More...
 
PolylinePatternBuilderlineColor (Color color)
 Sets the line color. More...
 
PolylinePatternBuilderlineWidth (double lineWidth)
 Sets the line width. More...
 
PolylinePatternBuilderpoints (const std::vector< Coordinate > &points)
 Sets the points of the polyline. More...
 
PolylinePatternBuilderrelative (bool relative)
 Whether the x coordinates of the points need to be interpreted as pixel values or relative values. More...
 

Detailed Description

Creates a pattern with a polyline shape.

The polyline's points must be set by calling the points method before calling build. All other methods are optional.

See also
ComplexStrokePatternFactory::polylineBuilder()
Since
2023.1

Member Function Documentation

◆ build()

ComplexStrokePattern luciad::PolylinePatternBuilder::build ( )

Build the polyline pattern as configured.

Returns
the ComplexStrokePattern.
Exceptions
luciad::LogicExceptionwhen the points have not been set.

◆ lineColor()

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

Sets the line color.

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

◆ lineWidth()

PolylinePatternBuilder & luciad::PolylinePatternBuilder::lineWidth ( double  lineWidth)

Sets the line width.

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

◆ points()

PolylinePatternBuilder & luciad::PolylinePatternBuilder::points ( const std::vector< Coordinate > &  points)

Sets the points of the polyline.

Depending on the option relative, the x coordinates are interpreted as pixel value, or as coordinates relative ([0, 1]) to the length of the entire line. the Y coordinates are always pixel values.

The coordinates are defined locally, so for example to define a line of length 10, the following coordinates can be used: (0,0), (10,0).

There must be at least 2 points.

Parameters
pointsthe points that make up the polyline.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionwhen the amount of points is lower than 2.

◆ relative()

PolylinePatternBuilder & luciad::PolylinePatternBuilder::relative ( bool  relative)

Whether the x coordinates of the points need to be interpreted as pixel values or relative values.

Defaults to false.

Parameters
relativewhether the x coordinates need to be interpreted as relative values.
Returns
this builder.