55 return mLineWidthUnit;
65 QDomElement elem = doc.createElement( QStringLiteral(
"mesh-settings" ) );
66 elem.setAttribute( QStringLiteral(
"enabled" ), mEnabled ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
67 elem.setAttribute( QStringLiteral(
"line-width" ), mLineWidth );
75 mEnabled = elem.attribute( QStringLiteral(
"enabled" ) ).toInt();
76 mLineWidth = elem.attribute( QStringLiteral(
"line-width" ) ).toDouble();
84 return mColorRampShader;
89 mColorRampShader = shader;
98 mClassificationMinimum = minimum;
99 mClassificationMaximum = maximum;
109 return mDataResamplingMethod;
114 mDataResamplingMethod = dataInterpolationMethod;
119 QDomElement elem = doc.createElement( QStringLiteral(
"scalar-settings" ) );
120 elem.setAttribute( QStringLiteral(
"min-val" ), mClassificationMinimum );
121 elem.setAttribute( QStringLiteral(
"max-val" ), mClassificationMaximum );
122 elem.setAttribute( QStringLiteral(
"opacity" ), mOpacity );
125 switch ( mDataResamplingMethod )
128 methodTxt = QStringLiteral(
"no-resampling" );
131 methodTxt = QStringLiteral(
"neighbour-average" );
134 elem.setAttribute( QStringLiteral(
"interpolation-method" ), methodTxt );
137 elem.setAttribute( QStringLiteral(
"range-extent" ),
qgsEnumValueToKey( mRangeExtent ) );
139 elem.setAttribute( QStringLiteral(
"range-limit" ),
qgsEnumValueToKey( mRangeLimit ) );
141 const QDomElement elemShader = mColorRampShader.
writeXml( doc, context );
142 elem.appendChild( elemShader );
144 QDomElement elemEdge = doc.createElement( QStringLiteral(
"edge-settings" ) );
145 elemEdge.appendChild( mEdgeStrokeWidth.
writeXml( doc, context ) );
146 elemEdge.setAttribute( QStringLiteral(
"stroke-width-unit" ),
static_cast< int >( mEdgeStrokeWidthUnit ) );
147 elem.appendChild( elemEdge );
154 mClassificationMinimum = elem.attribute( QStringLiteral(
"min-val" ) ).toDouble();
155 mClassificationMaximum = elem.attribute( QStringLiteral(
"max-val" ) ).toDouble();
156 mOpacity = elem.attribute( QStringLiteral(
"opacity" ) ).toDouble();
158 const QString methodTxt = elem.attribute( QStringLiteral(
"interpolation-method" ) );
159 if ( QStringLiteral(
"neighbour-average" ) == methodTxt )
171 const QDomElement elemShader = elem.firstChildElement( QStringLiteral(
"colorrampshader" ) );
172 mColorRampShader.
readXml( elemShader, context );
174 const QDomElement elemEdge = elem.firstChildElement( QStringLiteral(
"edge-settings" ) );
175 const QDomElement elemEdgeStrokeWidth = elemEdge.firstChildElement( QStringLiteral(
"mesh-stroke-width" ) );
176 mEdgeStrokeWidth.
readXml( elemEdgeStrokeWidth, context );
178 elemEdge.attribute( QStringLiteral(
"stroke-width-unit" ) ).toInt() );
183 return mEdgeStrokeWidth;
188 mEdgeStrokeWidth = strokeWidth;
193 return mEdgeStrokeWidthUnit;
201void QgsMeshRendererScalarSettings::updateShader()
207 if ( !mColorRampShader.
isEmpty() )
231 mColor = vectorColor;
241 mFilterMin = vectorFilterMin;
251 mFilterMax = vectorFilterMax;
256 return mOnUserDefinedGrid;
261 mOnUserDefinedGrid = enabled;
266 return mUserGridCellWidth;
271 mUserGridCellWidth = width;
276 return mUserGridCellHeight;
281 mUserGridCellHeight = height;
286 return mShaftLengthMethod;
296 return mMinShaftLength;
306 return mMaxShaftLength;
326 return mFixedShaftLength;
336 return mArrowHeadWidthRatio;
341 mArrowHeadWidthRatio = vectorHeadWidthRatio;
346 return mArrowHeadLengthRatio;
351 mArrowHeadLengthRatio = vectorHeadLengthRatio;
356 QDomElement elem = doc.createElement( QStringLiteral(
"vector-arrow-settings" ) );
357 elem.setAttribute( QStringLiteral(
"arrow-head-width-ratio" ), mArrowHeadWidthRatio );
358 elem.setAttribute( QStringLiteral(
"arrow-head-length-ratio" ), mArrowHeadLengthRatio );
360 QDomElement elemShaft = doc.createElement( QStringLiteral(
"shaft-length" ) );
362 switch ( mShaftLengthMethod )
365 methodTxt = QStringLiteral(
"minmax" );
366 elemShaft.setAttribute( QStringLiteral(
"min" ), mMinShaftLength );
367 elemShaft.setAttribute( QStringLiteral(
"max" ), mMaxShaftLength );
370 methodTxt = QStringLiteral(
"scaled" );
371 elemShaft.setAttribute( QStringLiteral(
"scale-factor" ), mScaleFactor );
374 methodTxt = QStringLiteral(
"fixed" ) ;
375 elemShaft.setAttribute( QStringLiteral(
"fixed-length" ), mFixedShaftLength );
378 elemShaft.setAttribute( QStringLiteral(
"method" ), methodTxt );
379 elem.appendChild( elemShaft );
385 mArrowHeadWidthRatio = elem.attribute( QStringLiteral(
"arrow-head-width-ratio" ) ).toDouble();
386 mArrowHeadLengthRatio = elem.attribute( QStringLiteral(
"arrow-head-length-ratio" ) ).toDouble();
388 const QDomElement elemShaft = elem.firstChildElement( QStringLiteral(
"shaft-length" ) );
389 const QString methodTxt = elemShaft.attribute( QStringLiteral(
"method" ) );
390 if ( QStringLiteral(
"minmax" ) == methodTxt )
392 mShaftLengthMethod =
MinMax;
393 mMinShaftLength = elemShaft.attribute( QStringLiteral(
"min" ) ).toDouble();
394 mMaxShaftLength = elemShaft.attribute( QStringLiteral(
"max" ) ).toDouble();
396 else if ( QStringLiteral(
"scaled" ) == methodTxt )
398 mShaftLengthMethod =
Scaled;
399 mScaleFactor = elemShaft.attribute( QStringLiteral(
"scale-factor" ) ).toDouble();
403 mShaftLengthMethod =
Fixed;
404 mFixedShaftLength = elemShaft.attribute( QStringLiteral(
"fixed-length" ) ).toDouble();
419 return mAveragingMethod.get();
425 mAveragingMethod.reset( method->
clone() );
427 mAveragingMethod.reset();
432 QDomElement elem = doc.createElement( QStringLiteral(
"mesh-renderer-settings" ) );
434 QDomElement elemActiveDatasetGroup = doc.createElement( QStringLiteral(
"active-dataset-group" ) );
435 elemActiveDatasetGroup.setAttribute( QStringLiteral(
"scalar" ), mActiveScalarDatasetGroup );
436 elemActiveDatasetGroup.setAttribute( QStringLiteral(
"vector" ), mActiveVectorDatasetGroup );
437 elem.appendChild( elemActiveDatasetGroup );
439 for (
auto groupIndex = mRendererScalarSettings.keyBegin(); groupIndex != mRendererScalarSettings.keyEnd(); groupIndex++ )
443 elemScalar.setAttribute( QStringLiteral(
"group" ), *groupIndex );
444 elem.appendChild( elemScalar );
447 for (
auto groupIndex = mRendererVectorSettings.keyBegin(); groupIndex != mRendererVectorSettings.keyEnd(); groupIndex++ )
451 elemVector.setAttribute( QStringLiteral(
"group" ), *groupIndex );
452 elem.appendChild( elemVector );
455 QDomElement elemNativeMesh = mRendererNativeMeshSettings.
writeXml( doc );
456 elemNativeMesh.setTagName( QStringLiteral(
"mesh-settings-native" ) );
457 elem.appendChild( elemNativeMesh );
459 QDomElement elemEdgeMesh = mRendererEdgeMeshSettings.
writeXml( doc );
460 elemEdgeMesh.setTagName( QStringLiteral(
"mesh-settings-edge" ) );
461 elem.appendChild( elemEdgeMesh );
463 QDomElement elemTriangularMesh = mRendererTriangularMeshSettings.
writeXml( doc );
464 elemTriangularMesh.setTagName( QStringLiteral(
"mesh-settings-triangular" ) );
465 elem.appendChild( elemTriangularMesh );
467 if ( mAveragingMethod )
469 QDomElement elemAveraging = doc.createElement( QStringLiteral(
"averaging-3d" ) );
470 elemAveraging.setAttribute( QStringLiteral(
"method" ), QString::number( mAveragingMethod->method() ) ) ;
471 const QDomElement elemAveragingParams = mAveragingMethod->writeXml( doc );
472 elemAveraging.appendChild( elemAveragingParams );
473 elem.appendChild( elemAveraging );
481 mRendererScalarSettings.clear();
482 mRendererVectorSettings.clear();
483 mAveragingMethod.reset();
485 const QDomElement elemActiveDataset = elem.firstChildElement( QStringLiteral(
"active-dataset-group" ) );
486 if ( elemActiveDataset.hasAttribute( QStringLiteral(
"scalar" ) ) )
487 mActiveScalarDatasetGroup = elemActiveDataset.attribute( QStringLiteral(
"scalar" ) ).toInt();
489 if ( elemActiveDataset.hasAttribute( QStringLiteral(
"vector" ) ) )
490 mActiveVectorDatasetGroup = elemActiveDataset.attribute( QStringLiteral(
"vector" ) ).toInt();
492 QDomElement elemScalar = elem.firstChildElement( QStringLiteral(
"scalar-settings" ) );
493 while ( !elemScalar.isNull() )
495 const int groupIndex = elemScalar.attribute( QStringLiteral(
"group" ) ).toInt();
500 elemScalar = elemScalar.nextSiblingElement( QStringLiteral(
"scalar-settings" ) );
503 QDomElement elemVector = elem.firstChildElement( QStringLiteral(
"vector-settings" ) );
504 while ( !elemVector.isNull() )
506 const int groupIndex = elemVector.attribute( QStringLiteral(
"group" ) ).toInt();
511 elemVector = elemVector.nextSiblingElement( QStringLiteral(
"vector-settings" ) );
514 const QDomElement elemNativeMesh = elem.firstChildElement( QStringLiteral(
"mesh-settings-native" ) );
515 mRendererNativeMeshSettings.
readXml( elemNativeMesh );
517 const QDomElement elemEdgeMesh = elem.firstChildElement( QStringLiteral(
"mesh-settings-edge" ) );
518 mRendererEdgeMeshSettings.
readXml( elemEdgeMesh );
520 const QDomElement elemTriangularMesh = elem.firstChildElement( QStringLiteral(
"mesh-settings-triangular" ) );
521 mRendererTriangularMeshSettings.
readXml( elemTriangularMesh );
523 const QDomElement elemAveraging = elem.firstChildElement( QStringLiteral(
"averaging-3d" ) );
524 if ( !elemAveraging.isNull() )
532 return mActiveScalarDatasetGroup;
542 return mActiveVectorDatasetGroup;
552 return mSeedingMethod;
562 return mSeedingDensity;
572 QDomElement elem = doc.createElement( QStringLiteral(
"vector-streamline-settings" ) );
574 elem.setAttribute( QStringLiteral(
"seeding-method" ), mSeedingMethod );
575 elem.setAttribute( QStringLiteral(
"seeding-density" ), mSeedingDensity );
584 elem.attribute( QStringLiteral(
"seeding-method" ) ).toInt() );
585 mSeedingDensity = elem.attribute( QStringLiteral(
"seeding-density" ) ).toDouble();
590 return mDisplayingMethod;
595 mDisplayingMethod = displayingMethod;
600 return mArrowsSettings;
610 return mStreamLinesSettings;
620 QDomElement elem = doc.createElement( QStringLiteral(
"vector-settings" ) );
621 elem.setAttribute( QStringLiteral(
"symbology" ), mDisplayingMethod );
623 elem.setAttribute( QStringLiteral(
"line-width" ), mLineWidth );
624 elem.setAttribute( QStringLiteral(
"coloring-method" ),
coloringMethod() );
626 const QDomElement elemShader = mColorRampShader.
writeXml( doc, context );
627 elem.appendChild( elemShader );
628 elem.setAttribute( QStringLiteral(
"filter-min" ), mFilterMin );
629 elem.setAttribute( QStringLiteral(
"filter-max" ), mFilterMax );
631 elem.setAttribute( QStringLiteral(
"user-grid-enabled" ), mOnUserDefinedGrid ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
632 elem.setAttribute( QStringLiteral(
"user-grid-width" ), mUserGridCellWidth );
633 elem.setAttribute( QStringLiteral(
"user-grid-height" ), mUserGridCellHeight );
635 elem.appendChild( mArrowsSettings.
writeXml( doc ) );
636 elem.appendChild( mStreamLinesSettings.
writeXml( doc ) );
637 elem.appendChild( mTracesSettings.
writeXml( doc ) );
638 elem.appendChild( mWindBarbSettings.
writeXml( doc ) );
646 elem.attribute( QStringLiteral(
"symbology" ) ).toInt() );
648 mLineWidth = elem.attribute( QStringLiteral(
"line-width" ) ).toDouble();
650 elem.attribute( QStringLiteral(
"coloring-method" ) ).toInt() );
652 mColorRampShader.
readXml( elem.firstChildElement(
"colorrampshader" ), context );
653 mFilterMin = elem.attribute( QStringLiteral(
"filter-min" ) ).toDouble();
654 mFilterMax = elem.attribute( QStringLiteral(
"filter-max" ) ).toDouble();
656 mOnUserDefinedGrid = elem.attribute( QStringLiteral(
"user-grid-enabled" ) ).toInt();
657 mUserGridCellWidth = elem.attribute( QStringLiteral(
"user-grid-width" ) ).toInt();
658 mUserGridCellHeight = elem.attribute( QStringLiteral(
"user-grid-height" ) ).toInt();
660 const QDomElement elemVector = elem.firstChildElement( QStringLiteral(
"vector-arrow-settings" ) );
661 if ( ! elemVector.isNull() )
662 mArrowsSettings.
readXml( elemVector );
664 const QDomElement elemStreamLine = elem.firstChildElement( QStringLiteral(
"vector-streamline-settings" ) );
665 if ( ! elemStreamLine.isNull() )
666 mStreamLinesSettings.
readXml( elemStreamLine );
668 const QDomElement elemTraces = elem.firstChildElement( QStringLiteral(
"vector-traces-settings" ) );
669 if ( ! elemTraces.isNull() )
670 mTracesSettings.
readXml( elemTraces );
672 const QDomElement elemWindBarb = elem.firstChildElement( QStringLiteral(
"vector-windbarb-settings" ) );
673 if ( ! elemWindBarb.isNull() )
674 mWindBarbSettings.
readXml( elemWindBarb );
679 return mColoringMethod;
689 return mColorRampShader;
700 switch ( mColoringMethod )
710 return strokeColoring;
715 return mTracesSettings;
725 mMaximumTailLength = elem.attribute( QStringLiteral(
"maximum-tail-length" ) ).toInt();
727 elem.attribute( QStringLiteral(
"maximum-tail-length-unit" ) ).toInt() );
728 mParticlesCount = elem.attribute( QStringLiteral(
"particles-count" ) ).toInt();
733 QDomElement elem = doc.createElement( QStringLiteral(
"vector-traces-settings" ) );
734 elem.setAttribute( QStringLiteral(
"maximum-tail-length" ), mMaximumTailLength );
735 elem.setAttribute( QStringLiteral(
"maximum-tail-length-unit" ),
static_cast< int >( mMaximumTailLengthUnit ) );
736 elem.setAttribute( QStringLiteral(
"particles-count" ), mParticlesCount );
743 return mMaximumTailLengthUnit;
753 return mMaximumTailLength;
763 return mParticlesCount;
768 mParticlesCount = value;
773 return mRendererScalarSettings.contains( datasetGroupIndex ) || mRendererVectorSettings.contains( datasetGroupIndex );
778 return mWindBarbSettings;
788 mShaftLength = elem.attribute( QStringLiteral(
"shaft-length" ), QStringLiteral(
"10" ) ).toDouble();
790 elem.attribute( QStringLiteral(
"shaft-length-units" ) ).toInt() );
791 mMagnitudeMultiplier = elem.attribute( QStringLiteral(
"magnitude-multiplier" ), QStringLiteral(
"1" ) ).toDouble();
793 elem.attribute( QStringLiteral(
"magnitude-units" ), QStringLiteral(
"0" ) ).toInt() );
798 QDomElement elem = doc.createElement( QStringLiteral(
"vector-windbarb-settings" ) );
799 elem.setAttribute( QStringLiteral(
"shaft-length" ), mShaftLength );
800 elem.setAttribute( QStringLiteral(
"shaft-length-units" ),
static_cast< int >( mShaftLengthUnits ) );
801 elem.setAttribute( QStringLiteral(
"magnitude-multiplier" ), mMagnitudeMultiplier );
802 elem.setAttribute( QStringLiteral(
"magnitude-units" ),
static_cast< int >( mMagnitudeUnits ) );
808 switch ( mMagnitudeUnits )
813 return 3600.0 / 1852.0;
817 return 1.609344 / 1.852;
819 return 3600.0 / 1.852 / 5280.0 * 1.609344 ;
821 return mMagnitudeMultiplier;
843 return mShaftLengthUnits;
848 mShaftLengthUnits = shaftLengthUnit;
853 return mMagnitudeUnits;
858 mMagnitudeUnits = units;
@ WholeMesh
Whole mesh is used to compute statistics.
RenderUnit
Rendering size units.
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
bool isEmpty() const
Whether the color ramp contains any items.
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const
Writes configuration to a new DOM element.
QgsColorRamp * sourceColorRamp() const
Returns the source color ramp.
void classifyColorRamp(int classes=0, int band=-1, const QgsRectangle &extent=QgsRectangle(), QgsRasterInterface *input=nullptr)
Classify color ramp shader.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext())
Reads configuration from the given DOM element.
virtual int count() const =0
Returns number of defined colors, or -1 if undefined.
static QColor colorFromString(const QString &string)
Decodes a string into a color value.
static QString colorToString(const QColor &color)
Encodes a color into a string value.
Class defining color to render mesh datasets.
ColoringMethod
Defines how the color is defined.
@ ColorRamp
Render with a color ramp.
@ SingleColor
Render with a single color.
Represents a width than can vary depending on values.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context)
Reads configuration from the given DOM element.
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context) const
Writes configuration to a new DOM element.
Abstract class to interpolate 3d stacked mesh data to 2d data.
static QgsMesh3DAveragingMethod * createFromXml(const QDomElement &elem)
Creates the instance from XML by calling readXml of derived classes.
virtual QgsMesh3DAveragingMethod * clone() const =0
Clone the instance.
void setLineWidthUnit(Qgis::RenderUnit lineWidthUnit)
Sets units of the width of the mesh frame.
void setEnabled(bool enabled)
Sets whether mesh structure rendering is enabled.
QColor color() const
Returns color used for rendering.
QDomElement writeXml(QDomDocument &doc) const
Writes configuration to a new DOM element.
double lineWidth() const
Returns line width used for rendering (in millimeters)
void setLineWidth(double lineWidth)
Sets line width used for rendering (in millimeters)
void readXml(const QDomElement &elem)
Reads configuration from the given DOM element.
Qgis::RenderUnit lineWidthUnit() const
Returns units of the width of the mesh frame.
bool isEnabled() const
Returns whether mesh structure rendering is enabled.
void setColor(const QColor &color)
Sets color used for rendering of the mesh.
Represents a mesh renderer settings for scalar datasets.
void setClassificationMinimumMaximum(double minimum, double maximum)
Sets min/max values used for creation of the color ramp shader.
double opacity() const
Returns opacity.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext())
Reads configuration from the given DOM element.
void setEdgeStrokeWidthUnit(Qgis::RenderUnit edgeStrokeWidthUnit)
Sets the stroke width unit used to render edges scalar dataset.
void setColorRampShader(const QgsColorRampShader &shader)
Sets color ramp shader function.
QgsColorRampShader colorRampShader() const
Returns color ramp shader function.
double classificationMinimum() const
Returns min value used for creation of the color ramp shader.
void setOpacity(double opacity)
Sets opacity.
DataResamplingMethod
Resampling of value from dataset.
@ NoResampling
Does not use resampling.
@ NeighbourAverage
Does a simple average of values defined for all surrounding faces/vertices.
Qgis::RenderUnit edgeStrokeWidthUnit() const
Returns the stroke width unit used to render edges scalar dataset.
DataResamplingMethod dataResamplingMethod() const
Returns the type of interpolation to use to convert face defined datasets to values on vertices.
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const
Writes configuration to a new DOM element.
void setEdgeStrokeWidth(const QgsInterpolatedLineWidth &strokeWidth)
Sets the stroke width used to render edges scalar dataset.
double classificationMaximum() const
Returns max value used for creation of the color ramp shader.
QgsInterpolatedLineWidth edgeStrokeWidth() const
Returns the stroke width used to render edges scalar dataset.
void setDataResamplingMethod(const DataResamplingMethod &dataResamplingMethod)
Sets data interpolation method.
void setAveragingMethod(QgsMesh3DAveragingMethod *method)
Sets averaging method for conversion of 3d stacked mesh data to 2d data.
void setActiveVectorDatasetGroup(int activeVectorDatasetGroup)
Sets the active vector dataset group.
QgsMeshRendererScalarSettings scalarSettings(int groupIndex) const
Returns renderer settings.
int activeVectorDatasetGroup() const
Returns the active vector dataset group.
QgsMesh3DAveragingMethod * averagingMethod() const
Returns averaging method for conversion of 3d stacked mesh data to 2d data.
bool hasSettings(int datasetGroupIndex) const
Returns whether the group with index has render settings (scalar or vector)
int activeScalarDatasetGroup() const
Returns the active scalar dataset group.
QgsMeshRendererVectorSettings vectorSettings(int groupIndex) const
Returns renderer settings.
void setActiveScalarDatasetGroup(int activeScalarDatasetGroup)
Sets the active scalar dataset group.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext())
Reads configuration from the given DOM element.
QgsMeshRendererSettings()
Constructs renderer with default single layer averaging method.
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const
Writes configuration to a new DOM element.
~QgsMeshRendererSettings()
Represents a mesh renderer settings for vector datasets displayed with arrows.
void setFixedShaftLength(double fixedShaftLength)
Sets fixed length (in millimeters)
void setMaxShaftLength(double maxShaftLength)
Sets maximum shaft length (in millimeters)
QgsMeshRendererVectorArrowSettings::ArrowScalingMethod shaftLengthMethod() const
Returns method used for drawing arrows.
void setMinShaftLength(double minShaftLength)
Sets mininimum shaft length (in millimeters)
double fixedShaftLength() const
Returns fixed arrow length (in millimeters)
void setArrowHeadWidthRatio(double arrowHeadWidthRatio)
Sets ratio of the head width of the arrow (range 0-1)
double scaleFactor() const
Returns scale factor.
double maxShaftLength() const
Returns maximum shaft length (in millimeters)
double arrowHeadWidthRatio() const
Returns ratio of the head width of the arrow (range 0-1)
void setArrowHeadLengthRatio(double arrowHeadLengthRatio)
Sets ratio of the head length of the arrow (range 0-1)
void readXml(const QDomElement &elem)
Reads configuration from the given DOM element.
void setScaleFactor(double scaleFactor)
Sets scale factor.
void setShaftLengthMethod(ArrowScalingMethod shaftLengthMethod)
Sets method used for drawing arrows.
ArrowScalingMethod
Algorithm how to transform vector magnitude to length of arrow on the device in pixels.
@ Scaled
Scale vector magnitude by factor scaleFactor()
@ MinMax
Scale vector magnitude linearly to fit in range of vectorFilterMin() and vectorFilterMax()
@ Fixed
Use fixed length fixedShaftLength() regardless of vector's magnitude.
double minShaftLength() const
Returns mininimum shaft length (in millimeters)
QDomElement writeXml(QDomDocument &doc) const
Writes configuration to a new DOM element.
double arrowHeadLengthRatio() const
Returns ratio of the head length of the arrow (range 0-1)
Represents a renderer settings for vector datasets.
void setColorRampShader(const QgsColorRampShader &colorRampShader)
Returns the color ramp shader used to render vector datasets.
void setStreamLinesSettings(const QgsMeshRendererVectorStreamlineSettings &streamLinesSettings)
Sets settings for vector rendered with streamlines.
int userGridCellWidth() const
Returns width in pixels of user grid cell.
void setArrowsSettings(const QgsMeshRendererVectorArrowSettings &arrowSettings)
Sets settings for vector rendered with arrows.
void setUserGridCellWidth(int width)
Sets width of user grid cell (in pixels)
void setColor(const QColor &color)
Sets color used for drawing arrows.
QgsMeshRendererVectorTracesSettings tracesSettings() const
Returns settings for vector rendered with traces.
QColor color() const
Returns color used for drawing arrows.
int userGridCellHeight() const
Returns height in pixels of user grid cell.
void setOnUserDefinedGrid(bool enabled)
Toggles drawing of vectors on user defined grid.
double lineWidth() const
Returns line width of the arrow (in millimeters)
Symbology
Defines the symbology of vector rendering.
void setUserGridCellHeight(int height)
Sets height of user grid cell (in pixels)
Symbology symbology() const
Returns the displaying method used to render vector datasets.
double filterMax() const
Returns filter value for vector magnitudes.
QgsColorRampShader colorRampShader() const
Sets the color ramp shader used to render vector datasets.
void setSymbology(const Symbology &symbology)
Sets the displaying method used to render vector datasets.
void setFilterMin(double filterMin)
Sets filter value for vector magnitudes.
QgsMeshRendererVectorArrowSettings arrowSettings() const
Returns settings for vector rendered with arrows.
void setFilterMax(double filterMax)
Sets filter value for vector magnitudes.
QgsInterpolatedLineColor vectorStrokeColoring() const
Returns the stroke coloring used to render vector datasets.
void setTracesSettings(const QgsMeshRendererVectorTracesSettings &tracesSettings)
Sets settings for vector rendered with traces.
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const
Writes configuration to a new DOM element.
void setColoringMethod(const QgsInterpolatedLineColor::ColoringMethod &coloringMethod)
Sets the coloring method used to render vector datasets.
QgsInterpolatedLineColor::ColoringMethod coloringMethod() const
Returns the coloring method used to render vector datasets.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext())
Reads configuration from the given DOM element.
QgsMeshRendererVectorWindBarbSettings windBarbSettings() const
Returns settings for vector rendered with wind barbs.
void setLineWidth(double lineWidth)
Sets line width of the arrow in pixels (in millimeters)
bool isOnUserDefinedGrid() const
Returns whether vectors are drawn on user-defined grid.
double filterMin() const
Returns filter value for vector magnitudes.
void setWindBarbSettings(const QgsMeshRendererVectorWindBarbSettings &windBarbSettings)
Sets settings for vector rendered with wind barbs.
QgsMeshRendererVectorStreamlineSettings streamLinesSettings() const
Returns settings for vector rendered with streamlines.
Represents a streamline renderer settings for vector datasets displayed by streamlines.
void setSeedingDensity(double seedingDensity)
Sets the density used for seeding start points.
SeedingStartPointsMethod seedingMethod() const
Returns the method used for seeding start points of strealines.
void setSeedingMethod(const SeedingStartPointsMethod &seedingMethod)
Sets the method used for seeding start points of strealines.
QDomElement writeXml(QDomDocument &doc) const
Writes configuration to a new DOM element.
SeedingStartPointsMethod
Method used to define start points that are used to draw streamlines.
void readXml(const QDomElement &elem)
Reads configuration from the given DOM element.
double seedingDensity() const
Returns the density used for seeding start points.
Represents a trace renderer settings for vector datasets displayed by particle traces.
Qgis::RenderUnit maximumTailLengthUnit() const
Returns the maximum tail length unit.
void setMaximumTailLength(double maximumTailLength)
Sets the maximums tail length.
QDomElement writeXml(QDomDocument &doc) const
Writes configuration to a new DOM element.
void readXml(const QDomElement &elem)
Reads configuration from the given DOM element.
void setMaximumTailLengthUnit(Qgis::RenderUnit maximumTailLengthUnit)
Sets the maximum tail length unit.
double maximumTailLength() const
Returns the maximum tail length.
int particlesCount() const
Returns particles count.
void setParticlesCount(int value)
Sets particles count.
Represents a mesh renderer settings for vector datasets displayed with wind barbs.
void readXml(const QDomElement &elem)
Reads configuration from the given DOM element.
void setShaftLengthUnits(Qgis::RenderUnit shaftLengthUnit)
Sets the units for the shaft length.
WindSpeedUnit magnitudeUnits() const
Returns the units that the data are in.
void setMagnitudeUnits(WindSpeedUnit units)
Sets the units that the data are in.
void setMagnitudeMultiplier(double magnitudeMultiplier)
Sets a multiplier for the magnitude to convert it to knots.
double shaftLength() const
Returns the shaft length (in millimeters)
void setShaftLength(double shaftLength)
Sets the shaft length (in millimeters)
Qgis::RenderUnit shaftLengthUnits() const
Returns the units for the shaft length.
QDomElement writeXml(QDomDocument &doc) const
Writes configuration to a new DOM element.
WindSpeedUnit
Wind speed units. Wind barbs use knots so we use this enum for preset conversion values.
@ FeetPerSecond
Feet per second.
@ KilometersPerHour
Kilometers per hour.
@ Knots
Knots (Nautical miles per hour)
@ MilesPerHour
Miles per hour.
@ MetersPerSecond
Meters per second.
double magnitudeMultiplier() const
Returns the multiplier for the magnitude to convert it to knots, according to the units set with setM...
Sigma averages over the values between 0 (bed level) and 1 (surface).
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.
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
static Q_INVOKABLE Qgis::RenderUnit decodeRenderUnit(const QString &string, bool *ok=nullptr)
Decodes a render unit from a string.
static Q_INVOKABLE QString encodeUnit(Qgis::DistanceUnit unit)
Encodes a distance unit to a string.
T qgsEnumKeyToValue(const QString &key, const T &defaultValue, bool tryValueAsKey=true, bool *returnOk=nullptr)
Returns the value corresponding to the given key of an enum.
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.