LuciadCPillar 2023.1.04
luciad::TrianglePatternBuilder Class Reference

Creates a pattern with a triangle shape. More...

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

Public Member Functions

ComplexStrokePattern build ()
 Build the triangle pattern as configured. More...
 
TrianglePatternBuilderfillColor (Color color)
 Sets the fill color. More...
 
TrianglePatternBuilderlineColor (Color color)
 Sets the line color. More...
 
TrianglePatternBuilderlineWidth (double lineWidth)
 Sets the line width. More...
 
TrianglePatternBuilderp0 (Coordinate coordinate)
 The 2D coordinate of the first point of the triangle. More...
 
TrianglePatternBuilderp1 (Coordinate coordinate)
 The 2D coordinate of the second point of the triangle. More...
 
TrianglePatternBuilderp2 (Coordinate coordinate)
 The 2D coordinate of the third point of the triangle. More...
 
TrianglePatternBuilderrelative (bool relative)
 Sets whether the x coordinates of the points need to be interpreted as pixel values or as values in range [0,1] relative to the line. More...
 

Detailed Description

Creates a pattern with a triangle shape.

See also
ComplexStrokePatternFactory::triangleBuilder()
Since
2023.1

Member Function Documentation

◆ build()

ComplexStrokePattern luciad::TrianglePatternBuilder::build ( )

Build the triangle pattern as configured.

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

◆ fillColor()

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

Sets the fill color.

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

◆ lineColor()

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

Sets the line color.

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

◆ lineWidth()

TrianglePatternBuilder & luciad::TrianglePatternBuilder::lineWidth ( double  lineWidth)

Sets the line width.

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

◆ p0()

TrianglePatternBuilder & luciad::TrianglePatternBuilder::p0 ( Coordinate  coordinate)

The 2D coordinate of the first point of the triangle.

These coordinates are pixel values. If relative is set to true the x-coordinate is a length relative to the line (a value in [0,1]) but the y-coordinate remains a pixel value.

This parameter is mandatory. If it is not set, build throws an exception.

Parameters
coordinatea 2D coordinate.
Returns
this builder.

◆ p1()

TrianglePatternBuilder & luciad::TrianglePatternBuilder::p1 ( Coordinate  coordinate)

The 2D coordinate of the second point of the triangle.

These coordinates are pixel values. If relative is set to true the x-coordinate is a length relative to the line (a value in [0,1]) but the y-coordinate remains a pixel value.

This parameter is mandatory. If it is not set, build throws an exception.

Parameters
coordinatea 2D coordinate.
Returns
this builder.

◆ p2()

TrianglePatternBuilder & luciad::TrianglePatternBuilder::p2 ( Coordinate  coordinate)

The 2D coordinate of the third point of the triangle.

These coordinates are pixel values. If relative is set to true the x-coordinate is a length relative to the line (a value in [0,1]) but the y-coordinate remains a pixel value.

This parameter is mandatory. If it is not set, build throws an exception.

Parameters
coordinatea 2D coordinate.
Returns
this builder.

◆ relative()

TrianglePatternBuilder & luciad::TrianglePatternBuilder::relative ( bool  relative)

Sets whether the x coordinates of the points need to be interpreted as pixel values or as values in range [0,1] relative to the line.

Defaults to false.

Parameters
relativewhether the coordinates are relative or not.
Returns
this builder.