QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
Public Types | Public Member Functions | List of all members
QgsInterpolatedLineColor Class Reference

Class defining color to render mesh datasets. More...

#include <qgsinterpolatedlinerenderer.h>

Public Types

enum  ColoringMethod { SingleColor = 0 , ColorRamp }
 Defines how the color is defined. More...
 

Public Member Functions

 QgsInterpolatedLineColor ()
 Default constructor. More...
 
 QgsInterpolatedLineColor (const QColor &color)
 Constructor with fixed color. More...
 
 QgsInterpolatedLineColor (const QgsColorRampShader &colorRampShader)
 Constructor with variable color depending on magnitude. More...
 
QColor color (double magnitude) const
 Returns the color corresponding to the magnitude. More...
 
QgsInterpolatedLineColor::ColoringMethod coloringMethod () const
 Returns the coloring method used. More...
 
QgsColorRampShader colorRampShader () const
 Returns the color ramp shader. More...
 
void graduatedColors (double value1, double value2, QList< double > &breakValues, QList< QColor > &breakColors, QList< QLinearGradient > &gradients) const
 Returns the break values, graduated colors and the associated gradients between two values. More...
 
void readXml (const QDomElement &elem, const QgsReadWriteContext &context)
 Reads configuration from the given DOM element. More...
 
void setColor (const QColor &color)
 Sets the single color to define the coloring. More...
 
void setColor (const QgsColorRampShader &colorRampShader)
 Sets the color ramp to define the coloring. More...
 
void setColoringMethod (ColoringMethod coloringMethod)
 Sets the coloring method used. More...
 
QColor singleColor () const
 Returns the single color that is used if SingleColor coloring mode is set. More...
 
QDomElement writeXml (QDomDocument &doc, const QgsReadWriteContext &context) const
 Writes configuration to a new DOM element. More...
 

Detailed Description

Class defining color to render mesh datasets.

The color can vary depending on the dataset value.

Since
QGIS 3.14

Definition at line 38 of file qgsinterpolatedlinerenderer.h.

Member Enumeration Documentation

◆ ColoringMethod

Defines how the color is defined.

Enumerator
SingleColor 

Render with a single color.

ColorRamp 

Render with a color ramp.

Definition at line 45 of file qgsinterpolatedlinerenderer.h.

Constructor & Destructor Documentation

◆ QgsInterpolatedLineColor() [1/3]

QgsInterpolatedLineColor::QgsInterpolatedLineColor ( )

Default constructor.

Definition at line 436 of file qgsinterpolatedlinerenderer.cpp.

◆ QgsInterpolatedLineColor() [2/3]

QgsInterpolatedLineColor::QgsInterpolatedLineColor ( const QgsColorRampShader colorRampShader)

Constructor with variable color depending on magnitude.

Definition at line 442 of file qgsinterpolatedlinerenderer.cpp.

◆ QgsInterpolatedLineColor() [3/3]

QgsInterpolatedLineColor::QgsInterpolatedLineColor ( const QColor &  color)

Constructor with fixed color.

Definition at line 447 of file qgsinterpolatedlinerenderer.cpp.

Member Function Documentation

◆ color()

QColor QgsInterpolatedLineColor::color ( double  magnitude) const

Returns the color corresponding to the magnitude.

Definition at line 469 of file qgsinterpolatedlinerenderer.cpp.

◆ coloringMethod()

QgsInterpolatedLineColor::ColoringMethod QgsInterpolatedLineColor::coloringMethod ( ) const

Returns the coloring method used.

Definition at line 489 of file qgsinterpolatedlinerenderer.cpp.

◆ colorRampShader()

QgsColorRampShader QgsInterpolatedLineColor::colorRampShader ( ) const

Returns the color ramp shader.

Definition at line 494 of file qgsinterpolatedlinerenderer.cpp.

◆ graduatedColors()

void QgsInterpolatedLineColor::graduatedColors ( double  value1,
double  value2,
QList< double > &  breakValues,
QList< QColor > &  breakColors,
QList< QLinearGradient > &  gradients 
) const

Returns the break values, graduated colors and the associated gradients between two values.

  • If the color is fixed or only one color for the interval (value1, value2), returns only one color in breakColors and void lists for breakValues, gradients
  • If the color ramp is classified with 'exact', returns void gradients
  • If the color ramp is classified with 'discrete', return gradients with uniform colors
  • if nothing to render (out of range), return all lists void

Definition at line 525 of file qgsinterpolatedlinerenderer.cpp.

◆ readXml()

void QgsInterpolatedLineColor::readXml ( const QDomElement &  elem,
const QgsReadWriteContext context 
)

Reads configuration from the given DOM element.

Definition at line 515 of file qgsinterpolatedlinerenderer.cpp.

◆ setColor() [1/2]

void QgsInterpolatedLineColor::setColor ( const QColor &  color)

Sets the single color to define the coloring.

Definition at line 464 of file qgsinterpolatedlinerenderer.cpp.

◆ setColor() [2/2]

void QgsInterpolatedLineColor::setColor ( const QgsColorRampShader colorRampShader)

Sets the color ramp to define the coloring.

Definition at line 455 of file qgsinterpolatedlinerenderer.cpp.

◆ setColoringMethod()

void QgsInterpolatedLineColor::setColoringMethod ( QgsInterpolatedLineColor::ColoringMethod  coloringMethod)

Sets the coloring method used.

Since
QGIS 3.20

Definition at line 551 of file qgsinterpolatedlinerenderer.cpp.

◆ singleColor()

QColor QgsInterpolatedLineColor::singleColor ( ) const

Returns the single color that is used if SingleColor coloring mode is set.

Since
QGIS 3.20

Definition at line 499 of file qgsinterpolatedlinerenderer.cpp.

◆ writeXml()

QDomElement QgsInterpolatedLineColor::writeXml ( QDomDocument &  doc,
const QgsReadWriteContext context 
) const

Writes configuration to a new DOM element.

Definition at line 504 of file qgsinterpolatedlinerenderer.cpp.


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