QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Types | Public Member Functions | Public Attributes | List of all members
QgsDiagramLayerSettings Class Reference

Stores the settings for rendering of all diagrams for a layer. More...

#include <qgsdiagramrendererv2.h>

Public Types

enum  LinePlacementFlags { OnLine = 1, AboveLine = 2, BelowLine = 4, MapOrientation = 8 }
 Line placement flags for controlling line based placements. More...
 
enum  Placement {
  AroundPoint = 0, OverPoint, Line, Curved,
  Horizontal, Free
}
 

Public Member Functions

 QgsDiagramLayerSettings ()
 
 QgsDiagramLayerSettings (const QgsDiagramLayerSettings &rh)
 Copy constructor. More...
 
 ~QgsDiagramLayerSettings ()
 
QgsCoordinateTransformcoordinateTransform ()
 Returns the coordinate transform associated with the layer. More...
 
const QgsCoordinateTransformcoordinateTransform () const
 Returns the coordinate transform associated with the layer. More...
 
double distance () const
 Returns the distance between the diagram and the feature (in mm). More...
 
Placement getPlacement () const
 Returns the diagram placement. More...
 
int getPriority () const
 Returns the diagram priority. More...
 
QgsDiagramRendererV2getRenderer ()
 Returns the diagram renderer associated with the layer. More...
 
const QgsDiagramRendererV2getRenderer () const
 Returns the diagram renderer associated with the layer. More...
 
double getZIndex () const
 Returns the diagram z-index. More...
 
bool isObstacle () const
 Returns whether the feature associated with a diagram acts as an obstacle for other labels or diagrams. More...
 
unsigned int linePlacementFlags () const
 Returns the diagram placement flags. More...
 
QgsDiagramLayerSettingsoperator= (const QgsDiagramLayerSettings &rh)
 
void readXML (const QDomElement &elem, const QgsVectorLayer *layer)
 
QSet< QStringreferencedFields (const QgsExpressionContext &context=QgsExpressionContext(), const QgsFields &fields=QgsFields()) const
 Returns the set of any fields referenced by the layer's diagrams. More...
 
void setCoordinateTransform (QgsCoordinateTransform *transform)
 Sets the coordinate transform associated with the layer. More...
 
void setDistance (double distance)
 Sets the distance between the diagram and the feature. More...
 
void setIsObstacle (bool isObstacle)
 Sets whether the feature associated with a diagram acts as an obstacle for other labels or diagrams. More...
 
void setLinePlacementFlags (unsigned int flags)
 Sets the the diagram placement flags. More...
 
void setPlacement (Placement value)
 Sets the diagram placement. More...
 
void setPriority (int value)
 Sets the diagram priority. More...
 
void setRenderer (QgsDiagramRendererV2 *diagramRenderer)
 Sets the diagram renderer associated with the layer. More...
 
void setShowAllDiagrams (bool showAllDiagrams)
 Sets whether the layer should show all diagrams, including overlapping diagrams. More...
 
void setZIndex (double index)
 Sets the diagram z-index. More...
 
bool showAllDiagrams () const
 Returns whether the layer should show all diagrams, including overlapping diagrams. More...
 
void writeXML (QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer) const
 

Public Attributes

QgsCoordinateTransformct
 Associated coordinate transform. Owned by this object. More...
 
double dist
 Distance between diagram and the feature (in mm) More...
 
Q_DECL_DEPRECATED QgsFields fields
 
bool obstacle
 Whether associated feature acts as an obstacle for other labels or diagrams. More...
 
Placement placement
 Diagram placement. More...
 
unsigned int placementFlags
 Diagram placement flags. More...
 
int priority
 Placement priority, where 0 = low and 10 = high. More...
 
QgsDiagramRendererV2renderer
 Associated diagram renderer. Owned by this object. More...
 
bool showAll
 Whether to show all diagrams, including overlapping diagrams. More...
 
int showColumn
 Attribute index for visibility (or -1 if visibility not data defined) More...
 
Q_DECL_DEPRECATED const QgsMapToPixelxform
 
int xPosColumn
 Attribute index for x coordinate (or -1 if position not data defined) More...
 
