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;
426 double lineWidth()
const;
428 void setLineWidth(
double lineWidth );
431 QColor color()
const;
433 void setColor(
const QColor &color );
441 double filterMin()
const;
447 void setFilterMin(
double filterMin );
455 double filterMax()
const;
461 void setFilterMax(
double filterMax );
464 bool isOnUserDefinedGrid()
const;
466 void setOnUserDefinedGrid(
bool enabled );
468 int userGridCellWidth()
const;
470 void setUserGridCellWidth(
int width );
472 int userGridCellHeight()
const;
474 void setUserGridCellHeight(
int height );
480 Symbology symbology()
const;
486 void setSymbology(
const Symbology &symbology );
561 Symbology mDisplayingMethod = Arrows;
565 QColor mColor = Qt::black;
567 double mFilterMin = -1;
568 double mFilterMax = -1;
569 int mUserGridCellWidth = 10;
570 int mUserGridCellHeight = 10;
571 bool mOnUserDefinedGrid =
false;
630 bool hasScalarSettings(
int groupIndex )
const {
return mRendererScalarSettings.contains( groupIndex );}
647 bool hasVectorSettings(
int groupIndex )
const {
return mRendererVectorSettings.contains( groupIndex );}
678 int activeScalarDatasetGroup()
const;
684 void setActiveScalarDatasetGroup(
int activeScalarDatasetGroup );
690 int activeVectorDatasetGroup()
const;
696 void setActiveVectorDatasetGroup(
int activeVectorDatasetGroup );
703 bool hasSettings(
int datasetGroupIndex )
const;
710 QHash<int, QgsMeshRendererScalarSettings> mRendererScalarSettings;
711 QHash<int, QgsMeshRendererVectorSettings> mRendererVectorSettings;
714 int mActiveScalarDatasetGroup = -1;
717 int mActiveVectorDatasetGroup = -1;
720 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.
@ 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.
The class is used as a container of context for various read/write operations on other objects.
const double DEFAULT_LINE_WIDTH