QGIS API Documentation  2.99.0-Master (e077efd)
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 <qgsdiagramrenderer.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 ()
 
QgsCoordinateTransform coordinateTransform () const
 Returns the coordinate transform associated with the layer, or an invalid transform if no transformation is required. 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...
 
QgsDiagramRenderergetRenderer ()
 Returns the diagram renderer associated with the layer. More...
 
const QgsDiagramRenderergetRenderer () 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< QString > referencedFields (const QgsExpressionContext &context=QgsExpressionContext(), const QgsFields &fields=QgsFields()) const
 Returns the set of any fields referenced by the layer's diagrams. More...
 
void setCoordinateTransform (const 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 (QgsDiagramRenderer *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

double dist
 Distance between diagram and the feature (in mm) More...
 
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...
 
QgsDiagramRendererrenderer
 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...
 
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 qgsdiagramrenderer.h.

Member Enumeration Documentation

§ LinePlacementFlags

Line placement flags for controlling line based placements.

Enumerator
OnLine 
AboveLine 
BelowLine 
MapOrientation 

Definition at line 66 of file qgsdiagramrenderer.h.

§ Placement

Enumerator
AroundPoint 
OverPoint 
Line 
Curved 
Horizontal 
Free 

Definition at line 55 of file qgsdiagramrenderer.h.

Constructor & Destructor Documentation

§ QgsDiagramLayerSettings() [1/2]

Q_NOWARN_DEPRECATED_PUSH QgsDiagramLayerSettings::QgsDiagramLayerSettings ( )

Definition at line 29 of file qgsdiagramrenderer.cpp.

§ QgsDiagramLayerSettings() [2/2]

Q_NOWARN_DEPRECATED_POP Q_NOWARN_DEPRECATED_PUSH QgsDiagramLayerSettings::QgsDiagramLayerSettings ( const QgsDiagramLayerSettings rh)

Copy constructor.

Definition at line 46 of file qgsdiagramrenderer.cpp.

§ ~QgsDiagramLayerSettings()

Q_NOWARN_DEPRECATED_POP Q_NOWARN_DEPRECATED_PUSH QgsDiagramLayerSettings::~QgsDiagramLayerSettings ( )

Definition at line 83 of file qgsdiagramrenderer.cpp.

Member Function Documentation

§ coordinateTransform()

QgsCoordinateTransform QgsDiagramLayerSettings::coordinateTransform ( ) const
inline

Returns the coordinate transform associated with the layer, or an invalid transform if no transformation is required.

See also
setCoordinateTransform()
Note
added in QGIS 2.16

Definition at line 230 of file qgsdiagramrenderer.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 qgsdiagramrenderer.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 qgsdiagramrenderer.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 qgsdiagramrenderer.h.

§ getRenderer() [1/2]

QgsDiagramRenderer* 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 qgsdiagramrenderer.h.

§ getRenderer() [2/2]

const QgsDiagramRenderer* 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 qgsdiagramrenderer.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 qgsdiagramrenderer.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 qgsdiagramrenderer.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 qgsdiagramrenderer.h.

§ operator=()

Definition at line 64 of file qgsdiagramrenderer.cpp.

§ readXml()

void QgsDiagramLayerSettings::readXml ( const QDomElement &  elem,
const QgsVectorLayer layer 
)

Definition at line 103 of file qgsdiagramrenderer.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 137 of file qgsdiagramrenderer.cpp.

§ setCoordinateTransform()

void QgsDiagramLayerSettings::setCoordinateTransform ( const 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 98 of file qgsdiagramrenderer.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 qgsdiagramrenderer.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 qgsdiagramrenderer.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 qgsdiagramrenderer.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 qgsdiagramrenderer.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 qgsdiagramrenderer.h.

§ setRenderer()

Q_NOWARN_DEPRECATED_POP void QgsDiagramLayerSettings::setRenderer ( QgsDiagramRenderer 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 89 of file qgsdiagramrenderer.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 259 of file qgsdiagramrenderer.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 qgsdiagramrenderer.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 252 of file qgsdiagramrenderer.h.

§ writeXml()

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

Definition at line 119 of file qgsdiagramrenderer.cpp.

Member Data Documentation

§ dist

double QgsDiagramLayerSettings::dist

Distance between diagram and the feature (in mm)

Definition at line 198 of file qgsdiagramrenderer.h.

§ obstacle

bool QgsDiagramLayerSettings::obstacle

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

Definition at line 181 of file qgsdiagramrenderer.h.

§ placement

Placement QgsDiagramLayerSettings::placement

Diagram placement.

Definition at line 99 of file qgsdiagramrenderer.h.

§ placementFlags

unsigned int QgsDiagramLayerSettings::placementFlags

Diagram placement flags.

Definition at line 118 of file qgsdiagramrenderer.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 qgsdiagramrenderer.h.

§ renderer

QgsDiagramRenderer* QgsDiagramLayerSettings::renderer

Associated diagram renderer. Owned by this object.

Definition at line 223 of file qgsdiagramrenderer.h.

§ showAll

bool QgsDiagramLayerSettings::showAll

Whether to show all diagrams, including overlapping diagrams.

Definition at line 263 of file qgsdiagramrenderer.h.

§ showColumn

int QgsDiagramLayerSettings::showColumn

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

Definition at line 246 of file qgsdiagramrenderer.h.

§ xPosColumn

int QgsDiagramLayerSettings::xPosColumn

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

Definition at line 240 of file qgsdiagramrenderer.h.

§ yPosColumn

int QgsDiagramLayerSettings::yPosColumn

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

Definition at line 243 of file qgsdiagramrenderer.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 qgsdiagramrenderer.h.


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