QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsdiagramrenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdiagramrenderer.h
3  ---------------------
4  begin : March 2011
5  copyright : (C) 2011 by Marco Hugentobler
6  email : marco dot hugentobler at sourcepole dot ch
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 QGSDIAGRAMRENDERER_H
16 #define QGSDIAGRAMRENDERER_H
17 
18 #include "qgis_core.h"
19 #include "qgis_sip.h"
20 #include <QColor>
21 #include <QFont>
22 #include <QList>
23 #include <QPointF>
24 #include <QSizeF>
25 #include <QDomDocument>
26 
27 #include "qgsexpressioncontext.h"
28 #include "qgsfields.h"
29 #include "qgscoordinatetransform.h"
30 #include "qgssymbol.h"
31 #include "qgsproperty.h"
32 #include "qgspropertycollection.h"
33 
34 #include "diagram/qgsdiagram.h"
35 #include "qgsreadwritecontext.h"
36 
37 class QgsDiagramRenderer;
38 class QgsFeature;
39 class QgsRenderContext;
40 class QDomElement;
41 class QgsMapToPixel;
43 class QgsVectorLayer;
45 class QgsLayerTreeLayer;
46 class QgsPaintEffect;
48 
49 namespace pal { class Layer; } SIP_SKIP
50 
60 class CORE_EXPORT QgsDiagramLayerSettings
61 {
62  public:
63 
64  //avoid inclusion of QgsPalLabeling
65  enum Placement
66  {
67  AroundPoint = 0, // Point / Polygon
68  OverPoint, // Point / Polygon
69  Line, // Line / Polygon
70  Curved, // Line
71  Horizontal, // Polygon
72  Free // Polygon
73  };
74 
77  {
78  OnLine = 1,
79  AboveLine = 1 << 1,
80  BelowLine = 1 << 2,
81  MapOrientation = 1 << 4,
82  };
83  Q_DECLARE_FLAGS( LinePlacementFlags, LinePlacementFlag )
84 
85 
89  enum Property
90  {
103  };
104 
109  static const QgsPropertiesDefinition &propertyDefinitions();
110 
115 
118 
119  QgsDiagramLayerSettings &operator=( const QgsDiagramLayerSettings &rh );
120 
122 
128  Placement placement() const { return mPlacement; }
129 
136  void setPlacement( Placement value ) { mPlacement = value; }
137 
144  LinePlacementFlags linePlacementFlags() const { return mPlacementFlags; }
145 
153  void setLinePlacementFlags( LinePlacementFlags flags ) { mPlacementFlags = flags; }
154 
163  int priority() const { return mPriority; }
164 
171  void setPriority( int value ) { mPriority = value; }
172 
181  double zIndex() const { return mZIndex; }
182 
190  void setZIndex( double index ) { mZIndex = index; }
191 
197  bool isObstacle() const { return mObstacle; }
198 
205  void setIsObstacle( bool isObstacle ) { mObstacle = isObstacle; }
206 
212  double distance() const { return mDistance; }
213 
220  void setDistance( double distance ) { mDistance = distance; }
221 
227  QgsDiagramRenderer *renderer() { return mRenderer; }
228 
235  const QgsDiagramRenderer *renderer() const { return mRenderer; } SIP_SKIP
236 
243  void setRenderer( QgsDiagramRenderer *diagramRenderer SIP_TRANSFER );
244 
252 
259  void setCoordinateTransform( const QgsCoordinateTransform &transform );
260 
266  bool showAllDiagrams() const { return mShowAll; }
267 
274  void setShowAllDiagrams( bool showAllDiagrams ) { mShowAll = showAllDiagrams; }
275 
280  void readXml( const QDomElement &elem );
281 
286  void writeXml( QDomElement &layerElem, QDomDocument &doc ) const;
287 
294  bool prepare( const QgsExpressionContext &context = QgsExpressionContext() ) const;
295 
301  QSet< QString > referencedFields( const QgsExpressionContext &context = QgsExpressionContext() ) const;
302 
308  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
309 
317  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
318 
326  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
327 
328  private:
329 
332 
334  Placement mPlacement = AroundPoint;
335 
337  LinePlacementFlags mPlacementFlags = OnLine;
338 
344  int mPriority = 5;
345 
347  double mZIndex = 0.0;
348 
350  bool mObstacle = false;
351 
353  double mDistance = 0.0;
354 
356  QgsDiagramRenderer *mRenderer = nullptr;
357 
359  bool mShowAll = true;
360 
362  QgsPropertyCollection mDataDefinedProperties;
363 
364  static void initPropertyDefinitions();
365 
367  static QgsPropertiesDefinition sPropertyDefinitions;
368 
369 };
370 
380 class CORE_EXPORT QgsDiagramSettings
381 {
382  public:
383 
385  {
387  XHeight
388  };
389 
392  {
393  Up,
396  Right
397  };
398 
404  {
407  };
408 
412 
414  QgsDiagramSettings( const QgsDiagramSettings &other );
415 
416  QgsDiagramSettings &operator=( const QgsDiagramSettings &other );
417 
418  bool enabled = true;
419  QFont font;
420  QList< QColor > categoryColors;
421  QList< QString > categoryAttributes;
423  QList< QString > categoryLabels;
424  QSizeF size; //size
425 
430 
436 
442 
448 
450  QColor penColor;
451  double penWidth = 0.0;
454  double barWidth = 5.0;
455 
457  double opacity = 1.0;
458 
459  bool scaleByArea = true;
460 
465  double rotationOffset = 270;
466 
467  bool scaleBasedVisibility = false;
468 
475  double maximumScale = 0;
476 
483  double minimumScale = 0;
484 
486  double minimumSize = 0.0;
487 
499  double spacing() const { return mSpacing; }
500 
512  void setSpacing( double spacing ) { mSpacing = spacing; }
513 
522  void setSpacingUnit( QgsUnitTypes::RenderUnit unit ) { mSpacingUnit = unit; }
523 
531  QgsUnitTypes::RenderUnit spacingUnit() const { return mSpacingUnit; }
532 
541  void setSpacingMapUnitScale( const QgsMapUnitScale &scale ) { mSpacingMapUnitScale = scale; }
542 
551  const QgsMapUnitScale &spacingMapUnitScale() const { return mSpacingMapUnitScale; }
552 
559  Direction direction() const;
560 
567  void setDirection( Direction direction );
568 
570  void readXml( const QDomElement &elem, const QgsReadWriteContext &context = QgsReadWriteContext() );
572  void writeXml( QDomElement &rendererElem, QDomDocument &doc, const QgsReadWriteContext &context = QgsReadWriteContext() ) const;
573 
579  QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const SIP_FACTORY;
580 
589  QgsLineSymbol *axisLineSymbol() const;
590 
601  void setAxisLineSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
602 
611  bool showAxis() const;
612 
621  void setShowAxis( bool showAxis );
622 
630  QgsPaintEffect *paintEffect() const;
631 
641  void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
642 
643  private:
644 
645  double mSpacing = 0;
647  QgsMapUnitScale mSpacingMapUnitScale;
648  Direction mDirection = Counterclockwise;
649 
650  bool mShowAxis = false;
651  std::unique_ptr< QgsLineSymbol > mAxisLineSymbol;
652  std::unique_ptr< QgsPaintEffect > mPaintEffect;
653 
654 };
655 
662 {
663  public:
664  QSizeF lowerSize;
665  QSizeF upperSize;
666  double lowerValue;
667  double upperValue;
668 
671 
674 };
675 
676 
683 class CORE_EXPORT QgsDiagramRenderer
684 {
685 
686 #ifdef SIP_RUN
688  if ( sipCpp->rendererName() == QStringLiteral( "SingleCategory" ) )
689  sipType = sipType_QgsSingleCategoryDiagramRenderer;
690  else if ( sipCpp->rendererName() == QStringLiteral( "LinearlyInterpolated" ) )
691  sipType = sipType_QgsLinearlyInterpolatedDiagramRenderer;
692  else
693  sipType = NULL;
694  SIP_END
695 #endif
696 
697  public:
698 
702  QgsDiagramRenderer() = default;
703  virtual ~QgsDiagramRenderer() = default;
704 
708  virtual QgsDiagramRenderer *clone() const = 0 SIP_FACTORY;
709 
711  virtual QSizeF sizeMapUnits( const QgsFeature &feature, const QgsRenderContext &c ) const;
712 
713  virtual QString rendererName() const = 0;
714 
716  virtual QList<QString> diagramAttributes() const = 0;
717 
723  virtual QSet< QString > referencedFields( const QgsExpressionContext &context = QgsExpressionContext() ) const;
724 
728  void renderDiagram( const QgsFeature &feature, QgsRenderContext &c, QPointF pos, const QgsPropertyCollection &properties = QgsPropertyCollection() ) const;
729 
730  void setDiagram( QgsDiagram *d SIP_TRANSFER );
731  QgsDiagram *diagram() const { return mDiagram.get(); }
732 
734  virtual QList<QgsDiagramSettings> diagramSettings() const = 0;
735 
741  virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) = 0;
742 
748  virtual void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsReadWriteContext &context ) const = 0;
749 
755  virtual QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const SIP_FACTORY;
756 
762  bool attributeLegend() const { return mShowAttributeLegend; }
763 
770  void setAttributeLegend( bool enabled ) { mShowAttributeLegend = enabled; }
771 
772  protected:
773  QgsDiagramRenderer( const QgsDiagramRenderer &other );
774  QgsDiagramRenderer &operator=( const QgsDiagramRenderer &other );
775 
782  virtual bool diagramSettings( const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s ) const = 0;
783 
785  virtual QSizeF diagramSize( const QgsFeature &features, const QgsRenderContext &c ) const = 0;
786 
788  void convertSizeToMapUnits( QSizeF &size, const QgsRenderContext &context ) const;
789 
791  static int dpiPaintDevice( const QPainter * );
792 
793  //read / write diagram
794 
799  void _readXml( const QDomElement &elem, const QgsReadWriteContext &context );
800 
805  void _writeXml( QDomElement &rendererElem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
806 
808  std::unique_ptr< QgsDiagram > mDiagram;
809 
811  bool mShowAttributeLegend = true;
812 };
813 
819 {
820  public:
821 
824 
826 
827  QString rendererName() const override { return QStringLiteral( "SingleCategory" ); }
828 
829  QList<QString> diagramAttributes() const override { return mSettings.categoryAttributes; }
830 
831  void setDiagramSettings( const QgsDiagramSettings &s ) { mSettings = s; }
832 
833  QList<QgsDiagramSettings> diagramSettings() const override;
834 
835  void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
836  void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsReadWriteContext &context ) const override;
837 
838  QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const override SIP_FACTORY;
839 
840  protected:
841  bool diagramSettings( const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s ) const override;
842 
843  QSizeF diagramSize( const QgsFeature &, const QgsRenderContext &c ) const override;
844 
845  private:
846  QgsDiagramSettings mSettings;
847 };
848 
854 {
855  public:
858 
860 
862  QList<QgsDiagramSettings> diagramSettings() const override;
863 
864  void setDiagramSettings( const QgsDiagramSettings &s ) { mSettings = s; }
865 
866  QList<QString> diagramAttributes() const override;
867 
868  QSet< QString > referencedFields( const QgsExpressionContext &context = QgsExpressionContext() ) const override;
869 
870  QString rendererName() const override { return QStringLiteral( "LinearlyInterpolated" ); }
871 
872  void setLowerValue( double val ) { mInterpolationSettings.lowerValue = val; }
873  double lowerValue() const { return mInterpolationSettings.lowerValue; }
874 
875  void setUpperValue( double val ) { mInterpolationSettings.upperValue = val; }
876  double upperValue() const { return mInterpolationSettings.upperValue; }
877 
878  void setLowerSize( QSizeF s ) { mInterpolationSettings.lowerSize = s; }
879  QSizeF lowerSize() const { return mInterpolationSettings.lowerSize; }
880 
881  void setUpperSize( QSizeF s ) { mInterpolationSettings.upperSize = s; }
882  QSizeF upperSize() const { return mInterpolationSettings.upperSize; }
883 
889  QString classificationField() const { return mInterpolationSettings.classificationField; }
890 
896  void setClassificationField( const QString &field ) { mInterpolationSettings.classificationField = field; }
897 
898  QString classificationAttributeExpression() const { return mInterpolationSettings.classificationAttributeExpression; }
899  void setClassificationAttributeExpression( const QString &expression ) { mInterpolationSettings.classificationAttributeExpression = expression; }
900 
901  bool classificationAttributeIsExpression() const { return mInterpolationSettings.classificationAttributeIsExpression; }
902  void setClassificationAttributeIsExpression( bool isExpression ) { mInterpolationSettings.classificationAttributeIsExpression = isExpression; }
903 
904  void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
905  void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsReadWriteContext &context ) const override;
906 
907  QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const override SIP_FACTORY;
908 
913  void setDataDefinedSizeLegend( QgsDataDefinedSizeLegend *settings SIP_TRANSFER );
914 
919  QgsDataDefinedSizeLegend *dataDefinedSizeLegend() const;
920 
921  protected:
922  bool diagramSettings( const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s ) const override;
923 
924  QSizeF diagramSize( const QgsFeature &, const QgsRenderContext &c ) const override;
925 
928 
929  private:
930  QgsDiagramSettings mSettings;
931  QgsDiagramInterpolationSettings mInterpolationSettings;
932 
934  QgsDataDefinedSizeLegend *mDataDefinedSizeLegend = nullptr;
935 
937 };
938 
939 #endif // QGSDIAGRAMRENDERER_H
QgsDiagramSettings::backgroundColor
QColor backgroundColor
Definition: qgsdiagramrenderer.h:449
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:369
QgsDiagramLayerSettings::showAllDiagrams
bool showAllDiagrams() const
Returns whether the layer should show all diagrams, including overlapping diagrams.
Definition: qgsdiagramrenderer.h:266
QgsDiagramInterpolationSettings::upperSize
QSizeF upperSize
Definition: qgsdiagramrenderer.h:665
qgsfields.h
QgsLinearlyInterpolatedDiagramRenderer::upperValue
double upperValue() const
Definition: qgsdiagramrenderer.h:876
QgsDiagramLayerSettings::isObstacle
bool isObstacle() const
Returns whether the feature associated with a diagram acts as an obstacle for other labels or diagram...
Definition: qgsdiagramrenderer.h:197
QgsDiagram
Definition: qgsdiagram.h:38
QgsLinearlyInterpolatedDiagramRenderer::upperSize
QSizeF upperSize() const
Definition: qgsdiagramrenderer.h:882
QgsDiagramLayerSettings::StartAngle
@ StartAngle
Angle offset for pie diagram.
Definition: qgsdiagramrenderer.h:102
QgsLinearlyInterpolatedDiagramRenderer::lowerValue
double lowerValue() const
Definition: qgsdiagramrenderer.h:873
QgsDiagramRenderer::mDiagram
std::unique_ptr< QgsDiagram > mDiagram
Reference to the object that does the real diagram rendering.
Definition: qgsdiagramrenderer.h:808
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:166
QgsDiagramLayerSettings::coordinateTransform
QgsCoordinateTransform coordinateTransform() const
Returns the coordinate transform associated with the layer, or an invalid transform if no transformat...
Definition: qgsdiagramrenderer.h:251
QgsLinearlyInterpolatedDiagramRenderer::classificationAttributeExpression
QString classificationAttributeExpression() const
Definition: qgsdiagramrenderer.h:898
QgsReadWriteContext
Definition: qgsreadwritecontext.h:34
QgsDiagramLayerSettings::priority
int priority() const
Returns the diagram priority.
Definition: qgsdiagramrenderer.h:163
QgsDiagramLayerSettings::OverPoint
@ OverPoint
Definition: qgsdiagramrenderer.h:68
QgsDiagramSettings::setSpacingMapUnitScale
void setSpacingMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the content spacing.
Definition: qgsdiagramrenderer.h:541
QgsDiagramLayerSettings::renderer
QgsDiagramRenderer * renderer()
Returns the diagram renderer associated with the layer.
Definition: qgsdiagramrenderer.h:227
QgsDiagramLayerSettings::dataDefinedProperties
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the diagram's property collection, used for data defined overrides.
Definition: qgsdiagramrenderer.h:308
QgsDiagramInterpolationSettings::lowerValue
double lowerValue
Definition: qgsdiagramrenderer.h:666
QgsSingleCategoryDiagramRenderer::diagramAttributes
QList< QString > diagramAttributes() const override
Returns attribute indices needed for diagram rendering.
Definition: qgsdiagramrenderer.h:829
QgsDiagramSettings::categoryColors
QList< QColor > categoryColors
Definition: qgsdiagramrenderer.h:420
QgsLinearlyInterpolatedDiagramRenderer::classificationField
QString classificationField() const
Returns the field name used for interpolating the diagram size.
Definition: qgsdiagramrenderer.h:889
QgsDiagramSettings::penColor
QColor penColor
Definition: qgsdiagramrenderer.h:450
qgsreadwritecontext.h
QgsDiagramSettings::Clockwise
@ Clockwise
Clockwise orientation.
Definition: qgsdiagramrenderer.h:405
QgsDiagramSettings::Up
@ Up
Definition: qgsdiagramrenderer.h:393
QgsDiagramRenderer::referencedFields
virtual QSet< QString > referencedFields(const QgsExpressionContext &context=QgsExpressionContext()) const
Returns the set of any fields required for diagram rendering.
Definition: qgsdiagramrenderer.cpp:513
QgsDiagramLayerSettings::setZIndex
void setZIndex(double index)
Sets the diagram z-index.
Definition: qgsdiagramrenderer.h:190
QgsDataDefinedSizeLegend
Definition: qgsdatadefinedsizelegend.h:41
QgsRenderContext
Definition: qgsrendercontext.h:57
QgsDiagramLayerSettings::setDataDefinedProperties
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the diagram's property collection, used for data defined overrides.
Definition: qgsdiagramrenderer.h:326
QgsDiagramLayerSettings::Placement
Placement
Definition: qgsdiagramrenderer.h:65
QgsUnitTypes::RenderMillimeters
@ RenderMillimeters
Millimeters.
Definition: qgsunittypes.h:168
qgsdiagram.h
QgsDiagramRenderer::setAttributeLegend
void setAttributeLegend(bool enabled)
Sets whether the renderer will show legend items for diagram attributes.
Definition: qgsdiagramrenderer.h:770
QgsDiagramSettings::spacingMapUnitScale
const QgsMapUnitScale & spacingMapUnitScale() const
Returns the map unit scale for the content spacing.
Definition: qgsdiagramrenderer.h:551
QgsDiagramInterpolationSettings::classificationField
QString classificationField
Name of the field for classification.
Definition: qgsdiagramrenderer.h:670
QgsDiagramLayerSettings::Show
@ Show
Whether to show the diagram.
Definition: qgsdiagramrenderer.h:100
QgsDiagramSettings::Down
@ Down
Definition: qgsdiagramrenderer.h:394
pal
Definition: qgsdiagramrenderer.h:49
QgsDiagramLayerSettings::PositionY
@ PositionY
Y-coordinate data defined diagram position.
Definition: qgsdiagramrenderer.h:95
QgsLinearlyInterpolatedDiagramRenderer::setLowerValue
void setLowerValue(double val)
Definition: qgsdiagramrenderer.h:872
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsDiagramInterpolationSettings::upperValue
double upperValue
Definition: qgsdiagramrenderer.h:667
QgsSingleCategoryDiagramRenderer::rendererName
QString rendererName() const override
Definition: qgsdiagramrenderer.h:827
QgsDiagramLayerSettings::ZIndex
@ ZIndex
Z-index for diagram ordering.
Definition: qgsdiagramrenderer.h:98
QgsDiagramSettings::DiagramOrientation
DiagramOrientation
Orientation of histogram.
Definition: qgsdiagramrenderer.h:391
QgsDiagramSettings::spacing
double spacing() const
Returns the spacing between diagram contents.
Definition: qgsdiagramrenderer.h:499
QgsLinearlyInterpolatedDiagramRenderer::setClassificationField
void setClassificationField(const QString &field)
Sets the field name used for interpolating the diagram size.
Definition: qgsdiagramrenderer.h:896
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
QgsDiagramLayerSettings::Line
@ Line
Definition: qgsdiagramrenderer.h:69
QgsDiagramLayerSettings::setShowAllDiagrams
void setShowAllDiagrams(bool showAllDiagrams)
Sets whether the layer should show all diagrams, including overlapping diagrams.
Definition: qgsdiagramrenderer.h:274
QgsPropertiesDefinition
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
Definition: qgspropertycollection.h:29
QgsLinearlyInterpolatedDiagramRenderer::setDiagramSettings
void setDiagramSettings(const QgsDiagramSettings &s)
Definition: qgsdiagramrenderer.h:864
QgsDiagramRenderer::diagramAttributes
virtual QList< QString > diagramAttributes() const =0
Returns attribute indices needed for diagram rendering.
qgsexpressioncontext.h
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsLinearlyInterpolatedDiagramRenderer::setUpperSize
void setUpperSize(QSizeF s)
Definition: qgsdiagramrenderer.h:881
QgsDiagramInterpolationSettings::lowerSize
QSizeF lowerSize
Definition: qgsdiagramrenderer.h:664
QgsLinearlyInterpolatedDiagramRenderer::rendererName
QString rendererName() const override
Definition: qgsdiagramrenderer.h:870
QgsLinearlyInterpolatedDiagramRenderer::classificationAttributeIsExpression
bool classificationAttributeIsExpression() const
Definition: qgsdiagramrenderer.h:901
QgsDiagramLayerSettings::dataDefinedProperties
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the diagram's property collection, used for data defined overrides.
Definition: qgsdiagramrenderer.h:317
QgsDiagramRenderer::legendItems
virtual QList< QgsLayerTreeModelLegendNode * > legendItems(QgsLayerTreeLayer *nodeLayer) const
Returns list of legend nodes for the diagram.
Definition: qgsdiagramrenderer.cpp:923
QgsDiagramLayerSettings::Distance
@ Distance
Distance to diagram from feature.
Definition: qgsdiagramrenderer.h:96
QgsDiagramLayerSettings::renderer
const QgsDiagramRenderer * renderer() const
Returns the diagram renderer associated with the layer.
Definition: qgsdiagramrenderer.h:235
QgsDiagramSettings::Left
@ Left
Definition: qgsdiagramrenderer.h:395
QgsLinearlyInterpolatedDiagramRenderer::setClassificationAttributeExpression
void setClassificationAttributeExpression(const QString &expression)
Definition: qgsdiagramrenderer.h:899
QgsDiagramSettings::LabelPlacementMethod
LabelPlacementMethod
Definition: qgsdiagramrenderer.h:384
QgsLayerTreeLayer
Definition: qgslayertreelayer.h:43
qgis_sip.h
QgsLinearlyInterpolatedDiagramRenderer::setClassificationAttributeIsExpression
void setClassificationAttributeIsExpression(bool isExpression)
Definition: qgsdiagramrenderer.h:902
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsLineSymbol
Definition: qgssymbol.h:1117
QgsDiagramLayerSettings
Stores the settings for rendering of all diagrams for a layer.
Definition: qgsdiagramrenderer.h:60
QgsDiagramRenderer::clone
virtual QgsDiagramRenderer * clone() const =0
Returns new instance that is equivalent to this one.
QgsDiagramLayerSettings::Curved
@ Curved
Definition: qgsdiagramrenderer.h:70
qgscoordinatetransform.h
QgsDiagramRenderer::attributeLegend
bool attributeLegend() const
Returns true if renderer will show legend items for diagram attributes.
Definition: qgsdiagramrenderer.h:762
QgsDiagramRenderer
Evaluates and returns the diagram settings relating to a diagram for a specific feature.
Definition: qgsdiagramrenderer.h:683
QgsDiagramSettings::Counterclockwise
@ Counterclockwise
Counter-clockwise orientation.
Definition: qgsdiagramrenderer.h:406
QgsDiagramLayerSettings::BackgroundColor
@ BackgroundColor
Diagram background color.
Definition: qgsdiagramrenderer.h:91
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:37
QgsDiagramSettings::Height
@ Height
Definition: qgsdiagramrenderer.h:386
QgsDiagramRenderer::diagramSettings
virtual QList< QgsDiagramSettings > diagramSettings() const =0
Returns list with all diagram settings in the renderer.
QgsLinearlyInterpolatedDiagramRenderer::setUpperValue
void setUpperValue(double val)
Definition: qgsdiagramrenderer.h:875
QgsDiagramInterpolationSettings
Definition: qgsdiagramrenderer.h:661
QgsDiagramRenderer::diagram
QgsDiagram * diagram() const
Definition: qgsdiagramrenderer.h:731
QgsDiagramRenderer::writeXml
virtual void writeXml(QDomElement &layerElem, QDomDocument &doc, const QgsReadWriteContext &context) const =0
Writes diagram state to a DOM element.
QgsDiagramLayerSettings::placement
Placement placement() const
Returns the diagram placement.
Definition: qgsdiagramrenderer.h:128
QgsDiagramLayerSettings::zIndex
double zIndex() const
Returns the diagram z-index.
Definition: qgsdiagramrenderer.h:181
QgsDiagramInterpolationSettings::classificationAttributeIsExpression
bool classificationAttributeIsExpression
Definition: qgsdiagramrenderer.h:673
QgsLinearlyInterpolatedDiagramRenderer
Definition: qgsdiagramrenderer.h:853
QgsSingleCategoryDiagramRenderer::setDiagramSettings
void setDiagramSettings(const QgsDiagramSettings &s)
Definition: qgsdiagramrenderer.h:831
QgsDiagramSettings::lineSizeScale
QgsMapUnitScale lineSizeScale
Line unit scale.
Definition: qgsdiagramrenderer.h:447
QgsDiagramSettings::categoryLabels
QList< QString > categoryLabels
Definition: qgsdiagramrenderer.h:423
QgsDiagramSettings::size
QSizeF size
Definition: qgsdiagramrenderer.h:424
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Definition: qgspropertycollection.h:318
QgsSingleCategoryDiagramRenderer
Definition: qgsdiagramrenderer.h:818
QgsDiagramSettings::setSpacingUnit
void setSpacingUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the content spacing.
Definition: qgsdiagramrenderer.h:522
QgsDiagramLayerSettings::linePlacementFlags
LinePlacementFlags linePlacementFlags() const
Returns the diagram placement flags.
Definition: qgsdiagramrenderer.h:144
QgsDiagramLayerSettings::StrokeColor
@ StrokeColor
Stroke color.
Definition: qgsdiagramrenderer.h:92
QgsDiagramLayerSettings::LinePlacementFlag
LinePlacementFlag
Line placement flags for controlling line based placements.
Definition: qgsdiagramrenderer.h:76
QgsDiagramSettings::font
QFont font
Definition: qgsdiagramrenderer.h:419
QgsDiagramLayerSettings::Horizontal
@ Horizontal
Definition: qgsdiagramrenderer.h:71
c
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
Definition: porting_processing.dox:1
QgsDiagramRenderer::readXml
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context)=0
Reads diagram state from a DOM element.
QgsDiagramSettings::sizeScale
QgsMapUnitScale sizeScale
Diagram size unit scale.
Definition: qgsdiagramrenderer.h:435
QgsMapToPixel
Definition: qgsmaptopixel.h:37
QgsDiagramLayerSettings::distance
double distance() const
Returns the distance between the diagram and the feature (in mm).
Definition: qgsdiagramrenderer.h:212
QgsVectorLayer
Definition: qgsvectorlayer.h:385
QgsDiagramSettings::setSpacing
void setSpacing(double spacing)
Sets the spacing between diagram contents.
Definition: qgsdiagramrenderer.h:512
QgsDiagramLayerSettings::setLinePlacementFlags
void setLinePlacementFlags(LinePlacementFlags flags)
Sets the the diagram placement flags.
Definition: qgsdiagramrenderer.h:153
QgsPaintEffect
Base class for visual effects which can be applied to QPicture drawings.
Definition: qgspainteffect.h:53
qgsproperty.h
qgspropertycollection.h
QgsDiagramSettings::Direction
Direction
Angular directions.
Definition: qgsdiagramrenderer.h:403
pal::Layer
A set of features which influence the labeling process.
Definition: layer.h:61
QgsDiagramLayerSettings::setPriority
void setPriority(int value)
Sets the diagram priority.
Definition: qgsdiagramrenderer.h:171
QgsDiagramLayerSettings::setPlacement
void setPlacement(Placement value)
Sets the diagram placement.
Definition: qgsdiagramrenderer.h:136
QgsDiagramLayerSettings::setDistance
void setDistance(double distance)
Sets the distance between the diagram and the feature.
Definition: qgsdiagramrenderer.h:220
QgsFeature
Definition: qgsfeature.h:55
QgsDiagramLayerSettings::AlwaysShow
@ AlwaysShow
Whether the diagram should always be shown, even if it overlaps other diagrams/labels.
Definition: qgsdiagramrenderer.h:101
QgsDiagramLayerSettings::PositionX
@ PositionX
X-coordinate data defined diagram position.
Definition: qgsdiagramrenderer.h:94
QgsCoordinateTransform
Definition: qgscoordinatetransform.h:52
QgsDiagramLayerSettings::Property
Property
Data definable properties.
Definition: qgsdiagramrenderer.h:89
SIP_END
#define SIP_END
Definition: qgis_sip.h:189
QgsDiagramSettings::spacingUnit
QgsUnitTypes::RenderUnit spacingUnit() const
Returns the units for the content spacing.
Definition: qgsdiagramrenderer.h:531
QgsDiagramLayerSettings::StrokeWidth
@ StrokeWidth
Stroke width.
Definition: qgsdiagramrenderer.h:93
QgsDiagramRenderer::diagramSize
virtual QSizeF diagramSize(const QgsFeature &features, const QgsRenderContext &c) const =0
Returns size of the diagram (in painter units) or an invalid size in case of error.
QgsDiagramSettings::categoryAttributes
QList< QString > categoryAttributes
Definition: qgsdiagramrenderer.h:421
QgsDiagramLayerSettings::IsObstacle
@ IsObstacle
Whether diagram features act as obstacles for other diagrams/labels.
Definition: qgsdiagramrenderer.h:99
qgssymbol.h
QgsDiagramLayerSettings::setIsObstacle
void setIsObstacle(bool isObstacle)
Sets whether the feature associated with a diagram acts as an obstacle for other labels or diagrams.
Definition: qgsdiagramrenderer.h:205
QgsDiagramLayerSettings::Priority
@ Priority
Diagram priority (between 0 and 10)
Definition: qgsdiagramrenderer.h:97
QgsLinearlyInterpolatedDiagramRenderer::lowerSize
QSizeF lowerSize() const
Definition: qgsdiagramrenderer.h:879
QgsDiagramRenderer::operator=
QgsDiagramRenderer & operator=(const QgsDiagramRenderer &other)
Definition: qgsdiagramrenderer.cpp:453
QgsDiagramInterpolationSettings::classificationAttributeExpression
QString classificationAttributeExpression
Definition: qgsdiagramrenderer.h:672
QgsDiagramSettings
Stores the settings for rendering a single diagram.
Definition: qgsdiagramrenderer.h:380
QgsLinearlyInterpolatedDiagramRenderer::setLowerSize
void setLowerSize(QSizeF s)
Definition: qgsdiagramrenderer.h:878
QgsLayerTreeModelLegendNode
Definition: qgslayertreemodellegendnode.h:50