te::qt::widgets::WellKnownMarkRenderer Class Reference

A concrete renderer based on Qt4 for conversion of Symbology Enconding Mark elements to an image pattern. It considers basic marks defined on Symbology Enconding Specification: "square", "circle", "triangle", "star", "cross", and "x". More...

#include <WellKnownMarkRenderer.h>

Inheritance diagram for te::qt::widgets::WellKnownMarkRenderer:
te::map::AbstractMarkRenderer

Public Types

enum  MarkType {
  Square, Circle, Triangle, Star,
  Cross, X, Diamond, Ellipse,
  Semicircle, Pentagon, Hexagon, Octagon
}
 This enum specifies mark types handle by this renderer. More...
 

Public Member Functions

void getSupportedMarks (std::vector< std::string > &marks) const
 Method that informs the set of supported marks by a specific concrete mark renderer. More...
 
te::color::RGBAColor ** render (const te::se::Mark *mark, std::size_t size)
 It generates the image pattern from the given Symbology Enconding Mark element. More...
 
 WellKnownMarkRenderer ()
 Constructor. More...
 
 ~WellKnownMarkRenderer ()
 Destructor. More...
 

Protected Member Functions

Internal methods of Qt4 Mark Renderer.

Methods that manipulate Qt4 concepts like QPainter, QImage, QBrush, QPen, QPainterPath, etc.

void buildMaps ()
 Builds the internal auxiliary maps to map Symbology Enconding concepts to Qt. More...
 
void buildPaths ()
 Builds the pre-defined marks paths. More...
 
void setup (QImage *img)
 Setups the internal QPainter and associates it with the given paint device (QImage). More...
 
void end ()
 Finalizes the internal QPainter resources. More...
 
void draw (QImage *img, QPainterPath &path)
 Draw the given path on the the given image using the internal pen and brush. More...
 

Private Attributes

QBrush m_brush
 The pen used to draw the mark patterns. More...
 
QPainterPath m_circlePath
 Pre-defined path to circle mark. More...
 
QPainterPath m_crossPath
 Pre-defined path to cross mark. More...
 
QPainterPath m_diamondPath
 Pre-defined path to diamond mark. More...
 
QPainterPath m_ellipsePath
 Pre-defined path to ellipse mark. More...
 
QPainterPath m_hexagonPath
 Pre-defined path to hexagon mark. More...
 
QPainterPath m_octagonPath
 Pre-defined path to octagon mark. More...
 
QPainter m_painter
 The painter used to draw the mark patterns. More...
 
QPen m_pen
 The pen used to draw the mark patterns. More...
 
QPainterPath m_pentagonPath
 Pre-defined path to pentagon mark. More...
 
QPainterPath m_semiCirclePath
 Pre-defined path to semicircle mark. More...
 
QPainterPath m_squarePath
 Pre-defined path to square mark. More...
 
QPainterPath m_starPath
 Pre-defined path to star mark. More...
 
QPainterPath m_trianglePath
 Pre-defined path to triangle mark. More...
 
QPainterPath m_xPath
 Pre-defined path to x mark. More...
 

Static Private Attributes

static std::map< std::string, MarkTypesm_markMap
 A map that associates a well-known mark name to the correct mark type. More...
 

Detailed Description

A concrete renderer based on Qt4 for conversion of Symbology Enconding Mark elements to an image pattern. It considers basic marks defined on Symbology Enconding Specification: "square", "circle", "triangle", "star", "cross", and "x".

See also
AbstractMarkRenderer

Definition at line 53 of file WellKnownMarkRenderer.h.

Member Enumeration Documentation

This enum specifies mark types handle by this renderer.

Enumerator
Square 

A square mark.

Circle 

A circle mark.

Triangle 

A triangle mark.

Star 

A start mark.

Cross 

A cross mark.

A x mark.

Diamond 

A diamond mark.

Ellipse 

A ellipse mark.

Semicircle 

A semicircle mark.

Pentagon 

A pentagon mark.

Hexagon 

