18#ifndef QGSMESHVECTORFIELDVALUESOURCE_H
19#define QGSMESHVECTORFIELDVALUESOURCE_H
51 QgsMeshVectorFieldValueSource(
55 const QVector<double> &datasetMagnitudeValues,
58 double maximumMagnitude
65 static std::unique_ptr<QgsMeshVectorFieldValueSource> create(
69 const QVector<double> &datasetMagnitudeValues,
72 double maximumMagnitude
86 virtual QgsVector interpolatedValuePrivate(
int faceIndex,
const QgsPointXY point )
const = 0;
88 bool isVectorValid(
const QgsVector &v )
const;
93 QVector<double> mMagnitudeValues;
96 double mMaximumMagnitude = 0;
97 bool mUseScalarActiveFaceFlagValues =
false;
98 mutable int mCacheFaceIndex = -1;
101 void activeFaceFilter(
QgsVector &vector,
int faceIndex )
const;
112class QgsMeshVectorFieldValueSourceFromVertex :
public QgsMeshVectorFieldValueSource
115 using QgsMeshVectorFieldValueSource::QgsMeshVectorFieldValueSource;
117 QgsMeshVectorFieldValueSourceFromVertex *clone()
const override;
120 QgsVector interpolatedValuePrivate(
int faceIndex,
const QgsPointXY point )
const override;
131class QgsMeshVectorFieldValueSourceFromFace :
public QgsMeshVectorFieldValueSource
134 using QgsMeshVectorFieldValueSource::QgsMeshVectorFieldValueSource;
136 QgsMeshVectorFieldValueSourceFromFace *clone()
const override;
139 QgsVector interpolatedValuePrivate(
int faceIndex,
const QgsPointXY point )
const override;
A block of integers/doubles from a mesh dataset.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
A triangular/derived mesh with vertices in map coordinates.
Abstract source of vector (u/v) values sampled at arbitrary map positions.
virtual QgsRectangle extent() const =0
Returns the extent of the data, in map coordinates.
virtual std::unique_ptr< QgsRasterInterface > magnitudeSource(const QgsRenderContext &context, QSize size) const
Returns a raster interface exposing the magnitude of the vector field as a single band,...
virtual QVector< QgsPointXY > seedPoints(const QgsRectangle &extent) const
Returns the natural seeding positions of the data within extent, in map coordinates.
virtual double maximumMagnitude() const =0
Returns the maximum magnitude over the whole data.
virtual QgsVector vectorValue(const QgsPointXY &point) const =0
Returns the vector value at point, expressed in map coordinates.
Represent a 2-dimensional vector.