QGIS API Documentation  2.14.0-Essen
qgstextlabelfeature.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgstextlabelfeature.h
3  ---------------------
4  begin : December 2015
5  copyright : (C) 2015 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSTEXTLABELFEATURE_H
16 #define QGSTEXTLABELFEATURE_H
17 
18 #include "qgslabelfeature.h"
19 
26 {
27  public:
29  QgsTextLabelFeature( QgsFeatureId id, GEOSGeometry* geometry, QSizeF size );
30 
33 
39  QString text( int partId ) const;
40 
42  void calculateInfo( bool curvedLabeling, QFontMetricsF* fm, const QgsMapToPixel* xform, double fontScale, double maxinangle, double maxoutangle );
43 
48 
50  void setDefinedFont( const QFont& f ) { mDefinedFont = f; }
53 
56 
57  protected:
66 
67 };
68 
69 #endif //QGSTEXTLABELFEATURE_H
QFontMetricsF * mFontMetrics
Metrics of the font for rendering.
QgsTextLabelFeature(QgsFeatureId id, GEOSGeometry *geometry, const QSizeF &size)
Construct text label feature.
QStringList mClusters
List of graphemes (used for curved labels)
~QgsTextLabelFeature()
Clean up.
Class that adds extra information to QgsLabelFeature for text labels.
void setDefinedFont(const QFont &f)
Set font to be used for rendering.
GEOSGeometry * geometry() const
Get access to the associated geometry.
QSizeF size() const
Size of the label (in map units)
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:34
QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > mDataDefinedValues
Stores attribute values for data defined properties.
void setDataDefinedValues(const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &values)
Set data-defined values.
const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > & dataDefinedValues() const
Get data-defined values.
void calculateInfo(bool curvedLabeling, QFontMetricsF *fm, const QgsMapToPixel *xform, double fontScale, double maxinangle, double maxoutangle)
calculate data for info(). setDefinedFont() must have been called already.
QFont definedFont()
Font to be used for rendering.
QString text(int partId) const
Returns the text component corresponding to a specified label part.
The QgsLabelFeature class describes a feature that should be used within the labeling engine...
qint64 QgsFeatureId
Definition: qgsfeature.h:31
QFont mDefinedFont
Font for rendering.
QFontMetricsF * labelFontMetrics()
Metrics of the font for rendering.