18#ifndef QGSMESHRENDERERSETTINGS_H
19#define QGSMESHRENDERERSETTINGS_H
43 bool isEnabled()
const;
45 void setEnabled(
bool enabled );
48 double lineWidth()
const;
50 void setLineWidth(
double lineWidth );
55 void setColor(
const QColor &color );
72 QDomElement writeXml( QDomDocument &doc )
const;
74 void readXml(
const QDomElement &elem );
77 bool mEnabled =
false;
80 QColor mColor = Qt::black;
123 double classificationMinimum()
const;
125 double classificationMaximum()
const;
127 void setClassificationMinimumMaximum(
double minimum,
double maximum );
130 double opacity()
const;
132 void setOpacity(
double opacity );
141 DataResamplingMethod dataResamplingMethod()
const;
148 void setDataResamplingMethod(
const DataResamplingMethod &dataResamplingMethod );
228 DataResamplingMethod mDataResamplingMethod = DataResamplingMethod::NoResampling;
229 double mClassificationMinimum = 0;
230 double mClassificationMaximum = 0;
276 void setShaftLengthMethod( ArrowScalingMethod shaftLengthMethod );
283 double minShaftLength()
const;
290 void setMinShaftLength(
double minShaftLength );
297 double maxShaftLength()
const;
304 void setMaxShaftLength(
double maxShaftLength );
311 double scaleFactor()
const;
318 void setScaleFactor(
double scaleFactor );
325 double fixedShaftLength()
const;
332 void setFixedShaftLength(
double fixedShaftLength );
335 double arrowHeadWidthRatio()
const;
337 void setArrowHeadWidthRatio(
double arrowHeadWidthRatio );
340 double arrowHeadLengthRatio()
const;
342 void setArrowHeadLengthRatio(
double arrowHeadLengthRatio );
345 QDomElement writeXml( QDomDocument &doc )
const;
347 void readXml(
const QDomElement &elem );
351 double mMinShaftLength = 0.8;
352 double mMaxShaftLength = 10;
353 double mScaleFactor = 10;
354 double mFixedShaftLength = 20;
355 double mArrowHeadWidthRatio = 0.15;
356 double mArrowHeadLengthRatio = 0.40;
387 SeedingStartPointsMethod seedingMethod()
const;
389 void setSeedingMethod(
const SeedingStartPointsMethod &seedingMethod );
391 double seedingDensity()
const;
393 void setSeedingDensity(
double seedingDensity );
395 void readXml(
const QDomElement &elem );
397 QDomElement writeXml( QDomDocument &doc )
const;
402 double mSeedingDensity = 0.15;
419 double maximumTailLength()
const;
421 void setMaximumTailLength(
double maximumTailLength );
423 int particlesCount()
const;
425 void setParticlesCount(
int value );
432 void readXml(
const QDomElement &elem );
434 QDomElement writeXml( QDomDocument &doc )
const;
437 int mParticlesCount = 1000;
438 double mMaximumTailLength = 100;
470 double magnitudeMultiplier()
const;
475 void setMagnitudeMultiplier(
double magnitudeMultiplier );
480 double shaftLength()
const;
485 void setShaftLength(
double shaftLength );
504 WindSpeedUnit magnitudeUnits()
const;
509 void setMagnitudeUnits( WindSpeedUnit units );
512 QDomElement writeXml( QDomDocument &doc )
const;
514 void readXml(
const QDomElement &elem );
517 double mShaftLength = 10;
519 WindSpeedUnit mMagnitudeUnits = WindSpeedUnit::MetersPerSecond;
520 double mMagnitudeMultiplier = 1;
553 double lineWidth()
const;
555 void setLineWidth(
double lineWidth );
558 QColor color()
const;
560 void setColor(
const QColor &color );
568 double filterMin()
const;
574 void setFilterMin(
double filterMin );
582 double filterMax()
const;
588 void setFilterMax(
double filterMax );
591 bool isOnUserDefinedGrid()
const;
593 void setOnUserDefinedGrid(
bool enabled );
595 int userGridCellWidth()
const;
597 void setUserGridCellWidth(
int width );
599 int userGridCellHeight()
const;
601 void setUserGridCellHeight(
int height );
607 Symbology symbology()
const;
613 void setSymbology(
const Symbology &symbology );
700 Symbology mDisplayingMethod = Arrows;
704 QColor mColor = Qt::black;
706 double mFilterMin = -1;
707 double mFilterMax = -1;
708 int mUserGridCellWidth = 10;
709 int mUserGridCellHeight = 10;
710 bool mOnUserDefinedGrid =
false;
769 bool hasScalarSettings(
int groupIndex )
const {
return mRendererScalarSettings.contains( groupIndex );}
786 bool hasVectorSettings(
int groupIndex )
const {
return mRendererVectorSettings.contains( groupIndex );}
817 int activeScalarDatasetGroup()
const;
823 void setActiveScalarDatasetGroup(
int activeScalarDatasetGroup );
829 int activeVectorDatasetGroup()
const;
835 void setActiveVectorDatasetGroup(
int activeVectorDatasetGroup );
842 bool hasSettings(
int datasetGroupIndex )
const;
849 QHash<int, QgsMeshRendererScalarSettings> mRendererScalarSettings;
850 QHash<int, QgsMeshRendererVectorSettings> mRendererVectorSettings;
853 int mActiveScalarDatasetGroup = -1;
856 int mActiveVectorDatasetGroup = -1;
859 std::shared_ptr<QgsMesh3DAveragingMethod> mAveragingMethod;
MeshRangeLimit
Describes the limits used to compute mesh ranges (min/max values).
MeshRangeExtent
Describes the extent used to compute mesh ranges (min/max values).
@ WholeMesh
Whole mesh is used to compute statistics.
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
Class defining color to render mesh datasets.
ColoringMethod
Defines how the color is defined.
@ SingleColor
Render with a single color.
Represents a width than can vary depending on values.
Abstract class to interpolate 3d stacked mesh data to 2d data.
Represents a mesh renderer settings for mesh object.
Represents a mesh renderer settings for scalar datasets.
Qgis::MeshRangeExtent extent() const
Returns the mesh extent for minimum maximum calculation.
Qgis::MeshRangeLimit limits() const
Returns the range limits type for minimum maximum calculation.
void setExtent(Qgis::MeshRangeExtent extent)
Sets the mesh extent for minimum maximum calculation.
DataResamplingMethod
Resampling of value from dataset.
@ NeighbourAverage
Does a simple average of values defined for all surrounding faces/vertices.
void setLimits(Qgis::MeshRangeLimit limits)
Sets the range limits type for minimum maximum calculation.
Represents all mesh renderer settings.
QgsMeshRendererScalarSettings scalarSettings(int groupIndex) const
Returns renderer settings.
bool hasVectorSettings(int groupIndex) const
Returns whether groupIndex has existing vector settings.
void setEdgeMeshSettings(const QgsMeshRendererMeshSettings &settings)
Sets new edge mesh renderer settings.
bool removeVectorSettings(int groupIndex)
Removes vector settings for groupIndex.
QgsMeshRendererVectorSettings vectorSettings(int groupIndex) const
Returns renderer settings.
void setVectorSettings(int groupIndex, const QgsMeshRendererVectorSettings &settings)
Sets new renderer settings.
void setTriangularMeshSettings(const QgsMeshRendererMeshSettings &settings)
Sets new triangular mesh renderer settings.
QgsMeshRendererMeshSettings edgeMeshSettings() const
Returns edge mesh renderer settings.
QgsMeshRendererMeshSettings nativeMeshSettings() const
Returns native mesh renderer settings.
bool hasScalarSettings(int groupIndex) const
Returns whether groupIndex has existing scalar settings.
bool removeScalarSettings(int groupIndex)
Removes scalar settings with groupIndex.
void setScalarSettings(int groupIndex, const QgsMeshRendererScalarSettings &settings)
Sets new renderer settings.
QgsMeshRendererMeshSettings triangularMeshSettings() const
Returns triangular mesh renderer settings.
~QgsMeshRendererSettings()
void setNativeMeshSettings(const QgsMeshRendererMeshSettings &settings)
Sets new native mesh renderer settings, triggers repaint.
Represents a mesh renderer settings for vector datasets displayed with 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()
Represents a renderer settings for vector datasets.
Symbology
Defines the symbology of vector rendering.
@ Traces
Displaying vector dataset with particle traces.
@ Streamlines
Displaying vector dataset with streamlines.
Represents a streamline renderer settings for vector datasets displayed by streamlines.
SeedingStartPointsMethod
Method used to define start points that are used to draw streamlines.
Represents a trace renderer settings for vector datasets displayed by particle traces.
Represents a mesh renderer settings for vector datasets displayed with wind barbs.
WindSpeedUnit
Wind speed units. Wind barbs use knots so we use this enum for preset conversion values.
The class is used as a container of context for various read/write operations on other objects.
const double DEFAULT_LINE_WIDTH