LuciadCPillar 2023.1.04
luciad::OnPathLabelStyle::Builder Class Referencefinal

A builder class for creating an OnPathLabelStyle. More...

#include <luciad/layers/styles/OnPathLabelStyle.h>

Public Member Functions

 Builder (const Builder &other)
 
 ~Builder ()
 
OnPathLabelStyle build () const
 Returns A newly created style, based on the properties set on this builder. More...
 
BuilderhorizontalAlignment (HorizontalAlignment horizontalAlignment)
 Sets The horizontal anchor of the label with respect to the location on the line. More...
 
BuilderhorizontalOffset (double horizontalOffset)
 Sets the horizontal space between the relative location and the label in device independent pixels. More...
 
BuilderrelativeLocation (double relativeLocation)
 Sets the relative location of the label along the path. More...
 
BuilderverticalOffset (double verticalOffset)
 Sets an additional vertical offset between the location on the line and the label, expressed in device independent pixels. More...
 
BuilderverticalPosition (PathLabelPosition verticalPosition)
 Sets the alignment of the label perpendicular to the line. More...
 

Detailed Description

A builder class for creating an OnPathLabelStyle.

Since
2021.0

Constructor & Destructor Documentation

◆ Builder()

luciad::OnPathLabelStyle::Builder::Builder ( const Builder other)

◆ ~Builder()

luciad::OnPathLabelStyle::Builder::~Builder ( )

Member Function Documentation

◆ build()

OnPathLabelStyle luciad::OnPathLabelStyle::Builder::build ( ) const

Returns A newly created style, based on the properties set on this builder.

Returns
A newly created style, based on the properties set on this builder.

◆ horizontalAlignment()

Builder & luciad::OnPathLabelStyle::Builder::horizontalAlignment ( HorizontalAlignment  horizontalAlignment)

Sets The horizontal anchor of the label with respect to the location on the line.

By default the horizontal alignment is HorizontalAlignment::Center.

This method only has an effect when Builder::relativeLocation is also called.

Parameters
horizontalAlignmentThe horizontal anchor of the label with respect to the location on the line.
Returns
this builder.

◆ horizontalOffset()

Builder & luciad::OnPathLabelStyle::Builder::horizontalOffset ( double  horizontalOffset)

Sets the horizontal space between the relative location and the label in device independent pixels.

This offset follows the tangent of the curve at the specified location.

By default the horizontal offset is 0.

This method only has an effect when Builder::relativeLocation is also called.

Parameters
horizontalOffsetthe horizontal space between the relative location and the label in device independent pixels.
Returns
this builder.

◆ relativeLocation()

Builder & luciad::OnPathLabelStyle::Builder::relativeLocation ( double  relativeLocation)

Sets the relative location of the label along the path.

This value should in the interval [0,1]. A value of 0 represents the start of the curve and a value of 1 represents the end of the curve. By default the relative location is 0.5 and the label is placed at the middle of the curve.

This method is optional. If this method is not called, the label can be placed anywhere along the path.

Parameters
relativeLocationthe relative location of the label along the path. This value should in the interval [0,1].
Returns
this builder.

◆ verticalOffset()

Builder & luciad::OnPathLabelStyle::Builder::verticalOffset ( double  verticalOffset)

Sets an additional vertical offset between the location on the line and the label, expressed in device independent pixels.

This offset is applied in the direction determined by Builder::verticalPosition.

By default the vertical offset is 0.

Parameters
verticalOffsetan additional vertical offset between the location on the line and the label, expressed in device independent pixels.
Returns
this builder.

◆ verticalPosition()

Builder & luciad::OnPathLabelStyle::Builder::verticalPosition ( PathLabelPosition  verticalPosition)

Sets the alignment of the label perpendicular to the line.

For example, if this value is PathLabelPosition::Above, the label is displayed above the curve.

By default the vertical position is PathLabelPosition::Center.

Parameters
verticalPositionthe alignment of the label perpendicular to the line.
Returns
this builder.