QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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() == QLatin1String( "SingleCategory" ) )
689  sipType = sipType_QgsSingleCategoryDiagramRenderer;
690  else if ( sipCpp->rendererName() == QLatin1String( "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 
709  virtual QgsDiagramRenderer *clone() const = 0 SIP_FACTORY;
710 
712  virtual QSizeF sizeMapUnits( const QgsFeature &feature, const QgsRenderContext &c ) const;
713 
714  virtual QString rendererName() const = 0;
715 
717  virtual QList<QString> diagramAttributes() const = 0;
718 
724  virtual QSet< QString > referencedFields( const QgsExpressionContext &context = QgsExpressionContext() ) const;
725 
729  void renderDiagram( const QgsFeature &feature, QgsRenderContext &c, QPointF pos, const QgsPropertyCollection &properties = QgsPropertyCollection() ) const;
730 
731  void setDiagram( QgsDiagram *d SIP_TRANSFER );
732  QgsDiagram *diagram() const { return mDiagram.get(); }
733 
735  virtual QList<QgsDiagramSettings> diagramSettings() const = 0;
736 
742  virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) = 0;
743 
749  virtual void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsReadWriteContext &context ) const = 0;
750 
756  virtual QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const SIP_FACTORY;
757 
763  bool attributeLegend() const { return mShowAttributeLegend; }
764 
771  void setAttributeLegend( bool enabled ) { mShowAttributeLegend = enabled; }
772 
773  protected:
774  QgsDiagramRenderer( const QgsDiagramRenderer &other );
775  QgsDiagramRenderer &operator=( const QgsDiagramRenderer &other );
776 
783  virtual bool diagramSettings( const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s ) const = 0;
784 
786  virtual QSizeF diagramSize( const QgsFeature &features, const QgsRenderContext &c ) const = 0;
787 
789  void convertSizeToMapUnits( QSizeF &size, const QgsRenderContext &context ) const;
790 
792  static int dpiPaintDevice( const QPainter * );
793 
794  //read / write diagram
795 
800  void _readXml( const QDomElement &elem, const QgsReadWriteContext &context );
801 
806  void _writeXml( QDomElement &rendererElem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
807 
809  std::unique_ptr< QgsDiagram > mDiagram;
810 
812  bool mShowAttributeLegend = true;
813 };
814 
820 {
821  public:
822 
825 
827 
828  QString rendererName() const override { return QStringLiteral( "SingleCategory" ); }
829 
830  QList<QString> diagramAttributes() const override { return mSettings.categoryAttributes; }
831 
832  void setDiagramSettings( const QgsDiagramSettings &s ) { mSettings = s; }
833 
834  QList<QgsDiagramSettings> diagramSettings() const override;
835 
836  void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
837  void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsReadWriteContext &context ) const override;
838 
839  QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const override SIP_FACTORY;
840 
841  protected:
842  bool diagramSettings( const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s ) const override;
843 
844  QSizeF diagramSize( const QgsFeature &, const QgsRenderContext &c ) const override;
845 
846  private:
847  QgsDiagramSettings mSettings;
848 };
849 
855 {
856  public:
859 
861 
863  QList<QgsDiagramSettings> diagramSettings() const override;
864 
865  void setDiagramSettings( const QgsDiagramSettings &s ) { mSettings = s; }
866 
867  QList<QString> diagramAttributes() const override;
868 
869  QSet< QString > referencedFields( const QgsExpressionContext &context = QgsExpressionContext() ) const override;
870 
871  QString rendererName() const override { return QStringLiteral( "LinearlyInterpolated" ); }
872 
873  void setLowerValue( double val ) { mInterpolationSettings.lowerValue = val; }
874  double lowerValue() const { return mInterpolationSettings.lowerValue; }
875 
876  void setUpperValue( double val ) { mInterpolationSettings.upperValue = val; }
877  double upperValue() const { return mInterpolationSettings.upperValue; }
878 
879  void setLowerSize( QSizeF s ) { mInterpolationSettings.lowerSize = s; }
880  QSizeF lowerSize() const { return mInterpolationSettings.lowerSize; }
881 
882  void setUpperSize( QSizeF s ) { mInterpolationSettings.upperSize = s; }
883  QSizeF upperSize() const { return mInterpolationSettings.upperSize; }
884 
890  QString classificationField() const { return mInterpolationSettings.classificationField; }
891 
897  void setClassificationField( const QString &field ) { mInterpolationSettings.classificationField = field; }
898 
899  QString classificationAttributeExpression() const { return mInterpolationSettings.classificationAttributeExpression; }
900  void setClassificationAttributeExpression( const QString &expression ) { mInterpolationSettings.classificationAttributeExpression = expression; }
901 
902  bool classificationAttributeIsExpression() const { return mInterpolationSettings.classificationAttributeIsExpression; }
903  void setClassificationAttributeIsExpression( bool isExpression ) { mInterpolationSettings.classificationAttributeIsExpression = isExpression; }
904 
905  void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
906  void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsReadWriteContext &context ) const override;
907 
908  QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const override SIP_FACTORY;
909 
914  void setDataDefinedSizeLegend( QgsDataDefinedSizeLegend *settings SIP_TRANSFER );
915 
920  QgsDataDefinedSizeLegend *dataDefinedSizeLegend() const;
921 
922  protected:
923  bool diagramSettings( const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s ) const override;
924 
925  QSizeF diagramSize( const QgsFeature &, const QgsRenderContext &c ) const override;
926 
929 
930  private:
931  QgsDiagramSettings mSettings;
932  QgsDiagramInterpolationSettings mInterpolationSettings;
933 
935  QgsDataDefinedSizeLegend *mDataDefinedSizeLegend = nullptr;
936 
938 };
939 
940 #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:370
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:877
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
Base class for all diagram types.
Definition: qgsdiagram.h:40
QgsLinearlyInterpolatedDiagramRenderer::upperSize
QSizeF upperSize() const
Definition: qgsdiagramrenderer.h:883
QgsDiagramLayerSettings::StartAngle
@ StartAngle
Angle offset for pie diagram.
Definition: qgsdiagramrenderer.h:102
QgsLinearlyInterpolatedDiagramRenderer::lowerValue
double lowerValue() const
Definition: qgsdiagramrenderer.h:874
QgsDiagramRenderer::mDiagram
std::unique_ptr< QgsDiagram > mDiagram
Reference to the object that does the real diagram rendering.
Definition: qgsdiagramrenderer.h:809
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
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:899
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:35
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:830
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:890
QgsDiagramSettings::penColor
QColor penColor
Definition: qgsdiagramrenderer.h:450
qgsreadwritecontext.h
QgsDiagramSettings::Clockwise
@ Clockwise
Clockwise orientation.
Definition: qgsdiagramrenderer.h:405
MapOrientation
MapOrientation
Signifies that the AboveLine and BelowLine flags should respect the map's orientation rather than the...
Definition: qgspallabeling.h:280
QgsSingleCategoryDiagramRenderer::QgsSingleCategoryDiagramRenderer
QgsSingleCategoryDiagramRenderer()=default
Constructor for QgsSingleCategoryDiagramRenderer.
QgsDiagramSettings::Up
@ Up
Definition: qgsdiagramrenderer.h:393
AboveLine
AboveLine
Labels can be placed above a line feature.
Definition: qgspallabeling.h:274
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
Object that keeps configuration of appearance of marker symbol's data-defined size in legend.
Definition: qgsdatadefinedsizelegend.h:42
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:58
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:66
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:771
field
const QgsField & field
Definition: qgsfield.h:456
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
QgsDiagramRenderer::rendererName
virtual QString rendererName() const =0
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:873
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsDiagramInterpolationSettings::upperValue
double upperValue
Definition: qgsdiagramrenderer.h:667
QgsDiagramLayerSettings::ZIndex
@ ZIndex
Z-index for diagram ordering.
Definition: qgsdiagramrenderer.h:98
QgsDiagramSettings::DiagramOrientation
DiagramOrientation
Orientation of histogram.
Definition: qgsdiagramrenderer.h:392
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:897
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
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:865
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:882
QgsDiagramInterpolationSettings::lowerSize
QSizeF lowerSize
Definition: qgsdiagramrenderer.h:664
QgsLinearlyInterpolatedDiagramRenderer::rendererName
QString rendererName() const override
Definition: qgsdiagramrenderer.h:871
QgsLinearlyInterpolatedDiagramRenderer::classificationAttributeIsExpression
bool classificationAttributeIsExpression() const
Definition: qgsdiagramrenderer.h:902
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:900
QgsDiagramSettings::LabelPlacementMethod
LabelPlacementMethod
Definition: qgsdiagramrenderer.h:385
QgsLayerTreeLayer
Layer tree node points to a map layer.
Definition: qgslayertreelayer.h:44
qgis_sip.h
QgsLinearlyInterpolatedDiagramRenderer::setClassificationAttributeIsExpression
void setClassificationAttributeIsExpression(bool isExpression)
Definition: qgsdiagramrenderer.h:903
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsLineSymbol
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgssymbol.h:1131
QgsDiagramLayerSettings
Stores the settings for rendering of all diagrams for a layer.
Definition: qgsdiagramrenderer.h:61
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:763
QgsDiagramRenderer
Evaluates and returns the diagram settings relating to a diagram for a specific feature.
Definition: qgsdiagramrenderer.h:684
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:38
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:876
QgsDiagramInterpolationSettings
Additional diagram settings for interpolated size rendering.
Definition: qgsdiagramrenderer.h:662
QgsDiagramRenderer::diagram
QgsDiagram * diagram() const
Definition: qgsdiagramrenderer.h:732
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
OnLine
OnLine
Labels can be placed directly over a line feature.
Definition: qgspallabeling.h:273
QgsLinearlyInterpolatedDiagramRenderer
Definition: qgsdiagramrenderer.h:855
QgsSingleCategoryDiagramRenderer::setDiagramSettings
void setDiagramSettings(const QgsDiagramSettings &s)
Definition: qgsdiagramrenderer.h:832
QgsDiagramSettings::~QgsDiagramSettings
~QgsDiagramSettings()
QgsDiagramRenderer::QgsDiagramRenderer
QgsDiagramRenderer()=default
Constructor for QgsDiagramRenderer.
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:319
QgsSingleCategoryDiagramRenderer
Renders the diagrams for all features with the same settings.
Definition: qgsdiagramrenderer.h:820
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:77
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
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:38
QgsDiagramLayerSettings::distance
double distance() const
Returns the distance between the diagram and the feature (in mm).
Definition: qgsdiagramrenderer.h:212
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:387
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:54
qgsproperty.h
qgspropertycollection.h
QgsDiagramSettings::Direction
Direction
Angular directions.
Definition: qgsdiagramrenderer.h:404
pal::Layer
A set of features which influence the labeling process.
Definition: layer.h:62
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
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:56
QgsDiagramLayerSettings::AlwaysShow
@ AlwaysShow
Whether the diagram should always be shown, even if it overlaps other diagrams/labels.
Definition: qgsdiagramrenderer.h:101
QgsDiagramRenderer::~QgsDiagramRenderer
virtual ~QgsDiagramRenderer()=default
QgsDiagramLayerSettings::PositionX
@ PositionX
X-coordinate data defined diagram position.
Definition: qgsdiagramrenderer.h:94
QgsDiagramRenderer::diagramSettings
virtual bool diagramSettings(const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s) const =0
Returns diagram settings for a feature (or false if the diagram for the feature is not to be rendered...
QgsCoordinateTransform
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:53
QgsDiagramLayerSettings::Property
Property
Data definable properties.
Definition: qgsdiagramrenderer.h:90
SIP_END
#define SIP_END
Definition: qgis_sip.h:194
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
BelowLine
BelowLine
Labels can be placed below a line feature.
Definition: qgspallabeling.h:277
QgsLinearlyInterpolatedDiagramRenderer::lowerSize
QSizeF lowerSize() const
Definition: qgsdiagramrenderer.h:880
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:381
QgsLinearlyInterpolatedDiagramRenderer::setLowerSize
void setLowerSize(QSizeF s)
Definition: qgsdiagramrenderer.h:879
QgsLayerTreeModelLegendNode
The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegen...
Definition: qgslayertreemodellegendnode.h:51