LuciadCPillar 2023.1.04
luciad::MilitarySymbolStyle::Builder Class Referencefinal

Builder for the luciad::MilitarySymbolStyle class. More...

#include <luciad/symbology/military/MilitarySymbolStyle.h>

Public Member Functions

 Builder (const Builder &other)
 
 ~Builder ()
 
BuilderaffiliationColor (MilitarySymbol::Affiliation affiliation, Color affiliationColor)
 Sets the color for the given affiliation. More...
 
BuilderaffiliationColorEnabled (bool affiliationColorEnabled)
 Sets the affiliation color mode. More...
 
BuilderalternateFillColor (Color alternateFillColor)
 Sets the alternate color to fill the part of the frame that is not covered by the fill percentage. More...
 
std::shared_ptr< MilitarySymbolStylebuild ()
 Creates a new MilitarySymbolStyle with the properties set on this builder. More...
 
Buildercolor (Color unaffiliatedColor)
 Sets the color to be used if affiliation colors have been disabled (see affiliationColorEnabled) or if the symbol has no affiliation by default. More...
 
BuildercornerSmoothness (double smoothness)
 Sets the smoothness (or rounding) factor for polygon corners. More...
 
BuilderfillEnabled (bool fillEnabled)
 Sets whether an icon symbol should be painted filled. More...
 
BuilderfillPercentage (double fillPercentage)
 Sets the percentage ([0.0, 1.0]) of an icon symbol's frame that is painted with the regular fill color, as determined by its affiliation (see affiliationColor). More...
 
BuilderframeEnabled (bool frameEnabled)
 Sets whether the frame of an icon symbol should be painted. More...
 
BuildericonEnabled (bool iconEnabled)
 Sets whether the internal icon in the frame of an icon symbol should be painted. More...
 
BuildericonSize (size_t size)
 Sets the size of icon symbols in pixels. More...
 
BuildermodifiersEnabled (bool modifiersEnabled)
 Sets whether modifiers should be enabled. More...
 
BuilderoverrideColor (Color color)
 Sets the color to be used for the icon symbol. More...
 
BuilderstrokeScaleFactor (double strokeScaleFactor)
 Sets the factor by which line widths should be scaled. More...
 
BuildersurroundingRectangleColor (Color color)
 Sets the color of the rectangle that is painted around icon symbols. More...
 
BuildersurroundingRectangleEnabled (bool enabled)
 Sets whether icon symbols should be painted with a surrounding rectangle. More...
 
BuildersurroundingRectangleWidth (size_t width)
 Sets the line width in pixels of the rectangle that is painted around icon symbols. More...
 
BuildertextStyle (TextStyle textStyle)
 Sets the new text style to be used for all texts part of the symbol. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ Builder()

luciad::MilitarySymbolStyle::Builder::Builder ( const Builder other)

◆ ~Builder()

luciad::MilitarySymbolStyle::Builder::~Builder ( )

Member Function Documentation

◆ affiliationColor()

Builder & luciad::MilitarySymbolStyle::Builder::affiliationColor ( MilitarySymbol::Affiliation  affiliation,
Color  affiliationColor 
)

Sets the color for the given affiliation.

These colors are used as fill color for framed icon symbols. For unframed icon symbols and line symbols, affiliation colors are only used when the affiliation color mode has been enabled (see affiliationColorEnabled).

Parameters
affiliationThe affiliation for which a color is set.
affiliationColorThe color to be used for the given affiliation.
Returns
this builder.

◆ affiliationColorEnabled()

Builder & luciad::MilitarySymbolStyle::Builder::affiliationColorEnabled ( bool  affiliationColorEnabled)

Sets the affiliation color mode.

When this mode is enabled, the color for unframed icon symbols, line symbols and off-set lines of icon symbols are automatically be adapted to the affiliation of a symbol.

The default value is false.

Parameters
affiliationColorEnabledThe affiliation color mode.
Returns
this builder.

◆ alternateFillColor()

Builder & luciad::MilitarySymbolStyle::Builder::alternateFillColor ( Color  alternateFillColor)

Sets the alternate color to fill the part of the frame that is not covered by the fill percentage.

The default value is transparent (i.e. no fill).

Parameters
alternateFillColorthe color to fill the part of the frame that is not covered by the fill percentage.
Returns
this builder.

◆ build()

std::shared_ptr< MilitarySymbolStyle > luciad::MilitarySymbolStyle::Builder::build ( )

Creates a new MilitarySymbolStyle with the properties set on this builder.

Returns
a new MilitarySymbolStyle with the properties set on this builder.

◆ color()

Builder & luciad::MilitarySymbolStyle::Builder::color ( Color  unaffiliatedColor)

Sets the color to be used if affiliation colors have been disabled (see affiliationColorEnabled) or if the symbol has no affiliation by default.

The default value is black.

Parameters
unaffiliatedColorThe color.
Returns
this builder.
Since
2020.1

◆ cornerSmoothness()

Builder & luciad::MilitarySymbolStyle::Builder::cornerSmoothness ( double  smoothness)