int yPosColumn
 Attribute index for y coordinate (or -1 if position not data defined) More...
 
double zIndex
 Z-index of diagrams, where diagrams with a higher z-index are drawn on top of diagrams with a lower z-index. More...
 

Detailed Description

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 50 of file qgsdiagramrendererv2.h.

Member Enumeration Documentation

◆ LinePlacementFlags

Line placement flags for controlling line based placements.

Enumerator
OnLine 
AboveLine 
BelowLine 
MapOrientation 

Definition at line 66 of file qgsdiagramrendererv2.h.

◆ Placement

Enumerator
AroundPoint 
OverPoint 
Line 
Curved 
Horizontal 
Free 

Definition at line 55 of file qgsdiagramrendererv2.h.

Constructor & Destructor Documentation

◆ QgsDiagramLayerSettings() [1/2]

Q_NOWARN_DEPRECATED_PUSH QgsDiagramLayerSettings::QgsDiagramLayerSettings ( )

Definition at line 30 of file qgsdiagramrendererv2.cpp.

◆ QgsDiagramLayerSettings() [2/2]

Q_NOWARN_DEPRECATED_POP Q_NOWARN_DEPRECATED_PUSH QgsDiagramLayerSettings::QgsDiagramLayerSettings ( const QgsDiagramLayerSettings rh)

Copy constructor.

Definition at line 49 of file qgsdiagramrendererv2.cpp.

◆ ~QgsDiagramLayerSettings()

Q_NOWARN_DEPRECATED_POP Q_NOWARN_DEPRECATED_PUSH QgsDiagramLayerSettings::~QgsDiagramLayerSettings ( )

Definition at line 90 of file qgsdiagramrendererv2.cpp.

Member Function Documentation

◆ coordinateTransform() [1/2]

QgsCoordinateTransform* QgsDiagramLayerSettings::coordinateTransform ( )
inline

Returns the coordinate transform associated with the layer.

See also
setCoordinateTransform()
Note
added in QGIS 2.16

Definition at line 229 of file qgsdiagramrendererv2.h.

◆ coordinateTransform() [2/2]

const QgsCoordinateTransform* QgsDiagramLayerSettings::coordinateTransform ( ) const
inline

Returns the coordinate transform associated with the layer.

See also
setCoordinateTransform()
Note
added in QGIS 2.16

Definition at line 235 of file qgsdiagramrendererv2.h.

◆ distance()

double QgsDiagramLayerSettings::distance ( ) const
inline

Returns the distance between the diagram and the feature (in mm).

See also
setDistance()
Note
added in QGIS 2.16

Definition at line 187 of file qgsdiagramrendererv2.h.

◆ getPlacement()

Placement QgsDiagramLayerSettings::getPlacement ( ) const
inline

Returns the diagram placement.

See also
setPlacement()
Note
added in QGIS 2.16

Definition at line 88 of file qgsdiagramrendererv2.h.

◆ getPriority()

int QgsDiagramLayerSettings::getPriority ( ) const
inline

Returns the diagram priority.

Returns
diagram priority, where 0 = low and 10 = high
Note
placement priority is shared with labeling, so diagrams with a high priority may displace labels and vice-versa
See also
setPriority()
Note
added in QGIS 2.16

Definition at line 128 of file qgsdiagramrendererv2.h.

◆ getRenderer() [1/2]

QgsDiagramRendererV2* QgsDiagramLayerSettings::getRenderer ( )
inline

Returns the diagram renderer associated with the layer.

See also
setRenderer()
Note
added in QGIS 2.16

Definition at line 205 of file qgsdiagramrendererv2.h.

◆ getRenderer() [2/2]

const QgsDiagramRendererV2* QgsDiagramLayerSettings::getRenderer ( ) const
inline

Returns the diagram renderer associated with the layer.

See also
setRenderer()
Note
added in QGIS 2.16

Definition at line 212 of file qgsdiagramrendererv2.h.

◆ getZIndex()

double QgsDiagramLayerSettings::getZIndex ( ) const
inline

Returns the diagram z-index.

Diagrams (or labels) with a higher z-index are drawn over diagrams with a lower z-index.

