QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgspallabeling.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspallabeling.h
3  Smart labeling for vector layers
4  -------------------
5  begin : June 2009
6  copyright : (C) Martin Dobias
7  email : wonder dot sk at gmail dot com
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 //Note: although this file is in the core library, it is not part of the stable API
19 //and might change at any time!
20 
21 #ifndef QGSPALLABELING_H
22 #define QGSPALLABELING_H
23 
24 class QFontMetricsF;
25 class QPainter;
26 class QPicture;
27 class QgsGeometry;
28 class QgsMapRenderer;
29 class QgsRectangle;
31 class QgsLabelSearchTree;
32 
33 class QgsMapSettings;
34 
35 #include <QString>
36 #include <QFont>
37 #include <QFontDatabase>
38 #include <QColor>
39 #include <QHash>
40 #include <QList>
41 #include <QRectF>
42 
43 namespace pal
44 {
45  class Pal;
46  class Layer;
47  class LabelPosition;
48 }
49 
50 class QgsMapToPixel;
51 class QgsFeature;
52 
53 #include "qgspoint.h"
54 #include "qgsrectangle.h"
55 #include "qgsmaprenderer.h" // definition of QgsLabelingEngineInterface
56 #include "qgsexpression.h"
57 #include "qgsdatadefined.h"
58 #include "qgsdiagramrendererv2.h"
59 #include "qgsmapunitscale.h"
60 
61 class QgsPalGeometry;
62 class QgsVectorLayer;
63 
64 class CORE_EXPORT QgsPalLayerSettings
65 {
66  public:
70 
72  static QgsPalLayerSettings fromLayer( QgsVectorLayer* layer );
73 
74  enum Placement
75  {
76  AroundPoint, // Point / Polygon
77  OverPoint, // Point / Polygon
78  Line, // Line / Polygon
79  Curved, // Line
80  Horizontal, // Polygon
81  Free // Polygon
82  };
83 
85  {
86  OnLine = 1,
87  AboveLine = 2,
88  BelowLine = 4,
89  MapOrientation = 8
90  };
91 
93  {
102  QuadrantBelowRight
103  };
104 
106  {
107  Upright, // upside-down labels (90 <= angle < 270) are shown upright
108  ShowDefined, // show upside down when rotation is layer- or data-defined
109  ShowAll // show upside down for all labels, including dynamic ones
110  };
111 
113  {
114  SymbolLeftRight, // place direction symbols on left/right of label
115  SymbolAbove, // place direction symbols on above label
116  SymbolBelow // place direction symbols on below label
117  };
118 
120  {
121  MultiLeft = 0,
123  MultiRight
124  };
125 
127  {
128  ShapeRectangle = 0,
132  ShapeSVG
133  };
134 
135  enum SizeType
136  {
137  SizeBuffer = 0,
139  SizePercent
140  };
141 
143  {
144  RotationSync = 0,
146  RotationFixed
147  };
148 
150  enum SizeUnit
151  {
152  Points = 0,
153  MM,
155  Percent
156  };
157 
159  {
160  ShadowLowest = 0,
163  ShadowShape
164  };
165 
166  // update mDataDefinedNames QMap in constructor when adding/deleting enum value
168  {
169  // text style
170  Size = 0,
171  Bold = 1,
172  Italic = 2,
173  Underline = 3,
174  Color = 4,
175  Strikeout = 5,
176  Family = 6,
177  FontStyle = 21,
178  FontSizeUnit = 22,
179  FontTransp = 18,
180  FontCase = 27,
181  FontLetterSpacing = 28,
182  FontWordSpacing = 29,
183  FontBlendMode = 30,
184 
185  // text formatting
186  MultiLineWrapChar = 31,
187  MultiLineHeight = 32,
188  MultiLineAlignment = 33,
189  DirSymbDraw = 34,
190  DirSymbLeft = 35,
191  DirSymbRight = 36,
192  DirSymbPlacement = 37,
193  DirSymbReverse = 38,
194  NumFormat = 39,
195  NumDecimals = 40,
196  NumPlusSign = 41,
197 
198  // text buffer
199  BufferDraw = 42,
200  BufferSize = 7,
201  BufferUnit = 43,
202  BufferColor = 8,
203  BufferTransp = 19,
204  BufferJoinStyle = 44,
205  BufferBlendMode = 45,
206 
207  // background
208  ShapeDraw = 46,
209  ShapeKind = 47,
210  ShapeSVGFile = 48,
211  ShapeSizeType = 49,
212  ShapeSizeX = 50,
213  ShapeSizeY = 85,
214  ShapeSizeUnits = 51,
215  ShapeRotationType = 52,
216  ShapeRotation = 53,
217  ShapeOffset = 54,
218  ShapeOffsetUnits = 55,
219  ShapeRadii = 56,
220  ShapeRadiiUnits = 57,
221  ShapeTransparency = 63,
222  ShapeBlendMode = 64,
223  ShapeFillColor = 58,
224  ShapeBorderColor = 59,
225  ShapeBorderWidth = 60,
226  ShapeBorderWidthUnits = 61,
227  ShapeJoinStyle = 62,
228 
229  // drop shadow
230  ShadowDraw = 65,
231  ShadowUnder = 66,
232  ShadowOffsetAngle = 67,
233  ShadowOffsetDist = 68,
234  ShadowOffsetUnits = 69,
235  ShadowRadius = 70,
236  ShadowRadiusUnits = 71,
237  ShadowTransparency = 72,
238  ShadowScale = 73,
239  ShadowColor = 74,
240  ShadowBlendMode = 75,
241 
242  // placement
243  CentroidWhole = 76,
244  OffsetQuad = 77,
245  OffsetXY = 78,
246  OffsetUnits = 80,
247  LabelDistance = 13,
248  DistanceUnits = 81,
249  OffsetRotation = 82,
250  CurvedCharAngleInOut = 83,
251  // (data defined only)
252  PositionX = 9, //x-coordinate data defined label position
253  PositionY = 10, //y-coordinate data defined label position
254  Hali = 11, //horizontal alignment for data defined label position (Left, Center, Right)
255  Vali = 12, //vertical alignment for data defined label position (Bottom, Base, Half, Cap, Top)
256  Rotation = 14, //data defined rotation
257  RepeatDistance = 84,
258  RepeatDistanceUnit = 86,
259 
260  // rendering
261  ScaleVisibility = 23,
262  MinScale = 16,
263  MaxScale = 17,
264  FontLimitPixel = 24,
265  FontMinPixel = 25,
266  FontMaxPixel = 26,
267  // (data defined only)
268  Show = 15,
269  AlwaysShow = 20
270  };
271 
272  // whether to label this layer
273  bool enabled;
274 
275  //-- text style
276 
277  QString fieldName;
278 
282 
285  QgsExpression* getLabelExpression();
286 
287  QFont textFont;
288  QString textNamedStyle;
289  bool fontSizeInMapUnits; //true if font size is in map units (otherwise in points)
290  QgsMapUnitScale fontSizeMapUnitScale; // scale range for map units for font size
291  QColor textColor;
293  QPainter::CompositionMode blendMode;
295 
296  //-- text formatting
297 
298  QString wrapChar;
299  double multilineHeight; //0.0 to 10.0, leading between lines as multiplyer of line height
300  MultiLineAlign multilineAlign; // horizontal alignment of multi-line labels
301 
302  // Adds '<' or '>', or user-defined symbol to the label string pointing to the
303  // direction of the line / polygon ring
304  // Works only if Placement == Line
308  DirectionSymbols placeDirectionSymbol; // whether to place left/right, above or below label
310 
312  int decimals;
313  bool plusSign;
314 
315  //-- text buffer
316 
318  double bufferSize; // buffer size
319  bool bufferSizeInMapUnits; //true if buffer is in map units (otherwise in mm)
320  QgsMapUnitScale bufferSizeMapUnitScale; // scale range for map units for buffer size
321  QColor bufferColor;
322  bool bufferNoFill; //set interior of buffer to 100% transparent
324  Qt::PenJoinStyle bufferJoinStyle;
325  QPainter::CompositionMode bufferBlendMode;
326 
327  //-- shape background
328 
329  bool shapeDraw;
331  QString shapeSVGFile;
333  QPointF shapeSize;
338  QPointF shapeOffset;
341  QPointF shapeRadii;
345  QPainter::CompositionMode shapeBlendMode;
351  Qt::PenJoinStyle shapeJoinStyle;
352 
353  //-- drop shadow
354 
362  double shadowRadius;
368  QColor shadowColor;
369  QPainter::CompositionMode shadowBlendMode;
370 
371  //-- placement
372 
374  unsigned int placementFlags;
375 
376  bool centroidWhole; // whether centroid calculated from whole or visible polygon
377  bool centroidInside; // whether centroid-point calculated must be inside polygon
378  double dist; // distance from the feature (in mm)
379  bool distInMapUnits; //true if distance is in map units (otherwise in mm)
381 
385 
386  // offset labels of point/centroid features default to center
387  // move label to quadrant: left/down, don't move, right/up (-1, 0, 1)
389 
390  double xOffset; // offset from point in mm or map units
391  double yOffset; // offset from point in mm or map units
392  bool labelOffsetInMapUnits; //true if label offset is in map units (otherwise in mm)
394  double angleOffset; // rotation applied to offset labels
395  bool preserveRotation; // preserve predefined rotation data during label pin/unpin operations
396 
397  double maxCurvedCharAngleIn; // maximum angle between inside curved label characters (defaults to 20.0, range 20.0 to 60.0)
398  double maxCurvedCharAngleOut; // maximum angle between outside curved label characters (defaults to -20.0, range -20.0 to -95.0)
399 
400  int priority; // 0 = low, 10 = high
401 
402  //-- rendering
403 
405  int scaleMin;
406  int scaleMax;
407 
408  bool fontLimitPixelSize; // true is label should be limited by fontMinPixelSize/fontMaxPixelSize
409  int fontMinPixelSize; // minimum pixel size for showing rendered map unit labels (1 - 1000)
410  int fontMaxPixelSize; // maximum pixel size for showing rendered map unit labels (1 - 10000)
411 
412  bool displayAll; // if true, all features will be labelled even though overlaps occur
413  unsigned int upsidedownLabels; // whether, or how, to show upsidedown labels
414 
415  bool labelPerPart; // whether to label every feature's part or only the biggest one
417 
418  bool limitNumLabels; // whether to limit the number of labels to be drawn
419  int maxNumLabels; // maximum number of labels to be drawn
420 
421  double minFeatureSize; // minimum feature size to be labelled (in mm)
422  bool obstacle; // whether features for layer are obstacles to labels of other layers
423 
424  //-- scale factors
425  double vectorScaleFactor; //scale factor painter units->pixels
426  double rasterCompressFactor; //pixel resolution scale factor
427 
428  // called from register feature hook
429  void calculateLabelSize( const QFontMetricsF* fm, QString text, double& labelX, double& labelY, QgsFeature* f = 0 );
430 
431  // implementation of register feature hook
432  void registerFeature( QgsFeature& f, const QgsRenderContext& context, QString dxfLayer );
433 
434  void readFromLayer( QgsVectorLayer* layer );
435  void writeToLayer( QgsVectorLayer* layer );
436 
441 
445  void setDataDefinedProperty( QgsPalLayerSettings::DataDefinedProperties p,
446  bool active, bool useExpr, const QString& expr, const QString& field );
447 
449  void removeDataDefinedProperty( QgsPalLayerSettings::DataDefinedProperties p );
450 
454  QString updateDataDefinedString( const QString& value );
455 
459  QMap<QString, QString> dataDefinedMap( QgsPalLayerSettings::DataDefinedProperties p ) const;
460 
465  QVariant dataDefinedValue( QgsPalLayerSettings::DataDefinedProperties p, QgsFeature& f, const QgsFields& fields ) const;
466 
471  bool dataDefinedEvaluate( QgsPalLayerSettings::DataDefinedProperties p, QVariant& exprVal ) const;
472 
475  bool dataDefinedIsActive( QgsPalLayerSettings::DataDefinedProperties p ) const;
476 
479  bool dataDefinedUseExpression( QgsPalLayerSettings::DataDefinedProperties p ) const;
480 
483  QMap< QgsPalLayerSettings::DataDefinedProperties, QgsDataDefined* > dataDefinedProperties;
484 
485 
494  int sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
495 
505  double scaleToPixelContext( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
506 
511  QMap<QgsPalLayerSettings::DataDefinedProperties, QPair<QString, int> > dataDefinedNames() const { return mDataDefinedNames; }
512 
513  // temporary stuff: set when layer gets prepared or labeled
514  // NOTE: not in Python binding
521  QgsPoint ptZero, ptOne;
522  QList<QgsPalGeometry*> geometries;
524  int mFeaturesToLabel; // total features that will probably be labeled, may be less (figured before PAL)
525  int mFeatsSendingToPal; // total features tested for sending into PAL (relative to maxNumLabels)
526  int mFeatsRegPal; // number of features registered in PAL, when using limitNumLabels
527 
530 
531  bool showingShadowRects; // whether to show debug rectangles for drop shadows
532 
533  private:
534  void readDataDefinedPropertyMap( QgsVectorLayer* layer,
536  QgsDataDefined* > & propertyMap );
537  void writeDataDefinedPropertyMap( QgsVectorLayer* layer,
539  QgsDataDefined* > & propertyMap );
540  void readDataDefinedProperty( QgsVectorLayer* layer,
543  QgsDataDefined* > & propertyMap );
544 
545  // convenience data defined evaluation function
546  bool dataDefinedValEval( const QString& valType,
548  QVariant& exprVal );
549 
550  void parseTextStyle( QFont& labelFont,
552  const QgsRenderContext& context );
553 
554  void parseTextBuffer();
555 
556  void parseTextFormatting();
557 
558  void parseShapeBackground();
559 
560  void parseDropShadow();
561 
564  bool checkMinimumSizeMM( const QgsRenderContext& ct, QgsGeometry* geom, double minSize ) const;
565 
566 
567  QMap<DataDefinedProperties, QVariant> dataDefinedValues;
568  QgsExpression* expression;
569  QMap<QgsPalLayerSettings::DataDefinedProperties, QPair<QString, int> > mDataDefinedNames;
570 
571  QFontDatabase mFontDB;
572 };
573 
574 class CORE_EXPORT QgsLabelCandidate
575 {
576  public:
577  QgsLabelCandidate( QRectF r, double c ): rect( r ), cost( c ) {}
578 
579  QRectF rect;
580  double cost;
581 };
582 
587 class CORE_EXPORT QgsLabelComponent
588 {
589  public:
591  : mText( QString() )
592  , mOrigin( QgsPoint() )
593  , mUseOrigin( false )
594  , mRotation( 0.0 )
595  , mRotationOffset( 0.0 )
596  , mUseRotation( false )
597  , mCenter( QgsPoint() )
598  , mUseCenter( false )
599  , mSize( QgsPoint() )
600  , mOffset( QgsPoint() )
601  , mPicture( 0 )
602  , mPictureBuffer( 0.0 )
603  , mDpiRatio( 1.0 )
604  {}
605 
606  // methods
607 
608  const QString& text() { return mText; }
609  void setText( const QString& text ) { mText = text; }
610 
611  const QgsPoint& origin() { return mOrigin; }
612  void setOrigin( QgsPoint point ) { mOrigin = point; }
613 
614  bool useOrigin() const { return mUseOrigin; }
615  void setUseOrigin( bool use ) { mUseOrigin = use; }
616 
617  double rotation() const { return mRotation; }
618  void setRotation( double rotation ) { mRotation = rotation; }
619 
620  double rotationOffset() const { return mRotationOffset; }
621  void setRotationOffset( double rotation ) { mRotationOffset = rotation; }
622 
623  bool useRotation() const { return mUseRotation; }
624  void setUseRotation( bool use ) { mUseRotation = use; }
625 
626  const QgsPoint& center() { return mCenter; }
627  void setCenter( QgsPoint point ) { mCenter = point; }
628 
629  bool useCenter() const { return mUseCenter; }
630  void setUseCenter( bool use ) { mUseCenter = use; }
631 
632  const QgsPoint& size() { return mSize; }
633  void setSize( QgsPoint point ) { mSize = point; }
634 
635  const QgsPoint& offset() { return mOffset; }
636  void setOffset( QgsPoint point ) { mOffset = point; }
637 
638  const QPicture* picture() { return mPicture; }
639  void setPicture( QPicture* picture ) { mPicture = picture; }
640 
641  double pictureBuffer() const { return mPictureBuffer; }
642  void setPictureBuffer( double buffer ) { mPictureBuffer = buffer; }
643 
644  double dpiRatio() const { return mDpiRatio; }
645  void setDpiRatio( double ratio ) { mDpiRatio = ratio; }
646 
647  private:
648  // current label component text,
649  // e.g. single line in a multi-line label or charcater in curved labeling
650  QString mText;
651  // current origin point for painting (generally current painter rotation point)
652  QgsPoint mOrigin;
653  // whether to translate the painter to supplied origin
654  bool mUseOrigin;
655  // any rotation to be applied to painter (in radians)
656  double mRotation;
657  // any rotation to be applied to painter (in radians) after initial rotation
658  double mRotationOffset;
659  // whether to use the rotation to rotate the painter
660  bool mUseRotation;
661  // current center point of label compnent, after rotation
662  QgsPoint mCenter;
663  // whether to translate the painter to supplied origin based upon center
664  bool mUseCenter;
665  // width and height of label component, transformed and ready for painting
666  QgsPoint mSize;
667  // any translation offsets to be applied before painting, transformed and ready for painting
668  QgsPoint mOffset;
669 
670  // a stored QPicture of painting for the component
671  QPicture* mPicture;
672  // buffer for component to accommodate graphic items ignored by QPicture,
673  // e.g. half-width of an applied QPen, which would extend beyond boundingRect() of QPicture
674  double mPictureBuffer;
675 
676  // a ratio of native painter dpi and that of rendering context's painter
677  double mDpiRatio;
678 };
679 
680 
685 class CORE_EXPORT QgsLabelingResults
686 {
687  public:
690 
692  QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p ) const;
694  QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r ) const;
695 
696  private:
697  QgsLabelingResults( const QgsLabelingResults& ) {} // no copying allowed
698 
699  QgsLabelSearchTree* mLabelSearchTree;
700 
701  friend class QgsPalLabeling;
702 };
703 
705 class CORE_EXPORT QgsPalLabeling : public QgsLabelingEngineInterface
706 {
707  public:
709  {
710  LabelText = 0,
714  LabelShadow
715  };
716 
717  QgsPalLabeling();
718  ~QgsPalLabeling();
719 
720  QgsPalLayerSettings& layer( const QString& layerName );
721 
722  void numCandidatePositions( int& candPoint, int& candLine, int& candPolygon );
723  void setNumCandidatePositions( int candPoint, int candLine, int candPolygon );
724 
725  enum Search { Chain, Popmusic_Tabu, Popmusic_Chain, Popmusic_Tabu_Chain, Falp };
726 
727  void setSearchMethod( Search s );
728  Search searchMethod() const;
729 
730  bool isShowingCandidates() const { return mShowingCandidates; }
731  void setShowingCandidates( bool showing ) { mShowingCandidates = showing; }
732  const QList<QgsLabelCandidate>& candidates() { return mCandidates; }
733 
734  bool isShowingShadowRectangles() const { return mShowingShadowRects; }
735  void setShowingShadowRectangles( bool showing ) { mShowingShadowRects = showing; }
736 
737  bool isShowingAllLabels() const { return mShowingAllLabels; }
738  void setShowingAllLabels( bool showing ) { mShowingAllLabels = showing; }
739 
740  bool isShowingPartialsLabels() const { return mShowingPartialsLabels; }
741  void setShowingPartialsLabels( bool showing ) { mShowingPartialsLabels = showing; }
742 
744  bool isDrawingOutlineLabels() const { return mDrawOutlineLabels; }
745  void setDrawingOutlineLabels( bool outline ) { mDrawOutlineLabels = outline; }
746 
747  // implemented methods from labeling engine interface
748 
751  Q_DECL_DEPRECATED virtual void init( QgsMapRenderer* mr );
753  virtual void init( const QgsMapSettings& mapSettings );
755  virtual bool willUseLayer( QgsVectorLayer* layer );
756 
759  static bool staticWillUseLayer( QgsVectorLayer* layer );
760  static bool staticWillUseLayer( const QString& layerID );
761 
763  virtual void clearActiveLayers();
765  virtual void clearActiveLayer( const QString& layerID );
767  virtual int prepareLayer( QgsVectorLayer* layer, QStringList &attrNames, QgsRenderContext& ctx );
769  virtual int addDiagramLayer( QgsVectorLayer* layer, const QgsDiagramLayerSettings *s );
771  virtual void registerFeature( const QString& layerID, QgsFeature& feat, const QgsRenderContext& context = QgsRenderContext(), QString dxfLayer = QString::null );
772  virtual void registerDiagramFeature( const QString& layerID, QgsFeature& feat, const QgsRenderContext& context = QgsRenderContext() );
774  virtual void drawLabeling( QgsRenderContext& context );
776  virtual void exit();
777 
780  Q_DECL_DEPRECATED virtual QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p );
783  Q_DECL_DEPRECATED virtual QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r );
784 
787  QgsLabelingResults* takeResults();
788 
791 
793  void drawLabelCandidateRect( pal::LabelPosition* lp, QPainter* painter, const QgsMapToPixel* xform );
796  virtual void drawLabel( pal::LabelPosition* label, QgsRenderContext& context, QgsPalLayerSettings& tmpLyr, DrawLabelType drawType, double dpiRatio = 1.0 );
797 
798  static void drawLabelBuffer( QgsRenderContext& context,
799  QgsLabelComponent component,
800  const QgsPalLayerSettings& tmpLyr );
801 
802  static void drawLabelBackground( QgsRenderContext& context,
803  QgsLabelComponent component,
804  const QgsPalLayerSettings& tmpLyr );
805 
806  static void drawLabelShadow( QgsRenderContext& context,
807  QgsLabelComponent component,
808  const QgsPalLayerSettings& tmpLyr );
809 
811  void loadEngineSettings();
812  void saveEngineSettings();
813  void clearEngineSettings();
815  Q_DECL_DEPRECATED bool isStoredWithProject() const { return true; }
817  Q_DECL_DEPRECATED void setStoredWithProject( bool store ) { Q_UNUSED( store ); }
818 
819  protected:
820  // update temporary QgsPalLayerSettings with any data defined text style values
821  void dataDefinedTextStyle( QgsPalLayerSettings& tmpLyr,
822  const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant >& ddValues );
823 
824  // update temporary QgsPalLayerSettings with any data defined text formatting values
825  void dataDefinedTextFormatting( QgsPalLayerSettings& tmpLyr,
826  const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant >& ddValues );
827 
828  // update temporary QgsPalLayerSettings with any data defined text buffer values
829  void dataDefinedTextBuffer( QgsPalLayerSettings& tmpLyr,
830  const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant >& ddValues );
831 
832  // update temporary QgsPalLayerSettings with any data defined shape background values
833  void dataDefinedShapeBackground( QgsPalLayerSettings& tmpLyr,
834  const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant >& ddValues );
835 
836  // update temporary QgsPalLayerSettings with any data defined drop shadow values
837  void dataDefinedDropShadow( QgsPalLayerSettings& tmpLyr,
838  const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant >& ddValues );
839 
840  void deleteTemporaryData();
841 
842  // hashtable of layer settings, being filled during labeling (key = layer ID)
843  QHash<QString, QgsPalLayerSettings> mActiveLayers;
844  // hashtable of active diagram layers (key = layer ID)
845  QHash<QString, QgsDiagramLayerSettings> mActiveDiagramLayers;
847 
849  int mCandPoint, mCandLine, mCandPolygon;
851 
853 
854  // list of candidates from last labeling
855  QList<QgsLabelCandidate> mCandidates;
857  bool mShowingAllLabels; // whether to avoid collisions or not
858  bool mShowingShadowRects; // whether to show debugging rectangles for drop shadows
859  bool mShowingPartialsLabels; // whether to avoid partials labels or not
860  bool mDrawOutlineLabels; // whether to draw labels as text or outlines
861 
863 };
865 
866 
867 #endif // QGSPALLABELING_H