QGIS API Documentation 4.3.0-Master (16649ce5cc6)
Loading...
Searching...
No Matches
qgsvectorfieldengine.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectorfieldengine.h
3 ---------------------
4 begin : September 2026
5 copyright : (C) 2026 by Stefanos Natsis
6 email : uclaros at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSVECTORFIELDENGINE_H
17#define QGSVECTORFIELDENGINE_H
18
19#include <memory>
20
23
24#include <QSize>
25
26#define SIP_NO_FILE
27
29class QgsPointXY;
34
45{
46 public:
48 QgsVectorFieldEngine( double datasetMagMaximumValue, double datasetMagMinimumValue, const QgsVectorFieldSettings &settings, QgsRenderContext &context, QSize size );
51
54
62 void drawGlyph( const QgsPointXY &lineStart, double xVal, double yVal, double magnitude );
63
70 void drawStreamlines( std::unique_ptr<QgsVectorFieldValueSource> source, QgsRasterBlockFeedback *feedback = nullptr );
71
76 void drawTraces( std::unique_ptr<QgsVectorFieldValueSource> source );
77
78 private:
80 void drawArrow( const QgsPointXY &lineStart, double xVal, double yVal, double magnitude );
81
83 void drawWindBarb( const QgsPointXY &lineStart, double xVal, double yVal, double magnitude );
84
86 bool calcVectorLineEnd(
87 QgsPointXY &lineEnd,
88 double &vectorLength,
89 double &cosAlpha,
90 double &sinAlpha, //out
91 const QgsPointXY &lineStart,
92 double xVal,
93 double yVal,
94 double magnitude //in
95 );
96
97 double mMinMag = 0.0;
98 double mMaxMag = 0.0;
99
100 QgsRenderContext &mContext;
101 const QgsVectorFieldSettings mCfg;
102 QgsInterpolatedLineColor mVectorColoring;
103
104 QSize mOutputSize;
105
106 std::unique_ptr<QgsCoordinateTransform> mGeographicTransform;
107 std::unique_ptr<QgsScopedQPainterState> mScopedPainterState;
108};
109
110#endif // QGSVECTORFIELDENGINE_H
Handles coordinate transforms between two coordinate systems.
Defines color interpolation for rendering mesh datasets.
Represents a 2D point.
Definition qgspointxy.h:62
Feedback object tailored for raster block reading.
Contains information about the context of a rendering operation.
Scoped object for saving and restoring a QPainter object's state.
QgsVectorFieldEngine(double datasetMagMaximumValue, double datasetMagMinimumValue, const QgsVectorFieldSettings &settings, QgsRenderContext &context, QSize size)
Ctor.
void drawGlyph(const QgsPointXY &lineStart, double xVal, double yVal, double magnitude)
Draws a single glyph at lineStart, in painter coordinates, using the symbology of the settings the en...
QgsVectorFieldEngine(const QgsVectorFieldEngine &)=delete
void drawStreamlines(std::unique_ptr< QgsVectorFieldValueSource > source, QgsRasterBlockFeedback *feedback=nullptr)
Integrates and draws streamlines over the whole rendered extent, sampling the vector field from sourc...
QgsVectorFieldEngine & operator=(const QgsVectorFieldEngine &)=delete
void drawTraces(std::unique_ptr< QgsVectorFieldValueSource > source)
Seeds particles over the whole rendered extent, moves them one time step and draws their traces,...
Represents a renderer settings for vector datasets.
Abstract source of vector (u/v) values sampled at arbitrary map positions.