QGIS API Documentation 3.38.0-Grenoble (exported)
|
Stores the settings for rendering of all diagrams for a layer. More...
#include <qgsdiagramrenderer.h>
Public Types | |
enum | LinePlacementFlag { OnLine = 1 , AboveLine = 1 << 1 , BelowLine = 1 << 2 , MapOrientation = 1 << 4 } |
Line placement flags for controlling line based placements. More... | |
typedef QFlags< LinePlacementFlag > | LinePlacementFlags |
enum | Placement { AroundPoint = 0 , OverPoint , Line , Curved , Horizontal , Free } |
enum class | Property : int { BackgroundColor , StrokeColor , StrokeWidth , PositionX , PositionY , Distance , Priority , ZIndex , IsObstacle , Show , AlwaysShow , StartAngle } |
Data definable properties. More... | |
Public Member Functions | |
QgsDiagramLayerSettings () | |
Constructor for QgsDiagramLayerSettings. | |
QgsDiagramLayerSettings (const QgsDiagramLayerSettings &rh) | |
Copy constructor. | |
~QgsDiagramLayerSettings () | |
QgsCoordinateTransform | coordinateTransform () const |
Returns the coordinate transform associated with the layer, or an invalid transform if no transformation is required. | |
QgsPropertyCollection & | dataDefinedProperties () |
Returns a reference to the diagram's property collection, used for data defined overrides. | |
const QgsPropertyCollection & | dataDefinedProperties () const |
Returns a reference to the diagram's property collection, used for data defined overrides. | |
double | distance () const |
Returns the distance between the diagram and the feature (in mm). | |
bool | isObstacle () const |
Returns whether the feature associated with a diagram acts as an obstacle for other labels or diagrams. | |
LinePlacementFlags | linePlacementFlags () const |
Returns the diagram placement flags. | |
QgsDiagramLayerSettings & | operator= (const QgsDiagramLayerSettings &rh) |
Placement | placement () const |
Returns the diagram placement. | |
bool | prepare (const QgsExpressionContext &context=QgsExpressionContext()) const |
Prepares the diagrams for a specified expression context. | |
int | priority () const |
Returns the diagram priority. | |
void | readXml (const QDomElement &elem) |
Reads the diagram settings from a DOM element. | |
QSet< QString > | referencedFields (const QgsExpressionContext &context=QgsExpressionContext()) const |
Returns the set of any fields referenced by the layer's diagrams. | |
QgsDiagramRenderer * | renderer () |
Returns the diagram renderer associated with the layer. | |
const QgsDiagramRenderer * | renderer () const |
Returns the diagram renderer associated with the layer. | |
void | setCoordinateTransform (const QgsCoordinateTransform &transform) |
Sets the coordinate transform associated with the layer. | |
void | setDataDefinedProperties (const QgsPropertyCollection &collection) |
Sets the diagram's property collection, used for data defined overrides. | |
void | setDistance (double distance) |
Sets the distance between the diagram and the feature. | |
void | setIsObstacle (bool isObstacle) |
Sets whether the feature associated with a diagram acts as an obstacle for other labels or diagrams. | |
void | setLinePlacementFlags (LinePlacementFlags flags) |
Sets the the diagram placement flags. | |
void | setPlacement (Placement value) |
Sets the diagram placement. | |
void | setPriority (int value) |
Sets the diagram priority. | |
void | setRenderer (QgsDiagramRenderer *diagramRenderer) |
Sets the diagram renderer associated with the layer. | |
void | setShowAllDiagrams (bool showAllDiagrams) |
Sets whether the layer should show all diagrams, including overlapping diagrams. | |
void | setZIndex (double index) |
Sets the diagram z-index. | |
bool | showAllDiagrams () const |
Returns whether the layer should show all diagrams, including overlapping diagrams. | |
void | writeXml (QDomElement &layerElem, QDomDocument &doc) const |
Writes the diagram settings to a DOM element. | |
double | zIndex () const |
Returns the diagram z-index. | |
Static Public Member Functions | |
static const QgsPropertiesDefinition & | propertyDefinitions () |
Returns the diagram property definitions. | |
Stores the settings for rendering of all diagrams for a layer.
QgsDiagramSettings stores the settings related to rendering the individual diagrams themselves, while QgsDiagramLayerSettings stores settings which control how ALL diagrams within a layer are rendered.
Definition at line 59 of file qgsdiagramrenderer.h.
typedef QFlags< LinePlacementFlag > QgsDiagramLayerSettings::LinePlacementFlags |
Definition at line 82 of file qgsdiagramrenderer.h.
Line placement flags for controlling line based placements.
Enumerator | |
---|---|
OnLine | |
AboveLine | |
BelowLine | |
MapOrientation |
Definition at line 75 of file qgsdiagramrenderer.h.
Enumerator | |
---|---|
AroundPoint | |
OverPoint | |
Line | |
Curved | |
Horizontal | |
Free |
Definition at line 64 of file qgsdiagramrenderer.h.
|
strong |
Data definable properties.
Definition at line 89 of file qgsdiagramrenderer.h.
QgsDiagramLayerSettings::QgsDiagramLayerSettings | ( | ) |
Constructor for QgsDiagramLayerSettings.
Definition at line 69 of file qgsdiagramrenderer.cpp.
QgsDiagramLayerSettings::QgsDiagramLayerSettings | ( | const QgsDiagramLayerSettings & | rh | ) |
Copy constructor.
Definition at line 74 of file qgsdiagramrenderer.cpp.
QgsDiagramLayerSettings::~QgsDiagramLayerSettings | ( | ) |
Definition at line 104 of file qgsdiagramrenderer.cpp.
|
inline |
Returns the coordinate transform associated with the layer, or an invalid transform if no transformation is required.
Definition at line 235 of file qgsdiagramrenderer.h.
|
inline |
Returns a reference to the diagram's property collection, used for data defined overrides.
Definition at line 286 of file qgsdiagramrenderer.h.
|
inline |
Returns a reference to the diagram's property collection, used for data defined overrides.
Definition at line 294 of file qgsdiagramrenderer.h.
|
inline |
Returns the distance between the diagram and the feature (in mm).
Definition at line 201 of file qgsdiagramrenderer.h.
|
inline |
Returns whether the feature associated with a diagram acts as an obstacle for other labels or diagrams.
Definition at line 188 of file qgsdiagramrenderer.h.
|
inline |
Returns the diagram placement flags.
These are only used if the diagram placement is set to a line type.
Definition at line 141 of file qgsdiagramrenderer.h.
QgsDiagramLayerSettings & QgsDiagramLayerSettings::operator= | ( | const QgsDiagramLayerSettings & | rh | ) |
Definition at line 89 of file qgsdiagramrenderer.cpp.
|
inline |
Returns the diagram placement.
Definition at line 127 of file qgsdiagramrenderer.h.
bool QgsDiagramLayerSettings::prepare | ( | const QgsExpressionContext & | context = QgsExpressionContext() | ) | const |
Prepares the diagrams for a specified expression context.
Calling prepare before rendering multiple diagrams allows precalculation of expensive setup tasks such as parsing expressions. Returns true
if preparation was successful.
Definition at line 160 of file qgsdiagramrenderer.cpp.
|
inline |
Returns the diagram priority.
Definition at line 158 of file qgsdiagramrenderer.h.
|
static |
Returns the diagram property definitions.
Definition at line 63 of file qgsdiagramrenderer.cpp.
void QgsDiagramLayerSettings::readXml | ( | const QDomElement & | elem | ) |
Reads the diagram settings from a DOM element.
Definition at line 123 of file qgsdiagramrenderer.cpp.
QSet< QString > QgsDiagramLayerSettings::referencedFields | ( | const QgsExpressionContext & | context = QgsExpressionContext() | ) | const |
Returns the set of any fields referenced by the layer's diagrams.
context | expression context the diagrams will be drawn using |
Definition at line 165 of file qgsdiagramrenderer.cpp.
|
inline |
Returns the diagram renderer associated with the layer.
Definition at line 214 of file qgsdiagramrenderer.h.
|
inline |
Returns the diagram renderer associated with the layer.
Definition at line 221 of file qgsdiagramrenderer.h.
void QgsDiagramLayerSettings::setCoordinateTransform | ( | const QgsCoordinateTransform & | transform | ) |
Sets the coordinate transform associated with the layer.
transform | coordinate transform. Ownership is transferred to the object. |
Definition at line 118 of file qgsdiagramrenderer.cpp.
|
inline |
Sets the diagram's property collection, used for data defined overrides.
collection | property collection. Existing properties will be replaced. |
Definition at line 302 of file qgsdiagramrenderer.h.
|
inline |
Sets the distance between the diagram and the feature.
distance | distance in mm |
Definition at line 208 of file qgsdiagramrenderer.h.
|
inline |
Sets whether the feature associated with a diagram acts as an obstacle for other labels or diagrams.
isObstacle | set to true for feature to act as obstacle |
Definition at line 195 of file qgsdiagramrenderer.h.
|
inline |
Sets the the diagram placement flags.
These are only used if the diagram placement is set to a line type.
flags | placement value |
Definition at line 149 of file qgsdiagramrenderer.h.
|
inline |
Sets the diagram placement.
value | placement value |
Definition at line 134 of file qgsdiagramrenderer.h.
|
inline |
Sets the diagram priority.
value | priority, where 0 = low and 10 = high |
Definition at line 165 of file qgsdiagramrenderer.h.
void QgsDiagramLayerSettings::setRenderer | ( | QgsDiagramRenderer * | diagramRenderer | ) |
Sets the diagram renderer associated with the layer.
diagramRenderer | diagram renderer. Ownership is transferred to the object. |
Definition at line 109 of file qgsdiagramrenderer.cpp.
|
inline |
Sets whether the layer should show all diagrams, including overlapping diagrams.
showAllDiagrams | set to true to show all diagrams |
Definition at line 255 of file qgsdiagramrenderer.h.
|
inline |
Sets the diagram z-index.
Diagrams (or labels) with a higher z-index are drawn over diagrams with a lower z-index.
index | diagram z-index |
Definition at line 182 of file qgsdiagramrenderer.h.
|
inline |
Returns whether the layer should show all diagrams, including overlapping diagrams.
Definition at line 248 of file qgsdiagramrenderer.h.
void QgsDiagramLayerSettings::writeXml | ( | QDomElement & | layerElem, |
QDomDocument & | doc | ||
) | const |
Writes the diagram settings to a DOM element.
Definition at line 144 of file qgsdiagramrenderer.cpp.
|
inline |
Returns the diagram z-index.
Diagrams (or labels) with a higher z-index are drawn over diagrams with a lower z-index.
Definition at line 174 of file qgsdiagramrenderer.h.