Sets the smoothness (or rounding) factor for polygon corners.

This factor must be a value inside the interval [0.0, 1.0].

By default, the smoothness is set to 0.5.

Parameters
smoothnessthe smoothness (or rounding) factor for polygon corners.
Returns
this builder.

◆ fillEnabled()

Builder & luciad::MilitarySymbolStyle::Builder::fillEnabled ( bool  fillEnabled)

Sets whether an icon symbol should be painted filled.

The default value is true.

Parameters
fillEnabledwhether an icon symbol should be painted filled.
Returns
this builder.

◆ fillPercentage()

Builder & luciad::MilitarySymbolStyle::Builder::fillPercentage ( double  fillPercentage)

Sets the percentage ([0.0, 1.0]) of an icon symbol's frame that is painted with the regular fill color, as determined by its affiliation (see affiliationColor).

The filled part begins at the bottom of the icon frame, up to the vertical position that corresponds with the given fill percentage. In other words, a fill percentage of 0.5 results in an icon symbol of which only the bottom half is filled with the regular fill color. The remaining (top) part of the icon is filled with the alternate fill color.

The default value is 1.0f.

Parameters
fillPercentagethe fill percentage to fill the frame of icon symbols.
Returns
this builder.

◆ frameEnabled()

Builder & luciad::MilitarySymbolStyle::Builder::frameEnabled ( bool  frameEnabled)

Sets whether the frame of an icon symbol should be painted.

The default value is true.

Parameters
frameEnabledwhether the frame of an icon symbol should be painted.
Returns
this builder.

◆ iconEnabled()

Builder & luciad::MilitarySymbolStyle::Builder::iconEnabled ( bool  iconEnabled)

Sets whether the internal icon in the frame of an icon symbol should be painted.

The default value is true.

Parameters
iconEnabledwhether the internal icon in the frame of an icon symbol should be painted.
Returns
this builder.

◆ iconSize()

Builder & luciad::MilitarySymbolStyle::Builder::iconSize ( size_t  size)

Sets the size of icon symbols in pixels.

This value must be > 0. The default value is 64.

Parameters
sizethe size of icon symbols in pixels.
Returns
this builder.

◆ modifiersEnabled()

Builder & luciad::MilitarySymbolStyle::Builder::modifiersEnabled ( bool  modifiersEnabled)

Sets whether modifiers should be enabled.

The default value is true.

Parameters
modifiersEnabledwhether modifiers should be enabled.
Returns
this builder.

◆ overrideColor()

Builder & luciad::MilitarySymbolStyle::Builder::overrideColor ( Color  color)

Sets the color to be used for the icon symbol.

This overrides the affiliation and/or pattern colors in icons and tactical shapes. If this method is not invoked, there's no override color.

Parameters
colorThe color to be used for the icon symbol.
Returns
this builder.
Since
2022.0

◆ strokeScaleFactor()

Builder & luciad::MilitarySymbolStyle::Builder::strokeScaleFactor ( double  strokeScaleFactor)

Sets the factor by which line widths should be scaled.

This setting can be used to increase or decrease the width of stroked lines in icons and tactical graphics. It also affects decoration sizes in tactical graphics.

The default value is 1.

Parameters
strokeScaleFactorthe factor by which line widths should be scaled.
Returns
this builder.

◆ surroundingRectangleColor()

Builder & luciad::MilitarySymbolStyle::Builder::surroundingRectangleColor ( Color  color)

Sets the color of the rectangle that is painted around icon symbols.

Parameters
colorthe color of the rectangle that is painted around icon symbols.
Returns
this builder.
See also
surroundingRectangleEnabled

◆ surroundingRectangleEnabled()

Builder & luciad::MilitarySymbolStyle::Builder::surroundingRectangleEnabled ( bool  enabled)

Sets whether icon symbols should be painted with a surrounding rectangle.

The default value is false.

Parameters
enabledwhether icon symbols should be painted with a surrounding rectangle.
Returns
this builder.

◆ surroundingRectangleWidth()

Builder & luciad::MilitarySymbolStyle::Builder::surroundingRectangleWidth ( size_t  width)

Sets the line width in pixels of the rectangle that is painted around icon symbols.

This value must be larger than 0.

The default value is 1.

A pixel is defined as 1/96th of 1 inch (https://www.w3.org/TR/css-values-4/#absolute-lengths).

Parameters
widththe line width in pixels of the rectangle that is painted around icon symbols.
Returns
this builder.
See also
surroundingRectangleEnabled

◆ textStyle()

Builder & luciad::MilitarySymbolStyle::Builder::textStyle ( TextStyle  textStyle)

Sets the new text style to be used for all texts part of the symbol.

Note
Ideally, the font size for the text style should be less than 1/5th of the icon size. By default, the icon size is 64 and the font size is 12. You can use luciad::MilitarySymbolStyle::getDefaultTextStyle to get a correctly sized TextStyle.
Parameters
textStylenew text style to be used for all texts part of the symbol.
Returns
this builder.