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>
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, MarkType > | sm_markMap |
A map that associates a well-known mark name to the correct mark type. More... | |
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".
Definition at line 53 of file WellKnownMarkRenderer.h.
This enum specifies mark types handle by this renderer.
Definition at line 62 of file WellKnownMarkRenderer.h.
te::qt::widgets::WellKnownMarkRenderer::WellKnownMarkRenderer | ( | ) |
Constructor.
Definition at line 40 of file WellKnownMarkRenderer.cpp.
References buildMaps(), buildPaths(), m_brush, and TE_SE_DEFAULT_FILL_BASIC_COLOR.
te::qt::widgets::WellKnownMarkRenderer::~WellKnownMarkRenderer | ( | ) |
Destructor.
Definition at line 49 of file WellKnownMarkRenderer.cpp.
|
protected |
Builds the internal auxiliary maps to map Symbology Enconding concepts to Qt.
Definition at line 140 of file WellKnownMarkRenderer.cpp.
References Circle, Cross, Diamond, Ellipse, Hexagon, Octagon, Pentagon, Semicircle, Square, Star, Triangle, and X.
Referenced by WellKnownMarkRenderer().
|
protected |
Builds the pre-defined marks paths.
Definition at line 157 of file WellKnownMarkRenderer.cpp.
Referenced by WellKnownMarkRenderer().
|
protected |
Draw the given path on the the given image using the internal pen and brush.
img | The image where the path will be drawn. |
path | The path that will be drawn. |
Definition at line 275 of file WellKnownMarkRenderer.cpp.
|
protected |
Finalizes the internal QPainter resources.
Definition at line 268 of file WellKnownMarkRenderer.cpp.
References TE_SE_DEFAULT_FILL_BASIC_COLOR, and TE_SE_DEFAULT_STROKE_BASIC_COLOR.
|
virtual |
Method that informs the set of supported marks by a specific concrete mark renderer.
marks | A pre-created vector of string that will be filled with the supported marks names. |
Implements te::map::AbstractMarkRenderer.
Definition at line 133 of file WellKnownMarkRenderer.cpp.
|
virtual |
It generates the image pattern from the given Symbology Enconding Mark element.
mark | The Symbology Enconding Mark element that will be used to build the image pattern. |
size | The size of image pattern that will be generated. |
Implements te::map::AbstractMarkRenderer.
Definition at line 53 of file WellKnownMarkRenderer.cpp.
References Circle, te::qt::widgets::Config(), te::common::Convert2LCase(), Cross, Diamond, Ellipse, te::se::Mark::getFill(), te::qt::widgets::GetImage(), te::se::Mark::getStroke(), te::se::Mark::getWellKnownName(), Hexagon, Octagon, Pentagon, Semicircle, Square, Star, Triangle, and X.
|
protected |
Setups the internal QPainter and associates it with the given paint device (QImage).
Definition at line 260 of file WellKnownMarkRenderer.cpp.
|
private |
The pen used to draw the mark patterns.
Definition at line 123 of file WellKnownMarkRenderer.h.
Referenced by WellKnownMarkRenderer().
|
private |
Pre-defined path to circle mark.
Definition at line 126 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to cross mark.
Definition at line 129 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to diamond mark.
Definition at line 131 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to ellipse mark.
Definition at line 132 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to hexagon mark.
Definition at line 135 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to octagon mark.
Definition at line 136 of file WellKnownMarkRenderer.h.
|
private |
The painter used to draw the mark patterns.
Definition at line 121 of file WellKnownMarkRenderer.h.
|
private |
The pen used to draw the mark patterns.
Definition at line 122 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to pentagon mark.
Definition at line 134 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to semicircle mark.
Definition at line 133 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to square mark.
Definition at line 125 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to star mark.
Definition at line 128 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to triangle mark.
Definition at line 127 of file WellKnownMarkRenderer.h.
|
private |
Pre-defined path to x mark.
Definition at line 130 of file WellKnownMarkRenderer.h.
|
staticprivate |
A map that associates a well-known mark name to the correct mark type.
Definition at line 119 of file WellKnownMarkRenderer.h.