Note
z-index ordering is shared with labeling, so diagrams with a high z-index may be drawn over labels with a low z-index and vice-versa
See also
setZIndex()
Note
added in QGIS 2.16

Definition at line 151 of file qgsdiagramrendererv2.h.

◆ isObstacle()

bool QgsDiagramLayerSettings::isObstacle ( ) const
inline

Returns whether the feature associated with a diagram acts as an obstacle for other labels or diagrams.

See also
setIsObstacle()
Note
added in QGIS 2.16

Definition at line 170 of file qgsdiagramrendererv2.h.

◆ linePlacementFlags()

unsigned int QgsDiagramLayerSettings::linePlacementFlags ( ) const
inline

Returns the diagram placement flags.

These are only used if the diagram placement is set to a line type.

See also
setLinePlacementFlags()
Note
added in QGIS 2.16

Definition at line 106 of file qgsdiagramrendererv2.h.

◆ operator=()

Definition at line 69 of file qgsdiagramrendererv2.cpp.

◆ readXML()

void QgsDiagramLayerSettings::readXML ( const QDomElement elem,
const QgsVectorLayer layer 
)

Definition at line 112 of file qgsdiagramrendererv2.cpp.

◆ referencedFields()

QSet< QString > QgsDiagramLayerSettings::referencedFields ( const QgsExpressionContext context = QgsExpressionContext(),
const QgsFields fields = QgsFields() 
) const

Returns the set of any fields referenced by the layer's diagrams.

Parameters
contextexpression context the diagrams will be drawn using
fieldslayer fields
Note
added in QGIS 2.16

Definition at line 146 of file qgsdiagramrendererv2.cpp.

◆ setCoordinateTransform()

void QgsDiagramLayerSettings::setCoordinateTransform ( QgsCoordinateTransform transform)

Sets the coordinate transform associated with the layer.

Parameters
transformcoordinate transform. Ownership is transferred to the object.
See also
coordinateTransform()
Note
added in QGIS 2.16

Definition at line 106 of file qgsdiagramrendererv2.cpp.

◆ setDistance()

void QgsDiagramLayerSettings::setDistance ( double  distance)
inline

Sets the distance between the diagram and the feature.

Parameters
distancedistance in mm
See also
distance()
Note
added in QGIS 2.16

Definition at line 194 of file qgsdiagramrendererv2.h.

◆ setIsObstacle()

void QgsDiagramLayerSettings::setIsObstacle ( bool  isObstacle)
inline

Sets whether the feature associated with a diagram acts as an obstacle for other labels or diagrams.

Parameters
isObstacleset to true for feature to act as obstacle
See also
isObstacle()
Note
added in QGIS 2.16

Definition at line 177 of file qgsdiagramrendererv2.h.

◆ setLinePlacementFlags()

void QgsDiagramLayerSettings::setLinePlacementFlags ( unsigned int  flags)
inline

Sets the the diagram placement flags.

These are only used if the diagram placement is set to a line type.

Parameters
flagsplacement value
See also
getPlacement()
Note
added in QGIS 2.16

Definition at line 114 of file qgsdiagramrendererv2.h.

◆ setPlacement()

void QgsDiagramLayerSettings::setPlacement ( Placement  value)
inline

Sets the diagram placement.

Parameters
valueplacement value
See also
getPlacement()
Note
added in QGIS 2.16

Definition at line 95 of file qgsdiagramrendererv2.h.

◆ setPriority()

void QgsDiagramLayerSettings::setPriority ( int  value)
inline

Sets the diagram priority.

Parameters
valuepriority, where 0 = low and 10 = high
See also
getPriority()
Note
added in QGIS 2.16

Definition at line 135 of file qgsdiagramrendererv2.h.

◆ setRenderer()

Q_NOWARN_DEPRECATED_POP void QgsDiagramLayerSettings::setRenderer ( QgsDiagramRendererV2 diagramRenderer)

Sets the diagram renderer associated with the layer.

Parameters
diagramRendererdiagram renderer. Ownership is transferred to the object.
See also
getRenderer()
Note
added in QGIS 2.16

Definition at line 97 of file qgsdiagramrendererv2.cpp.

◆ setShowAllDiagrams()

void QgsDiagramLayerSettings::setShowAllDiagrams ( bool  showAllDiagrams)
inline

