QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsAbstractRasterLayerLabeling Class Referenceabstract

Abstract base class for labeling settings for raster layers. More...

#include <qgsrasterlabeling.h>

Inheritance diagram for QgsAbstractRasterLayerLabeling:

Public Member Functions

 QgsAbstractRasterLayerLabeling ()=default
 QgsAbstractRasterLayerLabeling (const QgsAbstractRasterLayerLabeling &rhs)=delete
 QgsAbstractRasterLayerLabeling cannot be copied, use clone() instead.
virtual ~QgsAbstractRasterLayerLabeling ()=default
virtual bool accept (QgsStyleEntityVisitorInterface *visitor) const
 Accepts the specified symbology visitor, causing it to visit all symbols associated with the labeling.
virtual QgsAbstractRasterLayerLabelingclone () const =0
 Returns a new copy of the object.
virtual bool hasNonDefaultCompositionMode () const =0
 Returns true the labeling requires a non-default composition mode.
virtual bool isInScaleRange (double scale) const
 Tests whether the labels should be visible at the specified scale.
virtual void multiplyOpacity (double opacityFactor)
 Multiply opacity by opacityFactor.
QgsAbstractRasterLayerLabelingoperator= (const QgsAbstractRasterLayerLabeling &rhs)=delete
 QgsAbstractRasterLayerLabeling cannot be copied, use clone() instead.
virtual std::unique_ptr< QgsRasterLayerLabelProviderprovider (QgsRasterLayer *layer) const =0
 Creates a raster label provider corresponding to this object's configuration.
virtual bool requiresAdvancedEffects () const =0
 Returns true if drawing labels requires advanced effects like composition modes, which could prevent it being used as an isolated cached image or exported to a vector format.
virtual QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const =0
 Saves the labeling configuration to an XML element.
virtual void toSld (QDomNode &parent, const QVariantMap &props) const
 Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings.
virtual QString type () const =0
 Unique type string of the labeling configuration implementation.

Static Public Member Functions

static QgsAbstractRasterLayerLabelingcreateFromElement (const QDomElement &element, const QgsReadWriteContext &context)
 Tries to create an instance of an implementation based on the XML data.
static QgsAbstractRasterLayerLabelingdefaultLabelingForLayer (QgsRasterLayer *layer)
 Creates default labeling for a raster layer.

Detailed Description

Abstract base class for labeling settings for raster layers.

Since
QGIS 3.42

Definition at line 168 of file qgsrasterlabeling.h.

Constructor & Destructor Documentation

◆ QgsAbstractRasterLayerLabeling() [1/2]

QgsAbstractRasterLayerLabeling::QgsAbstractRasterLayerLabeling ( )
default

◆ ~QgsAbstractRasterLayerLabeling()

virtual QgsAbstractRasterLayerLabeling::~QgsAbstractRasterLayerLabeling ( )
virtualdefault

◆ QgsAbstractRasterLayerLabeling() [2/2]

QgsAbstractRasterLayerLabeling::QgsAbstractRasterLayerLabeling ( const QgsAbstractRasterLayerLabeling & rhs)
delete

QgsAbstractRasterLayerLabeling cannot be copied, use clone() instead.

Member Function Documentation

◆ accept()

bool QgsAbstractRasterLayerLabeling::accept ( QgsStyleEntityVisitorInterface * visitor) const
virtual

Accepts the specified symbology visitor, causing it to visit all symbols associated with the labeling.

Returns true if the visitor should continue visiting other objects, or false if visiting should be canceled.

Reimplemented in QgsRasterLayerSimpleLabeling.

Definition at line 346 of file qgsrasterlabeling.cpp.

◆ clone()

virtual QgsAbstractRasterLayerLabeling * QgsAbstractRasterLayerLabeling::clone ( ) const
pure virtual

Returns a new copy of the object.

Implemented in QgsRasterLayerSimpleLabeling.

◆ createFromElement()

QgsAbstractRasterLayerLabeling * QgsAbstractRasterLayerLabeling::createFromElement ( const QDomElement & element,
const QgsReadWriteContext & context )
static

Tries to create an instance of an implementation based on the XML data.

Definition at line 325 of file qgsrasterlabeling.cpp.

◆ defaultLabelingForLayer()

QgsAbstractRasterLayerLabeling * QgsAbstractRasterLayerLabeling::defaultLabelingForLayer ( QgsRasterLayer * layer)
static

Creates default labeling for a raster layer.

Definition at line 620 of file qgsrasterlabeling.cpp.

◆ hasNonDefaultCompositionMode()

virtual bool QgsAbstractRasterLayerLabeling::hasNonDefaultCompositionMode ( ) const
pure virtual

Returns true the labeling requires a non-default composition mode.

This method is pessimistic, in that it will return true in cases where composition modes cannot be easily determined in advance (e.g. when data-defined overrides are in place for composition modes).

The default composition mode is QPainter::CompositionMode_SourceOver.

Since
QGIS 3.44

Implemented in QgsRasterLayerSimpleLabeling.

◆ isInScaleRange()

bool QgsAbstractRasterLayerLabeling::isInScaleRange ( double scale) const
virtual

Tests whether the labels should be visible at the specified scale.

The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.

Returns
true if the labels are visible at the given scale.

Reimplemented in QgsRasterLayerSimpleLabeling.

Definition at line 320 of file qgsrasterlabeling.cpp.

◆ multiplyOpacity()

void QgsAbstractRasterLayerLabeling::multiplyOpacity ( double opacityFactor)
virtual

Multiply opacity by opacityFactor.

This method multiplies the opacity of the labeling elements (text, shadow, buffer etc.) by opacity effectively changing the opacity of the whole labeling elements.

Reimplemented in QgsRasterLayerSimpleLabeling.

Definition at line 315 of file qgsrasterlabeling.cpp.

◆ operator=()

QgsAbstractRasterLayerLabeling & QgsAbstractRasterLayerLabeling::operator= ( const QgsAbstractRasterLayerLabeling & rhs)
delete

QgsAbstractRasterLayerLabeling cannot be copied, use clone() instead.

◆ provider()

virtual std::unique_ptr< QgsRasterLayerLabelProvider > QgsAbstractRasterLayerLabeling::provider ( QgsRasterLayer * layer) const
pure virtual

Creates a raster label provider corresponding to this object's configuration.

Note
not available in Python bindings

Implemented in QgsRasterLayerSimpleLabeling.

◆ requiresAdvancedEffects()

virtual bool QgsAbstractRasterLayerLabeling::requiresAdvancedEffects ( ) const
pure virtual

Returns true if drawing labels requires advanced effects like composition modes, which could prevent it being used as an isolated cached image or exported to a vector format.

Implemented in QgsRasterLayerSimpleLabeling.

◆ save()

virtual QDomElement QgsAbstractRasterLayerLabeling::save ( QDomDocument & doc,
const QgsReadWriteContext & context ) const
pure virtual

Saves the labeling configuration to an XML element.

See also
createFromElement()

Implemented in QgsRasterLayerSimpleLabeling.

◆ toSld()

void QgsAbstractRasterLayerLabeling::toSld ( QDomNode & parent,
const QVariantMap & props ) const
virtual

Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings.

Definition at line 338 of file qgsrasterlabeling.cpp.

◆ type()

virtual QString QgsAbstractRasterLayerLabeling::type ( ) const
pure virtual

Unique type string of the labeling configuration implementation.

Implemented in QgsRasterLayerSimpleLabeling.


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