![]() |
Mapper
0.9.0
API documentation
|
Describes a fill pattern. More...
#include <area_symbol.h>
Public Types | |
enum | Type { LinePattern = 1, PointPattern = 2 } |
Types of fill patterns. More... | |
enum | Option { Default = 0x00, NoClippingIfCompletelyInside = 0x01, NoClippingIfCenterInside = 0x02, NoClippingIfPartiallyInside = 0x03, AlternativeToClipping = 0x03, Rotatable = 0x10 } |
Flags for pattern properties. More... | |
Public Member Functions | |
FillPattern () noexcept | |
Creates a default fill pattern. More... | |
void | save (QXmlStreamWriter &file, const Map &map) const |
Saves the pattern in xml format. More... | |
void | load (QXmlStreamReader &xml, const Map &map, SymbolDictionary &symbol_dict, int version) |
Loads the pattern in xml format. More... | |
bool | equals (const FillPattern &other, Qt::CaseSensitivity case_sensitivity) const |
Checks if the pattern settings are equal to the other. More... | |
bool | rotatable () const |
Returns true if the pattern is rotatable per object. More... | |
void | setRotatable (bool value) |
Controls whether the pattern is rotatable per object. More... | |
Options | clipping () const |
Returns the flags which control drawing at boundary. More... | |
void | setClipping (Options clipping) |
Sets the flags which control drawing at boundary. More... | |
void | colorDeleted (const MapColor *color) |
Removes the pattern's references to the deleted color. More... | |
bool | containsColor (const MapColor *color) const |
Tests if the pattern contains the given color. More... | |
const MapColor * | guessDominantColor () const |
Returns the patterns primary color. More... | |
void | createRenderables (const AreaRenderable &outline, qreal delta_rotation, const MapCoord &pattern_origin, ObjectRenderables &output) const |
Creates renderables for this pattern to fill the area surrounded by the outline. More... | |
template<int type> | |
void | createRenderables (const AreaRenderable &outline, qreal delta_rotation, const MapCoord &pattern_origin, const QRectF &point_extent, LineSymbol *line, qreal rotation, ObjectRenderables &output) const |
Does the heavy-lifting in loops over lines. More... | |
template<int type> | |
void | createLine (MapCoordF first, MapCoordF second, qreal delta_offset, LineSymbol *line, qreal rotation, const AreaRenderable &outline, ObjectRenderables &output) const |
Creates one line of renderables, called by createRenderables(). More... | |
void | createPointPatternLine (MapCoordF first, MapCoordF second, qreal delta_offset, qreal rotation, const AreaRenderable &outline, ObjectRenderables &output) const |
Creates a single line of renderables for a PointPattern. More... | |
void | scale (double factor) |
Spatially scales the pattern settings by the given factor. More... | |
qreal | dimensionForIcon () const |
Public Attributes | |
Type | type |
Type of the pattern. More... | |
Options | flags |
Basic properties of the pattern. More... | |
qreal | angle |
Rotation angle in radians. More... | |
int | line_spacing |
Distance between parallel lines, as usual in 0.001mm. More... | |
int | line_offset |
Offset of the first line from the origin. More... | |
const MapColor * | line_color |
Line color. More... | |
int | line_width |
Line width. More... | |
int | offset_along_line |
Offset of first point along parallel lines. More... | |
int | point_distance |
Point distance along parallel lines. More... | |
PointSymbol * | point |
Contained point symbol. More... | |
QString | name |
Display name (transient) More... | |
Describes a fill pattern.
|
noexcept |
Creates a default fill pattern.
|
inline |
Returns the flags which control drawing at boundary.
void OpenOrienteering::AreaSymbol::FillPattern::colorDeleted | ( | const MapColor * | color | ) |
Removes the pattern's references to the deleted color.
Tests if the pattern contains the given color.
void OpenOrienteering::AreaSymbol::FillPattern::createLine | ( | MapCoordF | first, |
MapCoordF | second, | ||
qreal | delta_offset, | ||
LineSymbol * | line, | ||
qreal | rotation, | ||
const AreaRenderable & | outline, | ||
ObjectRenderables & | output | ||
) | const |
Creates one line of renderables, called by createRenderables().
void OpenOrienteering::AreaSymbol::FillPattern::createPointPatternLine | ( | MapCoordF | first, |
MapCoordF | second, | ||
qreal | delta_offset, | ||
qreal | rotation, | ||
const AreaRenderable & | outline, | ||
ObjectRenderables & | output | ||
) | const |
Creates a single line of renderables for a PointPattern.
void OpenOrienteering::AreaSymbol::FillPattern::createRenderables | ( | const AreaRenderable & | outline, |
qreal | delta_rotation, | ||
const MapCoord & | pattern_origin, | ||
ObjectRenderables & | output | ||
) | const |
Creates renderables for this pattern to fill the area surrounded by the outline.
outline | A renderable giving the extent and outline. |
delta_rotation | Rotation offset which is added to the pattern angle. |
pattern_origin | Origin point for line / point placement. |
output | Created renderables will be inserted here. |
void OpenOrienteering::AreaSymbol::FillPattern::createRenderables | ( | const AreaRenderable & | outline, |
qreal | delta_rotation, | ||
const MapCoord & | pattern_origin, | ||
const QRectF & | point_extent, | ||
LineSymbol * | line, | ||
qreal | rotation, | ||
ObjectRenderables & | output | ||
) | const |
Does the heavy-lifting in loops over lines.
qreal OpenOrienteering::AreaSymbol::FillPattern::dimensionForIcon | ( | ) | const |
bool OpenOrienteering::AreaSymbol::FillPattern::equals | ( | const FillPattern & | other, |
Qt::CaseSensitivity | case_sensitivity | ||
) | const |
Checks if the pattern settings are equal to the other.
TODO: should the transient name really be compared?!
const MapColor * OpenOrienteering::AreaSymbol::FillPattern::guessDominantColor | ( | ) | const |
Returns the patterns primary color.
void OpenOrienteering::AreaSymbol::FillPattern::load | ( | QXmlStreamReader & | xml, |
const Map & | map, | ||
SymbolDictionary & | symbol_dict, | ||
int | version | ||
) |
Loads the pattern in xml format.
|
inline |
Returns true if the pattern is rotatable per object.
void OpenOrienteering::AreaSymbol::FillPattern::save | ( | QXmlStreamWriter & | file, |
const Map & | map | ||
) | const |
Saves the pattern in xml format.
void OpenOrienteering::AreaSymbol::FillPattern::scale | ( | double | factor | ) |
Spatially scales the pattern settings by the given factor.
void OpenOrienteering::AreaSymbol::FillPattern::setClipping | ( | Options | clipping | ) |
Sets the flags which control drawing at boundary.
void OpenOrienteering::AreaSymbol::FillPattern::setRotatable | ( | bool | value | ) |
Controls whether the pattern is rotatable per object.
qreal OpenOrienteering::AreaSymbol::FillPattern::angle |
Rotation angle in radians.
Options OpenOrienteering::AreaSymbol::FillPattern::flags |
Basic properties of the pattern.
const MapColor* OpenOrienteering::AreaSymbol::FillPattern::line_color |
Line color.
int OpenOrienteering::AreaSymbol::FillPattern::line_offset |
Offset of the first line from the origin.
int OpenOrienteering::AreaSymbol::FillPattern::line_spacing |
Distance between parallel lines, as usual in 0.001mm.
int OpenOrienteering::AreaSymbol::FillPattern::line_width |
Line width.
QString OpenOrienteering::AreaSymbol::FillPattern::name |
Display name (transient)
int OpenOrienteering::AreaSymbol::FillPattern::offset_along_line |
Offset of first point along parallel lines.
PointSymbol* OpenOrienteering::AreaSymbol::FillPattern::point |
Contained point symbol.
int OpenOrienteering::AreaSymbol::FillPattern::point_distance |
Point distance along parallel lines.
Type OpenOrienteering::AreaSymbol::FillPattern::type |
Type of the pattern.