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, TE_SE_DEFAULT_FILL_BASIC_COLOR, and ~WellKnownMarkRenderer().
|
default |
Destructor.
Referenced by WellKnownMarkRenderer().
|
protected |
Builds the internal auxiliary maps to map Symbology Enconding concepts to Qt.
Definition at line 138 of file WellKnownMarkRenderer.cpp.
References Circle, Cross, Diamond, Ellipse, Hexagon, Octagon, Pentagon, Semicircle, sm_markMap, Square, Star, Triangle, and X.
Referenced by WellKnownMarkRenderer().
|
protected |
Builds the pre-defined marks paths.
Definition at line 155 of file WellKnownMarkRenderer.cpp.
References m_circlePath, m_crossPath, m_diamondPath, m_ellipsePath, m_hexagonPath, m_octagonPath, m_pentagonPath, m_semiCirclePath, m_squarePath, m_starPath, m_trianglePath, and m_xPath.
Referenced by WellKnownMarkRenderer().
|
protected |
|
protected |
Finalizes the internal QPainter resources.
Definition at line 266 of file WellKnownMarkRenderer.cpp.
References m_brush, m_painter, m_pen, TE_SE_DEFAULT_FILL_BASIC_COLOR, and TE_SE_DEFAULT_STROKE_BASIC_COLOR.
Referenced by draw().
|
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 131 of file WellKnownMarkRenderer.cpp.
References sm_markMap.
|
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 51 of file WellKnownMarkRenderer.cpp.
References Circle, te::qt::widgets::Config(), te::common::Convert2LCase(), Cross, Diamond, draw(), Ellipse, te::se::Mark::getFill(), te::qt::widgets::GetImage(), te::se::Mark::getStroke(), te::se::Mark::getWellKnownName(), Hexagon, m_brush, m_circlePath, m_crossPath, m_diamondPath, m_ellipsePath, m_hexagonPath, m_octagonPath, m_pen, m_pentagonPath, m_semiCirclePath, m_squarePath, m_starPath, m_trianglePath, m_xPath, Octagon, Pentagon, Semicircle, sm_markMap, Square, Star, Triangle, and X.
|
protected |
|
private |
The pen used to draw the mark patterns.
Definition at line 123 of file WellKnownMarkRenderer.h.
Referenced by end(), render(), setup(), and WellKnownMarkRenderer().
|
private |
Pre-defined path to circle mark.
Definition at line 126 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
Pre-defined path to cross mark.
Definition at line 129 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
Pre-defined path to diamond mark.
Definition at line 131 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
Pre-defined path to ellipse mark.
Definition at line 132 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
Pre-defined path to hexagon mark.
Definition at line 135 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
Pre-defined path to octagon mark.
Definition at line 136 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
The painter used to draw the mark patterns.
Definition at line 121 of file WellKnownMarkRenderer.h.
|
private |
|
private |
Pre-defined path to pentagon mark.
Definition at line 134 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
Pre-defined path to semicircle mark.
Definition at line 133 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
Pre-defined path to square mark.
Definition at line 125 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
Pre-defined path to star mark.
Definition at line 128 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
Pre-defined path to triangle mark.
Definition at line 127 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
private |
Pre-defined path to x mark.
Definition at line 130 of file WellKnownMarkRenderer.h.
Referenced by buildPaths(), and render().
|
staticprivate |
A map that associates a well-known mark name to the correct mark type.
Definition at line 119 of file WellKnownMarkRenderer.h.
Referenced by buildMaps(), getSupportedMarks(), and render().