18#ifndef QGSMESHRENDERERSETTINGS_H
19#define QGSMESHRENDERERSETTINGS_H
44 bool isEnabled()
const;
46 void setEnabled(
bool enabled );
49 double lineWidth()
const;
51 void setLineWidth(
double lineWidth );
56 void setColor(
const QColor &color );
73 QDomElement writeXml( QDomDocument &doc )
const;
75 void readXml(
const QDomElement &elem );
78 bool mEnabled =
false;
81 QColor mColor = Qt::black;
124 double classificationMinimum()
const;
126 double classificationMaximum()
const;
128 void setClassificationMinimumMaximum(
double minimum,
double maximum );
131 double opacity()
const;
133 void setOpacity(
double opacity );
142 DataResamplingMethod dataResamplingMethod()
const;
149 void setDataResamplingMethod(
const DataResamplingMethod &dataResamplingMethod );
186 DataResamplingMethod mDataResamplingMethod = DataResamplingMethod::NoResampling;
187 double mClassificationMinimum = 0;
188 double mClassificationMaximum = 0;
231 void setShaftLengthMethod( ArrowScalingMethod shaftLengthMethod );
238 double minShaftLength()
const;
245 void setMinShaftLength(
double minShaftLength );
252 double maxShaftLength()
const;
259 void setMaxShaftLength(
double maxShaftLength );
266 double scaleFactor()
const;
273 void setScaleFactor(
double scaleFactor );
280 double fixedShaftLength()
const;
287 void setFixedShaftLength(
double fixedShaftLength );
290 double arrowHeadWidthRatio()
const;
292 void setArrowHeadWidthRatio(
double arrowHeadWidthRatio );
295 double arrowHeadLengthRatio()
const;
297 void setArrowHeadLengthRatio(
double arrowHeadLengthRatio );
300 QDomElement writeXml( QDomDocument &doc )
const;
302 void readXml(
const QDomElement &elem );
306 double mMinShaftLength = 0.8;
307 double mMaxShaftLength = 10;
308 double mScaleFactor = 10;
309 double mFixedShaftLength = 20;
310 double mArrowHeadWidthRatio = 0.15;
311 double mArrowHeadLengthRatio = 0.40;
342 SeedingStartPointsMethod seedingMethod()
const;
344 void setSeedingMethod(
const SeedingStartPointsMethod &seedingMethod );
346 double seedingDensity()
const;
348 void setSeedingDensity(
double seedingDensity );
350 void readXml(
const QDomElement &elem );
352 QDomElement writeXml( QDomDocument &doc )
const;
357 double mSeedingDensity = 0.15;
374 double maximumTailLength()
const;
376 void setMaximumTailLength(
double maximumTailLength );
378 int particlesCount()
const;
380 void setParticlesCount(
int value );
387 void readXml(
const QDomElement &elem );
389 QDomElement writeXml( QDomDocument &doc )
const;
392 int mParticlesCount = 1000;
393 double mMaximumTailLength = 100;
425 double magnitudeMultiplier()
const;
430 void setMagnitudeMultiplier(
double magnitudeMultiplier );
435 double shaftLength()
const;
440 void setShaftLength(
double shaftLength );
455 WindSpeedUnit magnitudeUnits()
const;
460 void setMagnitudeUnits( WindSpeedUnit units );
463 QDomElement writeXml( QDomDocument &doc )
const;
465 void readXml(
const QDomElement &elem );
468 double mShaftLength = 10;
470 WindSpeedUnit mMagnitudeUnits = WindSpeedUnit::MetersPerSecond;
471 double mMagnitudeMultiplier = 1;
504 double lineWidth()
const;
506 void setLineWidth(
double lineWidth );
509 QColor color()
const;
511 void setColor(
const QColor &color );
519 double filterMin()
const;
525 void setFilterMin(
double filterMin );
533 double filterMax()
const;
539 void setFilterMax(
double filterMax );
542 bool isOnUserDefinedGrid()
const;
544 void setOnUserDefinedGrid(
bool enabled );
546 int userGridCellWidth()
const;
548 void setUserGridCellWidth(
int width );
550 int userGridCellHeight()
const;
552 void setUserGridCellHeight(
int height );
558 Symbology symbology()
const;
564 void setSymbology(
const Symbology &symbology );
651 Symbology mDisplayingMethod = Arrows;
655 QColor mColor = Qt::black;
657 double mFilterMin = -1;
658 double mFilterMax = -1;
659 int mUserGridCellWidth = 10;
660 int mUserGridCellHeight = 10;
661 bool mOnUserDefinedGrid =
false;
721 bool hasScalarSettings(
int groupIndex )
const {
return mRendererScalarSettings.contains( groupIndex );}
738 bool hasVectorSettings(
int groupIndex )
const {
return mRendererVectorSettings.contains( groupIndex );}
769 int activeScalarDatasetGroup()
const;
775 void setActiveScalarDatasetGroup(
int activeScalarDatasetGroup );
781 int activeVectorDatasetGroup()
const;
787 void setActiveVectorDatasetGroup(
int activeVectorDatasetGroup );
794 bool hasSettings(
int datasetGroupIndex )
const;
801 QHash<int, QgsMeshRendererScalarSettings> mRendererScalarSettings;
802 QHash<int, QgsMeshRendererVectorSettings> mRendererVectorSettings;
805 int mActiveScalarDatasetGroup = -1;
808 int mActiveVectorDatasetGroup = -1;
811 std::shared_ptr<QgsMesh3DAveragingMethod> mAveragingMethod;
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.
DataResamplingMethod
Resampling of value from dataset.
@ NeighbourAverage
Does a simple average of values defined for all surrounding faces/vertices.
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()
Destructor.
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