QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
qgssinglebandpseudocolorrenderer.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgssinglebandpseudocolorrenderer.cpp
3  ------------------------------------
4  begin : January 2012
5  copyright : (C) 2012 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
19 #include "qgscolorramp.h"
20 #include "qgscolorrampshader.h"
21 #include "qgsrastershader.h"
22 #include "qgsrastertransparency.h"
23 #include "qgsrasterviewport.h"
24 #include "qgsstyleentityvisitor.h"
25 #include "qgscolorramplegendnode.h"
26 
27 #include <QDomDocument>
28 #include <QDomElement>
29 #include <QImage>
30 
32  : QgsRasterRenderer( input, QStringLiteral( "singlebandpseudocolor" ) )
33  , mShader( shader )
34  , mBand( band )
35  , mClassificationMin( std::numeric_limits<double>::quiet_NaN() )
36  , mClassificationMax( std::numeric_limits<double>::quiet_NaN() )
37 {
38 }
39 
41 {
42  if ( !mInput )
43  {
44  mBand = bandNo;
45  return;
46  }
47 
48  if ( bandNo <= mInput->bandCount() || bandNo > 0 )
49  {
50  mBand = bandNo;
51  }
52 }
53 
55 {
56  mClassificationMin = min;
57  if ( auto *lShader = shader() )
58  {
59  QgsColorRampShader *colorRampShader = dynamic_cast<QgsColorRampShader *>( lShader->rasterShaderFunction() );
60  if ( colorRampShader )
61  {
62  colorRampShader->setMinimumValue( min );
63  }
64  }
65 }
66 
68 {
69  mClassificationMax = max;
70  if ( auto *lShader = shader() )
71  {
72  QgsColorRampShader *colorRampShader = dynamic_cast<QgsColorRampShader *>( lShader->rasterShaderFunction() );
73  if ( colorRampShader )
74  {
75  colorRampShader->setMaximumValue( max );
76  }
77  }
78 }
79 
81 {
82  QgsRasterShader *shader = nullptr;
83 
84  if ( mShader )
85  {
86  shader = new QgsRasterShader( mShader->minimumValue(), mShader->maximumValue() );
87 
88  // Shader function
89  const QgsColorRampShader *origColorRampShader = dynamic_cast<const QgsColorRampShader *>( mShader->rasterShaderFunction() );
90 
91  if ( origColorRampShader )
92  {
93  QgsColorRampShader *colorRampShader = new QgsColorRampShader( mShader->minimumValue(), mShader->maximumValue() );
94 
95  if ( origColorRampShader->sourceColorRamp() )
96  {
97  colorRampShader->setSourceColorRamp( origColorRampShader->sourceColorRamp()->clone() );
98  }
99  colorRampShader->setColorRampType( origColorRampShader->colorRampType() );
100  colorRampShader->setClassificationMode( origColorRampShader->classificationMode() );
101  colorRampShader->setClip( origColorRampShader->clip() );
102  colorRampShader->setColorRampItemList( origColorRampShader->colorRampItemList() );
103  shader->setRasterShaderFunction( colorRampShader );
104  }
105  }
107  renderer->copyCommonProperties( this );
108 
109  return renderer;
110 }
111 
113 {
114  mShader.reset( shader );
115 }
116 
117 void QgsSingleBandPseudoColorRenderer::createShader( QgsColorRamp *colorRamp, QgsColorRampShader::Type colorRampType, QgsColorRampShader::ClassificationMode classificationMode, int classes, bool clip, const QgsRectangle &extent )
118 {
119  if ( band() == -1 || classificationMin() >= classificationMax() )
120  {
121  return;
122  }
123 
124  QgsColorRampShader *colorRampShader = new QgsColorRampShader( classificationMin(), classificationMax(), colorRamp, colorRampType, classificationMode );
125  colorRampShader->classifyColorRamp( classes, band(), extent, input() );
126  colorRampShader->setClip( clip );
127 
128  QgsRasterShader *rasterShader = new QgsRasterShader();
129  rasterShader->setRasterShaderFunction( colorRampShader );
130  setShader( rasterShader );
131 }
132 
134 {
135  if ( elem.isNull() )
136  {
137  return nullptr;
138  }
139 
140  int band = elem.attribute( QStringLiteral( "band" ), QStringLiteral( "-1" ) ).toInt();
141  QgsRasterShader *shader = nullptr;
142  QDomElement rasterShaderElem = elem.firstChildElement( QStringLiteral( "rastershader" ) );
143  if ( !rasterShaderElem.isNull() )
144  {
145  shader = new QgsRasterShader();
146  shader->readXml( rasterShaderElem );
147  }
148 
150  r->readXml( elem );
151 
152  // TODO: add _readXML in superclass?
153  r->setClassificationMin( elem.attribute( QStringLiteral( "classificationMin" ), QStringLiteral( "NaN" ) ).toDouble() );
154  r->setClassificationMax( elem.attribute( QStringLiteral( "classificationMax" ), QStringLiteral( "NaN" ) ).toDouble() );
155 
156  // Backward compatibility with serialization of QGIS 2.X era
157  QString minMaxOrigin = elem.attribute( QStringLiteral( "classificationMinMaxOrigin" ) );
158  if ( !minMaxOrigin.isEmpty() )
159  {
160  if ( minMaxOrigin.contains( QLatin1String( "MinMax" ) ) )
161  {
163  }
164  else if ( minMaxOrigin.contains( QLatin1String( "CumulativeCut" ) ) )
165  {
167  }
168  else if ( minMaxOrigin.contains( QLatin1String( "StdDev" ) ) )
169  {
171  }
172  else
173  {
175  }
176 
177  if ( minMaxOrigin.contains( QLatin1String( "FullExtent" ) ) )
178  {
180  }
181  else if ( minMaxOrigin.contains( QLatin1String( "SubExtent" ) ) )
182  {
184  }
185  else
186  {
188  }
189 
190  if ( minMaxOrigin.contains( QLatin1String( "Estimated" ) ) )
191  {
193  }
194  else // if ( minMaxOrigin.contains( QLatin1String( "Exact" ) ) )
195  {
197  }
198  }
199 
200  return r;
201 }
202 
203 QgsRasterBlock *QgsSingleBandPseudoColorRenderer::block( int bandNo, QgsRectangle const &extent, int width, int height, QgsRasterBlockFeedback *feedback )
204 {
205  Q_UNUSED( bandNo )
206 
207  std::unique_ptr< QgsRasterBlock > outputBlock( new QgsRasterBlock() );
208  if ( !mInput || !mShader || !mShader->rasterShaderFunction() )
209  {
210  return outputBlock.release();
211  }
212 
213 
214  std::shared_ptr< QgsRasterBlock > inputBlock( mInput->block( mBand, extent, width, height, feedback ) );
215  if ( !inputBlock || inputBlock->isEmpty() )
216  {
217  QgsDebugMsg( QStringLiteral( "No raster data!" ) );
218  return outputBlock.release();
219  }
220 
221  //rendering is faster without considering user-defined transparency
222  bool hasTransparency = usesTransparency();
223 
224  std::shared_ptr< QgsRasterBlock > alphaBlock;
225  if ( mAlphaBand > 0 && mAlphaBand != mBand )
226  {
227  alphaBlock.reset( mInput->block( mAlphaBand, extent, width, height, feedback ) );
228  if ( !alphaBlock || alphaBlock->isEmpty() )
229  {
230  return outputBlock.release();
231  }
232  }
233  else if ( mAlphaBand == mBand )
234  {
235  alphaBlock = inputBlock;
236  }
237 
238  if ( !outputBlock->reset( Qgis::ARGB32_Premultiplied, width, height ) )
239  {
240  return outputBlock.release();
241  }
242 
243  const QRgb myDefaultColor = renderColorForNodataPixel();
244  QRgb *outputBlockData = outputBlock->colorData();
245  const QgsRasterShaderFunction *fcn = mShader->rasterShaderFunction();
246 
247  qgssize count = ( qgssize )width * height;
248  bool isNoData = false;
249  for ( qgssize i = 0; i < count; i++ )
250  {
251  double val = inputBlock->valueAndNoData( i, isNoData );
252  if ( isNoData )
253  {
254  outputBlockData[i] = myDefaultColor;
255  continue;
256  }
257 
258  int red, green, blue, alpha;
259  if ( !fcn->shade( val, &red, &green, &blue, &alpha ) )
260  {
261  outputBlockData[i] = myDefaultColor;
262  continue;
263  }
264 
265  if ( alpha < 255 )
266  {
267  // Working with premultiplied colors, so multiply values by alpha
268  red *= ( alpha / 255.0 );
269  blue *= ( alpha / 255.0 );
270  green *= ( alpha / 255.0 );
271  }
272 
273  if ( !hasTransparency )
274  {
275  outputBlockData[i] = qRgba( red, green, blue, alpha );
276  }
277  else
278  {
279  //opacity
280  double currentOpacity = mOpacity;
281  if ( mRasterTransparency )
282  {
283  currentOpacity = mRasterTransparency->alphaValue( val, mOpacity * 255 ) / 255.0;
284  }
285  if ( mAlphaBand > 0 )
286  {
287  currentOpacity *= alphaBlock->value( i ) / 255.0;
288  }
289 
290  outputBlockData[i] = qRgba( currentOpacity * red, currentOpacity * green, currentOpacity * blue, currentOpacity * alpha );
291  }
292  }
293 
294  return outputBlock.release();
295 }
296 
297 void QgsSingleBandPseudoColorRenderer::writeXml( QDomDocument &doc, QDomElement &parentElem ) const
298 {
299  if ( parentElem.isNull() )
300  {
301  return;
302  }
303 
304  QDomElement rasterRendererElem = doc.createElement( QStringLiteral( "rasterrenderer" ) );
305  _writeXml( doc, rasterRendererElem );
306  rasterRendererElem.setAttribute( QStringLiteral( "band" ), mBand );
307  if ( mShader )
308  {
309  mShader->writeXml( doc, rasterRendererElem ); //todo: include color ramp items directly in this renderer
310  }
311  rasterRendererElem.setAttribute( QStringLiteral( "classificationMin" ), QgsRasterBlock::printValue( mClassificationMin ) );
312  rasterRendererElem.setAttribute( QStringLiteral( "classificationMax" ), QgsRasterBlock::printValue( mClassificationMax ) );
313 
314  parentElem.appendChild( rasterRendererElem );
315 }
316 
317 QList< QPair< QString, QColor > > QgsSingleBandPseudoColorRenderer::legendSymbologyItems() const
318 {
319  QList< QPair< QString, QColor > > symbolItems;
320  if ( mShader )
321  {
322  QgsRasterShaderFunction *shaderFunction = mShader->rasterShaderFunction();
323  if ( shaderFunction )
324  {
325  shaderFunction->legendSymbologyItems( symbolItems );
326  }
327  }
328  return symbolItems;
329 }
330 
332 {
333  QList<int> bandList;
334  if ( mBand != -1 )
335  {
336  bandList << mBand;
337  }
338  return bandList;
339 }
340 
341 void QgsSingleBandPseudoColorRenderer::toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const
342 {
343  // create base structure
344  QgsRasterRenderer::toSld( doc, element, props );
345 
346  // look for RasterSymbolizer tag
347  QDomNodeList elements = element.elementsByTagName( QStringLiteral( "sld:RasterSymbolizer" ) );
348  if ( elements.size() == 0 )
349  return;
350 
351  // there SHOULD be only one
352  QDomElement rasterSymbolizerElem = elements.at( 0 ).toElement();
353 
354  // add Channel Selection tags
355  QDomElement channelSelectionElem = doc.createElement( QStringLiteral( "sld:ChannelSelection" ) );
356  rasterSymbolizerElem.appendChild( channelSelectionElem );
357 
358  // for the mapped band
359  QDomElement channelElem = doc.createElement( QStringLiteral( "sld:GrayChannel" ) );
360  channelSelectionElem.appendChild( channelElem );
361 
362  // set band
363  QDomElement sourceChannelNameElem = doc.createElement( QStringLiteral( "sld:SourceChannelName" ) );
364  sourceChannelNameElem.appendChild( doc.createTextNode( QString::number( band() ) ) );
365  channelElem.appendChild( sourceChannelNameElem );
366 
367  // add ColorMap tag
368  QDomElement colorMapElem = doc.createElement( QStringLiteral( "sld:ColorMap" ) );
369 
370  // set type of ColorMap ramp [ramp, intervals, values]
371  // basing on interpolation algorithm of the raster shader
372  QString rampType = QStringLiteral( "ramp" );
373  const QgsColorRampShader *rampShader = dynamic_cast<const QgsColorRampShader *>( mShader->rasterShaderFunction() );
374  if ( !rampShader )
375  return;
376 
377  switch ( rampShader->colorRampType() )
378  {
379  case ( QgsColorRampShader::Exact ):
380  rampType = QStringLiteral( "values" );
381  break;
383  rampType = QStringLiteral( "intervals" );
384  break;
386  rampType = QStringLiteral( "ramp" );
387  break;
388  }
389 
390  colorMapElem.setAttribute( QStringLiteral( "type" ), rampType );
391  if ( rampShader->colorRampItemList().size() >= 255 )
392  colorMapElem.setAttribute( QStringLiteral( "extended" ), QStringLiteral( "true" ) );
393  rasterSymbolizerElem.appendChild( colorMapElem );
394 
395  // for each color set a ColorMapEntry tag nested into "sld:ColorMap" tag
396  // e.g. <ColorMapEntry color="#EEBE2F" quantity="-300" label="label" opacity="0"/>
397  QList<QgsColorRampShader::ColorRampItem> classes = rampShader->colorRampItemList();
398  QList<QgsColorRampShader::ColorRampItem>::const_iterator classDataIt = classes.constBegin();
399  for ( ; classDataIt != classes.constEnd(); ++classDataIt )
400  {
401  QDomElement colorMapEntryElem = doc.createElement( QStringLiteral( "sld:ColorMapEntry" ) );
402  colorMapElem.appendChild( colorMapEntryElem );
403 
404  // set colorMapEntryElem attributes
405  colorMapEntryElem.setAttribute( QStringLiteral( "color" ), classDataIt->color.name() );
406  colorMapEntryElem.setAttribute( QStringLiteral( "quantity" ), classDataIt->value );
407  colorMapEntryElem.setAttribute( QStringLiteral( "label" ), classDataIt->label );
408  if ( classDataIt->color.alphaF() != 1.0 )
409  {
410  colorMapEntryElem.setAttribute( QStringLiteral( "opacity" ), QString::number( classDataIt->color.alphaF() ) );
411  }
412  }
413 }
414 
416 {
417  if ( const QgsColorRampShader *shader = dynamic_cast< const QgsColorRampShader * >( mShader->rasterShaderFunction() ) )
418  {
419  QgsStyleColorRampEntity entity( shader->sourceColorRamp() );
420  if ( !visitor->visit( QgsStyleEntityVisitorInterface::StyleLeaf( &entity ) ) )
421  return false;
422  }
423 
424  return true;
425 }
426 
427 QList<QgsLayerTreeModelLegendNode *> QgsSingleBandPseudoColorRenderer::createLegendNodes( QgsLayerTreeLayer *nodeLayer )
428 {
429  if ( !mShader )
430  return QList<QgsLayerTreeModelLegendNode *>();
431 
432  const QgsColorRampShader *rampShader = dynamic_cast<const QgsColorRampShader *>( mShader->rasterShaderFunction() );
433  if ( !rampShader )
434  return QList<QgsLayerTreeModelLegendNode *>();
435 
436  QList<QgsLayerTreeModelLegendNode *> res;
437 
438  const QString name = displayBandName( mBand );
439  if ( !name.isEmpty() )
440  {
441  res << new QgsSimpleLegendNode( nodeLayer, name );
442  }
443 
444  switch ( rampShader->colorRampType() )
445  {
447  // for interpolated shaders we use a ramp legend node unless the settings flag
448  // to use the continuous legend is not set, in that case we fall through
449  if ( ! rampShader->legendSettings() || rampShader->legendSettings()->useContinuousLegend() )
450  {
451  if ( !rampShader->colorRampItemList().isEmpty() )
452  {
453  res << new QgsColorRampLegendNode( nodeLayer, rampShader->createColorRamp(),
454  rampShader->legendSettings() ? *rampShader->legendSettings() : QgsColorRampLegendNodeSettings(),
455  rampShader->minimumValue(), rampShader->maximumValue() );
456  }
457  break;
458  }
459  Q_FALLTHROUGH();
462  {
463  // for all others we use itemised lists
464  const QList< QPair< QString, QColor > > items = legendSymbologyItems();
465  res.reserve( items.size() );
466  for ( const QPair< QString, QColor > &item : items )
467  {
468  res << new QgsRasterSymbolLegendNode( nodeLayer, item.second, item.first );
469  }
470  break;
471  }
472  }
473  return res;
474 }
@ ARGB32_Premultiplied
Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32_Premultiplied.
Definition: qgis.h:116
Settings for a color ramp legend node.
bool useContinuousLegend() const
Returns true if a continuous gradient legend will be used.
A legend node which renders a color ramp.
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
QList< QgsColorRampShader::ColorRampItem > colorRampItemList() const
Returns the custom colormap.
ClassificationMode classificationMode() const
Returns the classification mode.
const QgsColorRampLegendNodeSettings * legendSettings() const
Returns the color ramp shader legend settings.
Type colorRampType() const
Returns the color ramp type.
void setSourceColorRamp(QgsColorRamp *colorramp)
Set the source color ramp.
ClassificationMode
Classification modes used to create the color ramp shader.
void setClip(bool clip)
Sets whether the shader should not render values out of range.
bool clip() const
Returns whether the shader will clip values which are out of range.
QgsColorRamp * sourceColorRamp() const
Returns the source color ramp.
QgsColorRamp * createColorRamp() const
Creates a gradient color ramp from shader settings.
Type
Supported methods for color interpolation.
@ Interpolated
Interpolates the color between two class breaks linearly.
@ Discrete
Assigns the color of the higher class for every pixel between two class breaks.
@ Exact
Assigns the color of the exact matching value in the color ramp item list.
void setClassificationMode(ClassificationMode classificationMode)
Sets classification mode.
void classifyColorRamp(int classes=0, int band=-1, const QgsRectangle &extent=QgsRectangle(), QgsRasterInterface *input=nullptr)
Classify color ramp shader.
void setColorRampItemList(const QList< QgsColorRampShader::ColorRampItem > &list)
Sets a custom colormap.
void setColorRampType(QgsColorRampShader::Type colorRampType)
Sets the color ramp type.
Abstract base class for color ramps.
Definition: qgscolorramp.h:32
virtual QgsColorRamp * clone() const =0
Creates a clone of the color ramp.
Layer tree node points to a map layer.
Feedback object tailored for raster block reading.
Raster data container.
static QString printValue(double value)
Print double value with all necessary significant digits.
Base class for processing filters like renderers, reprojector, resampler etc.
virtual QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr)=0
Read block of data using given extent and size.
virtual QgsRasterInterface * input() const
Current input.
QString displayBandName(int bandNumber) const
Generates a friendly, descriptive name for the specified bandNumber.
QgsRasterInterface * mInput
virtual QgsRectangle extent() const
Gets the extent of the interface.
void setExtent(QgsRasterMinMaxOrigin::Extent extent)
Sets the extent.
@ Exact
Exact statistics.
@ Estimated
Approximated statistics.
void setLimits(QgsRasterMinMaxOrigin::Limits limits)
Sets the limits.
void setStatAccuracy(QgsRasterMinMaxOrigin::StatAccuracy accuracy)
Sets the statistics accuracy.
@ CurrentCanvas
Current extent of the canvas (at the time of computation) is used to compute statistics.
@ WholeRaster
Whole raster is used to compute statistics.
@ StdDev
Range is [ mean - stdDevFactor() * stddev, mean + stdDevFactor() * stddev ].
@ MinMax
Real min-max values.
@ CumulativeCut
Range is [ min + cumulativeCutLower() * (max - min), min + cumulativeCutUpper() * (max - min) ].
Raster renderer pipe that applies colors to a raster.
double mOpacity
Global alpha value (0-1)
int mAlphaBand
Read alpha value from band.
QRgb renderColorForNodataPixel() const
Returns the color for the renderer to use to represent nodata pixels.
void _writeXml(QDomDocument &doc, QDomElement &rasterRendererElem) const
Write upper class info into rasterrenderer element (called by writeXml method of subclasses)
int bandCount() const override
Gets number of bands.
QgsRasterMinMaxOrigin mMinMaxOrigin
Origin of min/max values.
QgsRasterTransparency * mRasterTransparency
Raster transparency per color or value. Overwrites global alpha value.
bool usesTransparency() const
void copyCommonProperties(const QgsRasterRenderer *other, bool copyMinMaxOrigin=true)
Copies common properties like opacity / transparency data from other renderer.
const QgsRasterMinMaxOrigin & minMaxOrigin() const
Returns const reference to origin of min/max values.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props=QVariantMap()) const
Used from subclasses to create SLD Rule elements following SLD v1.0 specs.
void readXml(const QDomElement &rendererElem) override
Sets base class members from xml. Usually called from create() methods of subclasses.
The raster shade function applies a shader to a pixel at render time - typically used to render grays...
virtual void legendSymbologyItems(QList< QPair< QString, QColor > > &symbolItems) const
Returns legend symbology items if provided by renderer.
double maximumValue() const
Returns the minimum value for the raster shader.
virtual bool shade(double value, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlpha) const
Generates an new RGBA value based on one input value.
virtual void setMaximumValue(double value)
Sets the maximum value for the raster shader.
virtual void setMinimumValue(double value)
Sets the minimum value for the raster shader.
double minimumValue() const
Returns the maximum value for the raster shader.
Interface for all raster shaders.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext())
Reads shader state from an XML element.
void setRasterShaderFunction(QgsRasterShaderFunction *function)
A public method that allows the user to set their own shader function.
Implementation of legend node interface for displaying raster legend entries.
int alphaValue(double value, int globalTransparency=255) const
Returns the transparency value for a single value pixel.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
Implementation of legend node interface for displaying arbitrary label with icon.
Raster renderer pipe for single band pseudocolor.
QgsSingleBandPseudoColorRenderer * clone() const override
Clone itself, create deep copy.
void createShader(QgsColorRamp *colorRamp=nullptr, QgsColorRampShader::Type colorRampType=QgsColorRampShader::Interpolated, QgsColorRampShader::ClassificationMode classificationMode=QgsColorRampShader::Continuous, int classes=0, bool clip=false, const QgsRectangle &extent=QgsRectangle())
Creates a color ramp shader.
QList< QPair< QString, QColor > > legendSymbologyItems() const override
Returns symbology items if provided by renderer.
void writeXml(QDomDocument &doc, QDomElement &parentElem) const override
Write base class members to xml.
int band() const
Returns the band used by the renderer.
QgsRasterShader * shader()
Returns the raster shader.
void setBand(int bandNo)
Sets the band used by the renderer.
void setShader(QgsRasterShader *shader)
Takes ownership of the shader.
QList< QgsLayerTreeModelLegendNode * > createLegendNodes(QgsLayerTreeLayer *nodeLayer) override
Creates a set of legend nodes representing the renderer.
QList< int > usesBands() const override
Returns a list of band numbers used by the renderer.
QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr) override
Read block of data using given extent and size.
QgsSingleBandPseudoColorRenderer(QgsRasterInterface *input, int band=-1, QgsRasterShader *shader=nullptr)
Note: takes ownership of QgsRasterShader.
static QgsRasterRenderer * create(const QDomElement &elem, QgsRasterInterface *input)
bool accept(QgsStyleEntityVisitorInterface *visitor) const override
Accepts the specified symbology visitor, causing it to visit all symbols associated with the renderer...
void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props=QVariantMap()) const override
Used from subclasses to create SLD Rule elements following SLD v1.0 specs.
A color ramp entity for QgsStyle databases.
Definition: qgsstyle.h:1233
An interface for classes which can visit style entity (e.g.
virtual bool visit(const QgsStyleEntityVisitorInterface::StyleLeaf &entity)
Called when the visitor will visit a style entity.
unsigned long long qgssize
Qgssize is used instead of size_t, because size_t is stdlib type, unknown by SIP, and it would be har...
Definition: qgis.h:769
#define QgsDebugMsg(str)
Definition: qgslogger.h:38
Contains information relating to the style entity currently being visited.