Mapper  0.9.0
API documentation
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpenOrienteering::Renderable Class Referenceabstract

A Renderable is a graphical item with a simple shape and a single color. More...

#include <renderable.h>

Inheritance diagram for OpenOrienteering::Renderable:
Inheritance graph
[legend]
Collaboration diagram for OpenOrienteering::Renderable:
Collaboration graph
[legend]

Public Member Functions

 Renderable (const Renderable &)=delete
 
 Renderable (Renderable &&)=delete
 
virtual ~Renderable ()
 The destructor. More...
 
Renderableoperator= (const Renderable &)=delete
 
Renderableoperator= (Renderable &&)=delete
 
const QRectFgetExtent () const
 Returns the extent (bounding box). More...
 
bool intersects (const QRectF &rect) const
 Tests whether the renderable's extent intersects the given rect. More...
 
virtual PainterConfig getPainterConfig (const QPainterPath *clip_path=nullptr) const =0
 Returns the painter configuration information. More...
 
virtual void render (QPainter &painter, const RenderConfig &config) const =0
 Renders the renderable with the given painter and rendering configuration. More...
 

Protected Member Functions

 Renderable (const MapColor *color)
 The constructor for new renderables. More...
 

Protected Attributes

const int color_priority
 The color priority is a major attribute and cannot be modified. More...
 
QRectF extent
 The extent must be set by inheriting classes. More...
 

Detailed Description

A Renderable is a graphical item with a simple shape and a single color.

This is the abstract base class. Inheriting classes must implement the abstract methods, and they must set the extent during construction.

Constructor & Destructor Documentation

◆ Renderable() [1/3]

OpenOrienteering::Renderable::Renderable ( const MapColor color)
inlineexplicitprotected

The constructor for new renderables.

◆ Renderable() [2/3]

OpenOrienteering::Renderable::Renderable ( const Renderable )
delete

◆ Renderable() [3/3]

OpenOrienteering::Renderable::Renderable ( Renderable &&  )
delete

◆ ~Renderable()

OpenOrienteering::Renderable::~Renderable ( )
virtualdefault

The destructor.

Member Function Documentation

◆ getExtent()

const QRectF & OpenOrienteering::Renderable::getExtent ( ) const
inline

Returns the extent (bounding box).

◆ getPainterConfig()

virtual PainterConfig OpenOrienteering::Renderable::getPainterConfig ( const QPainterPath clip_path = nullptr) const
pure virtual

Returns the painter configuration information.

This configuration must be set when rendering this renderable.

Implemented in OpenOrienteering::TextFramingRenderable, OpenOrienteering::TextRenderable, OpenOrienteering::AreaRenderable, OpenOrienteering::LineRenderable, OpenOrienteering::CircleRenderable, and OpenOrienteering::DotRenderable.

◆ intersects()

bool OpenOrienteering::Renderable::intersects ( const QRectF rect) const
inline

Tests whether the renderable's extent intersects the given rect.

◆ operator=() [1/2]

Renderable& OpenOrienteering::Renderable::operator= ( const Renderable )
delete

◆ operator=() [2/2]

Renderable& OpenOrienteering::Renderable::operator= ( Renderable &&  )
delete

◆ render()

virtual void OpenOrienteering::Renderable::render ( QPainter painter,
const RenderConfig config 
) const
pure virtual

Member Data Documentation

◆ color_priority

const int OpenOrienteering::Renderable::color_priority
protected

The color priority is a major attribute and cannot be modified.

◆ extent

QRectF OpenOrienteering::Renderable::extent
protected

The extent must be set by inheriting classes.


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