A concrete renderer based on Qt4 for conversion of Symbology Enconding Mark elements to an image pattern. It is a extension that considers marks with well-known name in the format: "ttf://font#code". Here, "font" is the name of a TrueType font and "code" is the character code. The character code can be enconded in hexadecimal, octonal or decimal. e.g.: "ttf://Arial#0x12", "ttf://Times#042", "ttf://Verdana#10".
More...
#include <GlyphMarkRenderer.h>
|
static void | decode (QString &name, QString &font, QChar &charCode) |
| Decodes the given name extracting the parameters known by this renderer. More...
|
|
static QString | encode (const QString &font, const int &charCode) |
| Encodes the given parameters to a format known by this renderer. More...
|
|
|
|
Methods that manipulate Qt4 concepts like QPainter, QImage, QBrush, QPen, QPainterPath, etc.
|
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...
|
|
bool | getChar (QString &charCode, QChar &ch) |
| Converts the character code to a char. More...
|
|
A concrete renderer based on Qt4 for conversion of Symbology Enconding Mark elements to an image pattern. It is a extension that considers marks with well-known name in the format: "ttf://font#code". Here, "font" is the name of a TrueType font and "code" is the character code. The character code can be enconded in hexadecimal, octonal or decimal. e.g.: "ttf://Arial#0x12", "ttf://Times#042", "ttf://Verdana#10".
- See also
- AbstractMarkRenderer
Definition at line 56 of file GlyphMarkRenderer.h.
te::qt::widgets::GlyphMarkRenderer::GlyphMarkRenderer |
( |
| ) |
|
te::qt::widgets::GlyphMarkRenderer::~GlyphMarkRenderer |
( |
| ) |
|
static void te::qt::widgets::GlyphMarkRenderer::decode |
( |
QString & |
name, |
|
|
QString & |
font, |
|
|
QChar & |
charCode |
|
) |
| |
|
static |
Decodes the given name extracting the parameters known by this renderer.
- Parameters
-
name | The name dealt by this renderer. e.g. "ttf://Times#0x12". |
font | The font name that will be extracted from name. |
charCoder | The char code that will be extracted from name. |
void te::qt::widgets::GlyphMarkRenderer::draw |
( |
QImage * |
img, |
|
|
QPainterPath & |
path |
|
) |
| |
|
protected |
Draw the given path on the the given image using the internal pen and brush.
- Parameters
-
img | The image where the path will be drawn. |
path | The path that will be drawn. |
static QString te::qt::widgets::GlyphMarkRenderer::encode |
( |
const QString & |
font, |
|
|
const int & |
charCode |
|
) |
| |
|
static |
Encodes the given parameters to a format known by this renderer.
- Parameters
-
font | The font name. e.g. "Times". |
charCoder | The decimal char code. |
- Returns
- A string that represents the format known by this renderer. e.g. "ttf://Times#0x12".
- Note
- The given char code will be enconded in hexadecimal.
void te::qt::widgets::GlyphMarkRenderer::end |
( |
| ) |
|
|
protected |
Finalizes the internal QPainter resources.
bool te::qt::widgets::GlyphMarkRenderer::getChar |
( |
QString & |
charCode, |
|
|
QChar & |
ch |
|
) |
| |
|
protected |
Converts the character code to a char.
- Parameters
-
charCode | The character code. It can be enconded in hexadecimal, octonal or decimal. |
ch | The result char from character code conversion. |
- Returns
- It returns true if the character code was converted. Otherwise, it returns false.
void te::qt::widgets::GlyphMarkRenderer::getSupportedMarks |
( |
std::vector< std::string > & |
marks | ) |
const |
|
virtual |
Method that informs the set of supported marks by a specific concrete mark renderer.
- Parameters
-
marks | A pre-created vector of string that will be filled with the supported marks names. |
Implements te::map::AbstractMarkRenderer.
It generates the image pattern from the given Symbology Enconding Mark element.
- Parameters
-
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. |
- 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::GlyphMarkRenderer::setup |
( |
QImage * |
img | ) |
|
|
protected |
Setups the internal QPainter and associates it with the given paint device (QImage).
QBrush te::qt::widgets::GlyphMarkRenderer::m_brush |
|
private |
QPainter te::qt::widgets::GlyphMarkRenderer::m_painter |
|
private |
QPen te::qt::widgets::GlyphMarkRenderer::m_pen |
|
private |
std::string te::qt::widgets::GlyphMarkRenderer::sm_rendererKey |
|
staticprivate |
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_master/src/terralib/qt/widgets/se/GlyphMarkRenderer.h