Mapper  0.9.0
API documentation
Public Types | Public Member Functions | Public Attributes | List of all members
OpenOrienteering::AreaSymbol::FillPattern Struct Reference

Describes a fill pattern. More...

#include <area_symbol.h>

Collaboration diagram for OpenOrienteering::AreaSymbol::FillPattern:
Collaboration graph
[legend]

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 MapColorguessDominantColor () 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 MapColorline_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...
 
PointSymbolpoint
 Contained point symbol. More...
 
QString name
 Display name (transient) More...
 

Detailed Description

Describes a fill pattern.

Member Enumeration Documentation

◆ Option

Flags for pattern properties.

Enumerator
Default 
NoClippingIfCompletelyInside 
NoClippingIfCenterInside 
NoClippingIfPartiallyInside 
AlternativeToClipping 

Bitmask for NoClipping* options.

Rotatable 

Pattern is rotatable per-object.

◆ Type

Types of fill patterns.

Enumerator
LinePattern 

Parallel lines pattern.

PointPattern 

Point grid pattern.

Constructor & Destructor Documentation

◆ FillPattern()

OpenOrienteering::AreaSymbol::FillPattern::FillPattern ( )
noexcept

Creates a default fill pattern.

Member Function Documentation

◆ clipping()

AreaSymbol::FillPattern::Options OpenOrienteering::AreaSymbol::FillPattern::clipping ( ) const
inline

Returns the flags which control drawing at boundary.

◆ colorDeleted()

void OpenOrienteering::AreaSymbol::FillPattern::colorDeleted ( const MapColor color)

Removes the pattern's references to the deleted color.

◆ containsColor()

bool OpenOrienteering::AreaSymbol::FillPattern::containsColor ( const MapColor color) const

Tests if the pattern contains the given color.

◆ createLine()

template<int type>
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().

◆ createPointPatternLine()

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.

◆ createRenderables() [1/2]

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.

Parameters
outlineA renderable giving the extent and outline.
delta_rotationRotation offset which is added to the pattern angle.
pattern_originOrigin point for line / point placement.
outputCreated renderables will be inserted here.

◆ createRenderables() [2/2]

template<int T>
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.

◆ dimensionForIcon()

qreal OpenOrienteering::AreaSymbol::FillPattern::dimensionForIcon ( ) const

◆ equals()

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?!

◆ guessDominantColor()

const MapColor * OpenOrienteering::AreaSymbol::FillPattern::guessDominantColor ( ) const

Returns the patterns primary color.

◆ load()

void OpenOrienteering::AreaSymbol::FillPattern::load ( QXmlStreamReader xml,
const Map map,
SymbolDictionary symbol_dict,
int  version 
)

Loads the pattern in xml format.

◆ rotatable()

bool OpenOrienteering::AreaSymbol::FillPattern::rotatable ( ) const
inline

Returns true if the pattern is rotatable per object.

◆ save()

void OpenOrienteering::AreaSymbol::FillPattern::save ( QXmlStreamWriter file,
const Map map 
) const

Saves the pattern in xml format.

◆ scale()

void OpenOrienteering::AreaSymbol::FillPattern::scale ( double  factor)

Spatially scales the pattern settings by the given factor.

◆ setClipping()

void OpenOrienteering::AreaSymbol::FillPattern::setClipping ( Options  clipping)

Sets the flags which control drawing at boundary.

◆ setRotatable()

void OpenOrienteering::AreaSymbol::FillPattern::setRotatable ( bool  value)

Controls whether the pattern is rotatable per object.

Member Data Documentation

◆ angle

qreal OpenOrienteering::AreaSymbol::FillPattern::angle

Rotation angle in radians.

Todo:
Switch to qreal when legacy native file format is dropped.

◆ flags

Options OpenOrienteering::AreaSymbol::FillPattern::flags

Basic properties of the pattern.

◆ line_color

const MapColor* OpenOrienteering::AreaSymbol::FillPattern::line_color

Line color.

◆ line_offset

int OpenOrienteering::AreaSymbol::FillPattern::line_offset

Offset of the first line from the origin.

◆ line_spacing

int OpenOrienteering::AreaSymbol::FillPattern::line_spacing

Distance between parallel lines, as usual in 0.001mm.

◆ line_width

int OpenOrienteering::AreaSymbol::FillPattern::line_width

Line width.

◆ name

QString OpenOrienteering::AreaSymbol::FillPattern::name

Display name (transient)

◆ offset_along_line

int OpenOrienteering::AreaSymbol::FillPattern::offset_along_line

Offset of first point along parallel lines.

◆ point

PointSymbol* OpenOrienteering::AreaSymbol::FillPattern::point

Contained point symbol.

◆ point_distance

int OpenOrienteering::AreaSymbol::FillPattern::point_distance

Point distance along parallel lines.

◆ type

Type OpenOrienteering::AreaSymbol::FillPattern::type

Type of the pattern.


The documentation for this struct was generated from the following files: