LuciadCPillar 2023.1.04
|
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< Color > | getOverrideColor () 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< MilitarySymbolStyle > | getDefaultStyle () |
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... | |
Defines styling settings for visualizing military symbols.
Use luciad::MilitarySymbolStyle::newBuilder to create a new instance.
luciad::MilitarySymbolStyle::~MilitarySymbolStyle | ( | ) |
Builder luciad::MilitarySymbolStyle::asBuilder | ( | ) | const |
Creates a new builder with the same properties as this symbol style.
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
).
affiliation | the affiliation. |
Color luciad::MilitarySymbolStyle::getAlternateFillColor | ( | ) | const |
Returns the color used to fill the part of the frame that is not covered by the fill percentage
.
fill percentage
. 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.
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
.
|
static |
Returns the default style for a MilitarySymbol.
|
static |
Returns the default text style.
The text style has a correctly scaled font size for a symbol with a specific icon size.
iconSize | length of width/height of symbol icon in pixel. |
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]
.
size_t luciad::MilitarySymbolStyle::getIconSize | ( | ) | const |
Returns the size of icon symbols in pixels.
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
.
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
.
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
.
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).
TextStyle luciad::MilitarySymbolStyle::getTextStyle | ( | ) | const |
Returns the style parameters for texts part of the symbol.
luciad::MilitarySymbolStyle::Builder
, symbols are rendered with a text style that has a font size slightly smaller than 1/5th of the icon size.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
).
bool luciad::MilitarySymbolStyle::isFillEnabled | ( | ) | const |
bool luciad::MilitarySymbolStyle::isFrameEnabled | ( | ) | const |
bool luciad::MilitarySymbolStyle::isIconEnabled | ( | ) | const |
bool luciad::MilitarySymbolStyle::isModifiersEnabled | ( | ) | const |
bool luciad::MilitarySymbolStyle::isSurroundingRectangleEnabled | ( | ) | const |
|
static |
Creates a new builder for creating a MilitarySymbolStyle
.
MilitarySymbolStyle
.