Sets whether the layer should show all diagrams, including overlapping diagrams.

Parameters
showAllDiagramsset to true to show all diagrams
See also
showAllDiagrams()
Note
added in QGIS 2.16

Definition at line 274 of file qgsdiagramrendererv2.h.

◆ setZIndex()

void QgsDiagramLayerSettings::setZIndex ( double  index)
inline

Sets the diagram z-index.

Diagrams (or labels) with a higher z-index are drawn over diagrams with a lower z-index.

Parameters
indexdiagram z-index
See also
getZIndex()
Note
added in QGIS 2.16

Definition at line 159 of file qgsdiagramrendererv2.h.

◆ showAllDiagrams()

bool QgsDiagramLayerSettings::showAllDiagrams ( ) const
inline

Returns whether the layer should show all diagrams, including overlapping diagrams.

See also
setShowAllDiagrams()
Note
added in QGIS 2.16

Definition at line 267 of file qgsdiagramrendererv2.h.

◆ writeXML()

void QgsDiagramLayerSettings::writeXML ( QDomElement layerElem,
QDomDocument doc,
const QgsVectorLayer layer 
) const

Definition at line 128 of file qgsdiagramrendererv2.cpp.

Member Data Documentation

◆ ct

QgsCoordinateTransform* QgsDiagramLayerSettings::ct

Associated coordinate transform. Owned by this object.

Definition at line 246 of file qgsdiagramrendererv2.h.

◆ dist

double QgsDiagramLayerSettings::dist

Distance between diagram and the feature (in mm)

Definition at line 198 of file qgsdiagramrendererv2.h.

◆ fields

Q_DECL_DEPRECATED QgsFields QgsDiagramLayerSettings::fields
Deprecated:
will be removed in QGIS 3.0

Definition at line 252 of file qgsdiagramrendererv2.h.

◆ obstacle

bool QgsDiagramLayerSettings::obstacle

Whether associated feature acts as an obstacle for other labels or diagrams.

Definition at line 181 of file qgsdiagramrendererv2.h.

◆ placement

Placement QgsDiagramLayerSettings::placement

Diagram placement.

Definition at line 99 of file qgsdiagramrendererv2.h.

◆ placementFlags

unsigned int QgsDiagramLayerSettings::placementFlags

Diagram placement flags.

Definition at line 118 of file qgsdiagramrendererv2.h.

◆ priority

int QgsDiagramLayerSettings::priority

Placement priority, where 0 = low and 10 = high.

Note
placement priority is shared with labeling, so diagrams with a high priority may displace labels and vice-versa

Definition at line 141 of file qgsdiagramrendererv2.h.

◆ renderer

QgsDiagramRendererV2* QgsDiagramLayerSettings::renderer

Associated diagram renderer. Owned by this object.

Definition at line 223 of file qgsdiagramrendererv2.h.

◆ showAll

bool QgsDiagramLayerSettings::showAll

Whether to show all diagrams, including overlapping diagrams.

Definition at line 278 of file qgsdiagramrendererv2.h.

◆ showColumn

int QgsDiagramLayerSettings::showColumn

Attribute index for visibility (or -1 if visibility not data defined)

Definition at line 261 of file qgsdiagramrendererv2.h.

◆ xform

Q_DECL_DEPRECATED const QgsMapToPixel* QgsDiagramLayerSettings::xform
Deprecated:
will be removed in QGIS 3.0

Definition at line 249 of file qgsdiagramrendererv2.h.

◆ xPosColumn

int QgsDiagramLayerSettings::xPosColumn

Attribute index for x coordinate (or -1 if position not data defined)

Definition at line 255 of file qgsdiagramrendererv2.h.

◆ yPosColumn

int QgsDiagramLayerSettings::yPosColumn

Attribute index for y coordinate (or -1 if position not data defined)

Definition at line 258 of file qgsdiagramrendererv2.h.

◆ zIndex

double QgsDiagramLayerSettings::zIndex

Z-index of diagrams, where diagrams with a higher z-index are drawn on top of diagrams with a lower z-index.

Definition at line 163 of file qgsdiagramrendererv2.h.


The documentation for this class was generated from the following files: