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 );
459 WindSpeedUnit magnitudeUnits()
const;
464 void setMagnitudeUnits( WindSpeedUnit units );
467 QDomElement writeXml( QDomDocument &doc )
const;
469 void readXml(
const QDomElement &elem );
472 double mShaftLength = 10;
474 WindSpeedUnit mMagnitudeUnits = WindSpeedUnit::MetersPerSecond;
475 double mMagnitudeMultiplier = 1;
508 double lineWidth()
const;
510 void setLineWidth(
double lineWidth );
513 QColor color()
const;
515 void setColor(
const QColor &color );
523 double filterMin()
const;
529 void setFilterMin(
double filterMin );
537 double filterMax()
const;
543 void setFilterMax(
double filterMax );
546 bool isOnUserDefinedGrid()
const;
548 void setOnUserDefinedGrid(
bool enabled );
550 int userGridCellWidth()
const;
552 void setUserGridCellWidth(
int width );
554 int userGridCellHeight()
const;
556 void setUserGridCellHeight(
int height );
562 Symbology symbology()
const;
568 void setSymbology(
const Symbology &symbology );
655 Symbology mDisplayingMethod = Arrows;
659 QColor mColor = Qt::black;
661 double mFilterMin = -1;
662 double mFilterMax = -1;
663 int mUserGridCellWidth = 10;
664 int mUserGridCellHeight = 10;
665 bool mOnUserDefinedGrid =
false;
724 bool hasScalarSettings(
int groupIndex )
const {
return mRendererScalarSettings.contains( groupIndex );}
741 bool hasVectorSettings(
int groupIndex )
const {
return mRendererVectorSettings.contains( groupIndex );}
772 int activeScalarDatasetGroup()
const;
778 void setActiveScalarDatasetGroup(
int activeScalarDatasetGroup );
784 int activeVectorDatasetGroup()
const;
790 void setActiveVectorDatasetGroup(
int activeVectorDatasetGroup );
797 bool hasSettings(
int datasetGroupIndex )
const;
804 QHash<int, QgsMeshRendererScalarSettings> mRendererScalarSettings;
805 QHash<int, QgsMeshRendererVectorSettings> mRendererVectorSettings;
808 int mActiveScalarDatasetGroup = -1;
811 int mActiveVectorDatasetGroup = -1;
814 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()
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