A hegaxon mark.

Octagon 

A octagon mark.

Definition at line 62 of file WellKnownMarkRenderer.h.

Constructor & Destructor Documentation

te::qt::widgets::WellKnownMarkRenderer::WellKnownMarkRenderer ( )

Constructor.

te::qt::widgets::WellKnownMarkRenderer::~WellKnownMarkRenderer ( )

Destructor.

Member Function Documentation

void te::qt::widgets::WellKnownMarkRenderer::buildMaps ( )
protected

Builds the internal auxiliary maps to map Symbology Enconding concepts to Qt.

void te::qt::widgets::WellKnownMarkRenderer::buildPaths ( )
protected

Builds the pre-defined marks paths.

void te::qt::widgets::WellKnownMarkRenderer::draw ( QImage *  img,
QPainterPath &  path 
)
protected

Draw the given path on the the given image using the internal pen and brush.

Parameters
imgThe image where the path will be drawn.
pathThe path that will be drawn.
void te::qt::widgets::WellKnownMarkRenderer::end ( )
protected

Finalizes the internal QPainter resources.

void te::qt::widgets::WellKnownMarkRenderer::getSupportedMarks ( std::vector< std::string > &  marks) const
virtual

Method that informs the set of supported marks by a specific concrete mark renderer.

Parameters
marksA pre-created vector of string that will be filled with the supported marks names.

Implements te::map::AbstractMarkRenderer.

te::color::RGBAColor** te::qt::widgets::WellKnownMarkRenderer::render ( const te::se::Mark mark,
std::size_t  size 
)
virtual

It generates the image pattern from the given Symbology Enconding Mark element.

Parameters
markThe Symbology Enconding Mark element that will be used to build the image pattern.
sizeThe size of image pattern that will be generated.
Returns
The RGBA image that represents the mark.
Note
The caller will take the ownership of the returned pointer.

Implements te::map::AbstractMarkRenderer.

void te::qt::widgets::WellKnownMarkRenderer::setup ( QImage *  img)
protected

Setups the internal QPainter and associates it with the given paint device (QImage).

Member Data Documentation

QBrush te::qt::widgets::WellKnownMarkRenderer::m_brush
private

The pen used to draw the mark patterns.

Definition at line 123 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_circlePath
private

Pre-defined path to circle mark.

Definition at line 126 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_crossPath
private

Pre-defined path to cross mark.

Definition at line 129 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_diamondPath
private

Pre-defined path to diamond mark.

Definition at line 131 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_ellipsePath
private

Pre-defined path to ellipse mark.

Definition at line 132 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_hexagonPath
private

Pre-defined path to hexagon mark.

Definition at line 135 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_octagonPath
private

Pre-defined path to octagon mark.

Definition at line 136 of file WellKnownMarkRenderer.h.

QPainter te::qt::widgets::WellKnownMarkRenderer::m_painter
private

The painter used to draw the mark patterns.

Definition at line 121 of file WellKnownMarkRenderer.h.

QPen te::qt::widgets::WellKnownMarkRenderer::m_pen
private

The pen used to draw the mark patterns.

Definition at line 122 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_pentagonPath
private

Pre-defined path to pentagon mark.

Definition at line 134 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_semiCirclePath
private

Pre-defined path to semicircle mark.

Definition at line 133 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_squarePath
private

Pre-defined path to square mark.

Definition at line 125 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_starPath
private

Pre-defined path to star mark.

Definition at line 128 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_trianglePath
private

Pre-defined path to triangle mark.

Definition at line 127 of file WellKnownMarkRenderer.h.

QPainterPath te::qt::widgets::WellKnownMarkRenderer::m_xPath
private

Pre-defined path to x mark.

Definition at line 130 of file WellKnownMarkRenderer.h.

std::map<std::string, MarkType> te::qt::widgets::WellKnownMarkRenderer::sm_markMap
staticprivate

A map that associates a well-known mark name to the correct mark type.

Definition at line 119 of file WellKnownMarkRenderer.h.


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