QGIS API Documentation  2.99.0-Master (e077efd)
qgsdxfpallabeling.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdxfpallabeling.h
3  -------------------
4  begin : January 2014
5  copyright : (C) 2014 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSDXFPALLABELING_H
19 #define QGSDXFPALLABELING_H
20 
22 #include "qgsrulebasedlabeling.h"
23 
24 class QgsDxfExport;
27 
28 
36 {
37  public:
39  explicit QgsDxfLabelProvider( QgsVectorLayer* layer, const QString& providerId, QgsDxfExport* dxf, const QgsPalLayerSettings *settings );
40 
45  void drawLabel( QgsRenderContext& context, pal::LabelPosition* label ) const override;
46 
52  void registerDxfFeature( QgsFeature& feature, QgsRenderContext &context, const QString& dxfLayerName );
53 
54  protected:
57 };
58 
67 {
68  public:
71 
75  void reinit( QgsVectorLayer* layer );
76 
81  void drawLabel( QgsRenderContext &context, pal::LabelPosition *label ) const override;
82 
88  void registerDxfFeature( QgsFeature& feature, QgsRenderContext &context, const QString& dxfLayerName );
89 
91  virtual QgsVectorLayerLabelProvider *createProvider( QgsVectorLayer *layer, const QString& providerId, bool withFeatureLoop, const QgsPalLayerSettings *settings ) override;
92 
93  protected:
96 };
97 
98 
99 
100 #endif // QGSDXFPALLABELING_H
Implements a derived label provider for rule based labels internally used for DXF export...
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:135
void drawLabel(QgsRenderContext &context, pal::LabelPosition *label) const override
Re-implementation that writes to DXF file instead of drawing with QPainter.
QgsDxfLabelProvider(QgsVectorLayer *layer, const QString &providerId, QgsDxfExport *dxf, const QgsPalLayerSettings *settings)
construct the provider
Contains information about the context of a rendering operation.
QgsDxfExport * mDxfExport
pointer to parent DXF export where this instance is used
LabelPosition is a candidate feature label position.
Definition: labelposition.h:51
QString providerId() const
Returns provider ID - useful in case there is more than one label provider within a layer (e...
void registerDxfFeature(QgsFeature &feature, QgsRenderContext &context, const QString &dxfLayerName)
Registration method that keeps track of DXF layer names of individual features.
Implements a derived label provider internally used for DXF export.
QgsDxfExport * mDxfExport
pointer to parent DXF export where this instance is used
Represents a vector layer which manages a vector based data sets.