LuciadCPillar 2023.1.04
luciad::MilitarySymbolStyle Class Referencefinal

Defines styling settings for visualizing military symbols. More...

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

Classes

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

Public Member Functions

 ~MilitarySymbolStyle ()
 
Builder asBuilder () const
 Creates a new builder with the same properties as this symbol style. More...
 
Color getAffiliationColor (MilitarySymbol::Affiliation affiliation) const
 Returns the color that is configured for the given affiliation. More...
 
Color getAlternateFillColor () const
 Returns the color used to fill the part of the frame that is not covered by the fill percentage. More...
 
Color getColor () const
 Returns the color that is currently configured in the case that either affiliation colors are disabled. More...
 
double getCornerSmoothness () const
 Returns the smoothness (or rounding) factor that is used to render corners of polygons. More...
 
double getFillPercentage () const
 Returns the percentage ([0.0, 1.0]) of an icon symbol's frame that is painted with the regular fill color. More...
 
size_t getIconSize () const
 Returns the size of icon symbols in pixels. More...
 
std::optional< ColorgetOverrideColor () const
 Returns the color that overrides the colors of icon or shape symbol. More...
 
double getStrokeScaleFactor () const
 Returns the factor by which line widths should be scaled. More...
 
Color getSurroundingRectangleColor () const
 Returns the color of the rectangle that is painted around icon symbols. More...
 
size_t getSurroundingRectangleWidth () const
 Returns the width in pixels of the rectangle that is painted around icon symbols. More...
 
TextStyle getTextStyle () const
 Returns the style parameters for texts part of the symbol. More...
 
bool isAffiliationColorEnabled () const
 Returns whether the affiliation color mode is enabled. More...
 
bool isFillEnabled () const
 
bool isFrameEnabled () const
 
bool isIconEnabled () const
 
bool isModifiersEnabled () const
 
bool isSurroundingRectangleEnabled () const
 

Static Public Member Functions

static std::shared_ptr< MilitarySymbolStylegetDefaultStyle ()
 Returns the default style for a MilitarySymbol. More...
 
static TextStyle getDefaultTextStyle (size_t iconSize)
 Returns the default text style. More...
 
static Builder newBuilder ()
 Creates a new builder for creating a MilitarySymbolStyle. More...
 

Detailed Description

Defines styling settings for visualizing military symbols.

Use luciad::MilitarySymbolStyle::newBuilder to create a new instance.

Constructor & Destructor Documentation

◆ ~MilitarySymbolStyle()

luciad::MilitarySymbolStyle::~MilitarySymbolStyle ( )

Member Function Documentation

◆ asBuilder()

Builder luciad::MilitarySymbolStyle::asBuilder ( ) const

Creates a new builder with the same properties as this symbol style.

Returns
a new builder with the same properties as this symbol style.

◆ getAffiliationColor()

Color luciad::MilitarySymbolStyle::getAffiliationColor ( MilitarySymbol::Affiliation  affiliation) const

Returns the color that is configured for the given affiliation.

This color is 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 isAffiliationColorEnabled).

Parameters
affiliationthe affiliation.
Returns
the affiliation color.

◆ getAlternateFillColor()

Color luciad::MilitarySymbolStyle::getAlternateFillColor ( ) const

Returns the color used to fill the part of the frame that is not covered by the fill percentage.

Returns
the color used to fill the part of the frame that is not covered by the fill percentage.

◆ getColor()

Color luciad::MilitarySymbolStyle::getColor ( ) const

Returns the color that is currently configured in the case that either affiliation colors are disabled.

See isAffiliationColorEnabled or that the symbol has no affiliation by default.

Returns
the color to be used if affiliation colors are disabled or if the symbol has no affiliation by default.
Since
2020.1

◆ getCornerSmoothness()

double luciad::MilitarySymbolStyle::getCornerSmoothness ( ) const

Returns the smoothness (or rounding) factor that is used to render corners of polygons.

This factor is a value in the interval [0.0, 1.0]. The default value is 0.5.

Returns
the smoothness (or rounding) factor that is used to render corners of polygons.

◆ getDefaultStyle()

