Mapper  0.9.0
API documentation
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
OpenOrienteering::PainterConfig Class Reference

PainterConfig contains painter configuration information. More...

#include <renderable.h>

Collaboration diagram for OpenOrienteering::PainterConfig:
Collaboration graph
[legend]

Public Types

enum  PainterMode { BrushOnly = 0, PenOnly = 1, Reserved = -1 }
 

Public Member Functions

bool activate (QPainter *painter, const QPainterPath *&current_clip, const RenderConfig &config, const QColor &color, const QPainterPath &initial_clip) const
 Activates the configuration on the given painter. More...
 

Public Attributes

const int color_priority
 The color priority which determines rendering order. More...
 
const PainterMode mode
 The mode of painting. More...
 
const qreal pen_width
 The width of the pen. More...
 
const QPainterPathclip_path
 A clip_path which may be shared by several Renderables. More...
 

Friends

bool operator== (const PainterConfig &lhs, const PainterConfig &rhs)
 Returns true if the configurations are equal. More...
 
bool operator< (const PainterConfig &lhs, const PainterConfig &rhs)
 Defines an order over values which are not equal. More...
 

Detailed Description

PainterConfig contains painter configuration information.

When painting a renderable item, the QPainter shall be configured according to this information.

A PainterConfig is an immutable values, constructed with initializer lists.

Member Enumeration Documentation

◆ PainterMode

Enumerator
BrushOnly 

Render using the brush only.

PenOnly 

Render using the pen only.

Reserved 

Not used.

Member Function Documentation

◆ activate()

bool OpenOrienteering::PainterConfig::activate ( QPainter painter,
const QPainterPath *&  current_clip,
const RenderConfig config,
const QColor color,
const QPainterPath initial_clip 
) const

Activates the configuration on the given painter.

If this method returns false, the corresponding renderables shall not be drawn.

Parameters
painterThe painter to be configured.
current_clipA pointer which will be set to the address of the current clip, in order to avoid switching the clip area unnecessarily.
configThe rendering configurations.
colorThe QColor to be used for the pen or brush.
initial_clipThe clip which was set initially for this painter.
Returns
True if the configuration was activated, false if the corresponding renderables shall not be drawn.

Friends And Related Function Documentation

◆ operator<

bool operator< ( const PainterConfig lhs,
const PainterConfig rhs 
)
friend

Defines an order over values which are not equal.

◆ operator==

bool operator== ( const PainterConfig lhs,
const PainterConfig rhs 
)
friend

Returns true if the configurations are equal.

Member Data Documentation

◆ clip_path

const QPainterPath* OpenOrienteering::PainterConfig::clip_path

A clip_path which may be shared by several Renderables.

◆ color_priority

const int OpenOrienteering::PainterConfig::color_priority

The color priority which determines rendering order.

◆ mode

const PainterMode OpenOrienteering::PainterConfig::mode

The mode of painting.

◆ pen_width

const qreal OpenOrienteering::PainterConfig::pen_width

The width of the pen.


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