18#ifndef QGSMESHRENDERERSETTINGS_H
19#define QGSMESHRENDERERSETTINGS_H
72 QDomElement
writeXml( QDomDocument &doc )
const;
74 void readXml(
const QDomElement &elem );
77 bool mEnabled =
false;
80 QColor mColor = Qt::black;
122 double classificationMinimum()
const;
124 double classificationMaximum()
const;
126 void setClassificationMinimumMaximum(
double minimum,
double maximum );
129 double opacity()
const;
131 void setOpacity(
double opacity );
140 DataResamplingMethod dataResamplingMethod()
const;
147 void setDataResamplingMethod(
const DataResamplingMethod &dataResamplingMethod );
214 DataResamplingMethod mDataResamplingMethod = DataResamplingMethod::NoResampling;
215 double mClassificationMinimum = 0;
216 double mClassificationMaximum = 0;
261 void setShaftLengthMethod( ArrowScalingMethod shaftLengthMethod );
268 double minShaftLength()
const;
275 void setMinShaftLength(
double minShaftLength );
282 double maxShaftLength()
const;
289 void setMaxShaftLength(
double maxShaftLength );
296 double scaleFactor()
const;
303 void setScaleFactor(
double scaleFactor );
310 double fixedShaftLength()
const;
317 void setFixedShaftLength(
double fixedShaftLength );
320 double arrowHeadWidthRatio()
const;
322 void setArrowHeadWidthRatio(
double arrowHeadWidthRatio );
325 double arrowHeadLengthRatio()
const;
327 void setArrowHeadLengthRatio(
double arrowHeadLengthRatio );
330 QDomElement writeXml( QDomDocument &doc )
const;
332 void readXml(
const QDomElement &elem );
336 double mMinShaftLength = 0.8;
337 double mMaxShaftLength = 10;
338 double mScaleFactor = 10;
339 double mFixedShaftLength = 20;
340 double mArrowHeadWidthRatio = 0.15;
341 double mArrowHeadLengthRatio = 0.40;
372 SeedingStartPointsMethod seedingMethod()
const;
374 void setSeedingMethod(
const SeedingStartPointsMethod &seedingMethod );
376 double seedingDensity()
const;
378 void setSeedingDensity(
double seedingDensity );
380 void readXml(
const QDomElement &elem );
382 QDomElement writeXml( QDomDocument &doc )
const;
386 double mSeedingDensity = 0.15;
415 void readXml(
const QDomElement &elem );
417 QDomElement
writeXml( QDomDocument &doc )
const;
420 int mParticlesCount = 1000;
421 double mMaximumTailLength = 100;
452 double magnitudeMultiplier()
const;
457 void setMagnitudeMultiplier(
double magnitudeMultiplier );
462 double shaftLength()
const;
467 void setShaftLength(
double shaftLength );
486 WindSpeedUnit magnitudeUnits()
const;
491 void setMagnitudeUnits( WindSpeedUnit units );
494 QDomElement writeXml( QDomDocument &doc )
const;
496 void readXml(
const QDomElement &elem );
499 double mShaftLength = 10;
501 WindSpeedUnit mMagnitudeUnits = WindSpeedUnit::MetersPerSecond;
502 double mMagnitudeMultiplier = 1;
534 double lineWidth()
const;
536 void setLineWidth(
double lineWidth );
539 QColor color()
const;
541 void setColor(
const QColor &color );
549 double filterMin()
const;
555 void setFilterMin(
double filterMin );
563 double filterMax()
const;
569 void setFilterMax(
double filterMax );
572 bool isOnUserDefinedGrid()
const;
574 void setOnUserDefinedGrid(
bool enabled );
576 int userGridCellWidth()
const;
578 void setUserGridCellWidth(
int width );
580 int userGridCellHeight()
const;
582 void setUserGridCellHeight(
int height );
588 Symbology symbology()
const;
594 void setSymbology(
const Symbology &symbology );
680 Symbology mDisplayingMethod = Arrows;
684 QColor mColor = Qt::black;
686 double mFilterMin = -1;
687 double mFilterMax = -1;
688 int mUserGridCellWidth = 10;
689 int mUserGridCellHeight = 10;
690 bool mOnUserDefinedGrid =
false;
754 bool hasScalarSettings(
int groupIndex )
const {
return mRendererScalarSettings.contains( groupIndex ); }
771 bool hasVectorSettings(
int groupIndex )
const {
return mRendererVectorSettings.contains( groupIndex ); }
802 int activeScalarDatasetGroup()
const;
808 void setActiveScalarDatasetGroup(
int activeScalarDatasetGroup );
814 int activeVectorDatasetGroup()
const;
820 void setActiveVectorDatasetGroup(
int activeVectorDatasetGroup );
827 bool hasSettings(
int datasetGroupIndex )
const;
834 QHash<int, QgsMeshRendererScalarSettings> mRendererScalarSettings;
835 QHash<int, QgsMeshRendererVectorSettings> mRendererVectorSettings;
838 int mActiveScalarDatasetGroup = -1;
841 int mActiveVectorDatasetGroup = -1;
844 std::shared_ptr<QgsMesh3DAveragingMethod> mAveragingMethod;
static const double DEFAULT_LINE_WIDTH
The default width (in millimeters) for line symbols.
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.
Defines color interpolation for rendering mesh datasets.
ColoringMethod
Defines how the color is defined.
@ SingleColor
Render with a single color.
Represents a width that can vary depending on values.
Abstract class for interpolating 3d stacked mesh data to 2d data.
Represents a mesh renderer settings for mesh objects.
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.
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.
@ NoResampling
Does not use resampling.
@ 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.
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.
QgsMeshRendererSettings()
Constructs renderer with default single layer averaging method.
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()
QgsMeshRendererSettings & operator=(const QgsMeshRendererSettings &other)
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().
@ Fixed
Use fixed length fixedShaftLength() regardless of vector's magnitude.
Represents a renderer settings for vector datasets.
Symbology
Defines the symbology of vector rendering.
@ Traces
Displaying vector dataset with particle traces.
@ Arrows
Displaying vector dataset with arrows.
@ WindBarbs
Displaying vector dataset with wind barbs.
@ 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.
@ Random
Seeds start points randomly on the mesh.
@ MeshGridded
Seeds start points on the vertices mesh or user regular grid.
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.
WindSpeedUnit
Wind speed units. Wind barbs use knots so we use this enum for preset conversion values.
A container for the context for various read/write operations on objects.