static std::shared_ptr< MilitarySymbolStyle > luciad::MilitarySymbolStyle::getDefaultStyle ( )
static

Returns the default style for a MilitarySymbol.

Returns
the default style for a MilitarySymbol.

◆ getDefaultTextStyle()

static TextStyle luciad::MilitarySymbolStyle::getDefaultTextStyle ( size_t  iconSize)
static

Returns the default text style.

The text style has a correctly scaled font size for a symbol with a specific icon size.

Parameters
iconSizelength of width/height of symbol icon in pixel.
Returns
the default text style.

◆ getFillPercentage()

double luciad::MilitarySymbolStyle::getFillPercentage ( ) const

Returns the percentage ([0.0, 1.0]) of an icon symbol's frame that is painted with the regular fill color.

The regular fill color is determined by its affiliation (see getAffiliationColor). The filled part begins at the bottom of the icon frame, up to the vertical position that corresponds with this 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.

This factor is a value in the interval [0.0, 1.0].

Returns
the fill percentage to fill the frame of icon symbols.

◆ getIconSize()

size_t luciad::MilitarySymbolStyle::getIconSize ( ) const

Returns the size of icon symbols in pixels.

Returns
the size of icon symbols in pixels.

◆ getOverrideColor()

std::optional< Color > luciad::MilitarySymbolStyle::getOverrideColor ( ) const

Returns the color that overrides the colors of icon or shape symbol.

The difference with the getColor method is that it replaces any affiliation and/or special pattern colors in icons and tactical shapes. If there is no color override, this method returns std::nullopt.

Returns
the color that overrides the normal colors of the icon symbol.
Since
2022.0

◆ getStrokeScaleFactor()

double luciad::MilitarySymbolStyle::getStrokeScaleFactor ( ) const

Returns 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.

Returns
the factor by which line widths should be scaled.

◆ getSurroundingRectangleColor()

Color luciad::MilitarySymbolStyle::getSurroundingRectangleColor ( ) const

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

This property is only used if the surrounding rectangle is enabled.

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

◆ getSurroundingRectangleWidth()

size_t luciad::MilitarySymbolStyle::getSurroundingRectangleWidth ( ) const

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

This property is only used if the surrounding rectangle is enabled.

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

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

◆ getTextStyle()

TextStyle luciad::MilitarySymbolStyle::getTextStyle ( ) const

Returns the style parameters for texts part of the symbol.

Note
If the text style has not been overridden in luciad::MilitarySymbolStyle::Builder, symbols are rendered with a text style that has a font size slightly smaller than 1/5th of the icon size.
Returns
the style parameters for texts part of the symbol.

◆ isAffiliationColorEnabled()

bool luciad::MilitarySymbolStyle::isAffiliationColorEnabled ( ) const

Returns whether the affiliation color mode is enabled.

When this mode is enabled, the color for unframed icon symbols, line symbols and off-set lines of icon symbols will automatically be adapted to the affiliation of a symbol, as configured on this symbol style (see getAffiliationColor).

Returns
true if the affiliation color mode is enabled.

◆ isFillEnabled()

bool luciad::MilitarySymbolStyle::isFillEnabled ( ) const
Returns
True if an icon symbol should be painted filled.

◆ isFrameEnabled()

bool luciad::MilitarySymbolStyle::isFrameEnabled ( ) const
Returns
true if the frame of an icon symbol should be painted.

◆ isIconEnabled()

bool luciad::MilitarySymbolStyle::isIconEnabled ( ) const
Returns
true if the internal icon in the frame of an icon symbol should be painted.

◆ isModifiersEnabled()

bool luciad::MilitarySymbolStyle::isModifiersEnabled ( ) const
Returns
whether modifiers are enabled.

◆ isSurroundingRectangleEnabled()

bool luciad::MilitarySymbolStyle::isSurroundingRectangleEnabled ( ) const
Returns
whether icon symbols are painted with a surrounding rectangle.

◆ newBuilder()

static Builder luciad::MilitarySymbolStyle::newBuilder ( )
static

Creates a new builder for creating a MilitarySymbolStyle.

Returns
a new builder for creating a MilitarySymbolStyle.