QGIS API Documentation 4.3.0-Master (2b7e6c9893e)
Loading...
Searching...
No Matches
qgsvectorfieldsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectorfieldsettings.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 QGSVECTORFIELDSETTINGS_H
17#define QGSVECTORFIELDSETTINGS_H
18
19#include "qgis.h"
20#include "qgis_core.h"
21#include "qgscolorrampshader.h"
27
28#include <QColor>
29#include <QDomElement>
30
38class CORE_EXPORT QgsVectorFieldSettings
39{
40 public:
42 double lineWidth() const;
44 void setLineWidth( double lineWidth );
45
47 QColor color() const;
49 void setColor( const QColor &color );
50
57 double filterMin() const;
58
63 void setFilterMin( double filterMin );
64
71 double filterMax() const;
72
77 void setFilterMax( double filterMax );
78
80 bool isOnUserDefinedGrid() const;
82 void setOnUserDefinedGrid( bool enabled );
84 int userGridCellWidth() const;
86 void setUserGridCellWidth( int width );
88 int userGridCellHeight() const;
90 void setUserGridCellHeight( int height );
91
96
101
106
111
116
121
126
131
136
141
146
151
156
161
166
168 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context = QgsReadWriteContext() ) const;
170 void readXml( const QDomElement &elem, const QgsReadWriteContext &context = QgsReadWriteContext() );
171
172 private:
174
175 double mLineWidth = Qgis::DEFAULT_LINE_WIDTH; //in millimeters
176 QgsColorRampShader mColorRampShader;
177 QColor mColor = Qt::black;
179 double mFilterMin = -1; //disabled
180 double mFilterMax = -1; //disabled
181 int mUserGridCellWidth = 10; // in pixels
182 int mUserGridCellHeight = 10; // in pixels
183 bool mOnUserDefinedGrid = false;
184
185 QgsVectorFieldArrowSettings mArrowsSettings;
186 QgsVectorFieldStreamlineSettings mStreamLinesSettings;
187 QgsVectorFieldTracesSettings mTracesSettings;
188 QgsVectorFieldWindBarbSettings mWindBarbSettings;
189};
190
191#endif // QGSVECTORFIELDSETTINGS_H
static const double DEFAULT_LINE_WIDTH
The default width (in millimeters) for line symbols.
Definition qgis.h:7241
VectorFieldSymbology
Defines the symbology of vector field rendering.
Definition qgis.h:7134
@ Arrows
Displaying vector dataset with arrows.
Definition qgis.h:7135
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
Defines color interpolation for rendering mesh datasets.
ColoringMethod
Defines how the color is defined.
@ SingleColor
Render with a single color.
A container for the context for various read/write operations on objects.
Represents a mesh renderer settings for vector datasets displayed with arrows.
Represents a renderer settings for vector datasets.
void setArrowsSettings(const QgsVectorFieldArrowSettings &arrowSettings)
Sets settings for vector rendered with arrows.
double filterMin() const
Returns filter value for vector magnitudes.
QgsVectorFieldArrowSettings arrowSettings() const
Returns settings for vector rendered with arrows.
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const
Writes configuration to a new DOM element.
int userGridCellWidth() const
Returns width in pixels of user grid cell.
void setColor(const QColor &color)
Sets color used for drawing arrows.
void setStreamLinesSettings(const QgsVectorFieldStreamlineSettings &streamLinesSettings)
Sets settings for vector rendered with streamlines.
double lineWidth() const
Returns line width of the arrow (in millimeters).
QgsVectorFieldWindBarbSettings windBarbSettings() const
Returns settings for vector rendered with wind barbs.
QgsColorRampShader colorRampShader() const
Sets the color ramp shader used to render vector datasets.
void setFilterMin(double filterMin)
Sets filter value for vector magnitudes.
Qgis::VectorFieldSymbology symbology() const
Returns the displaying method used to render vector datasets.
void setTracesSettings(const QgsVectorFieldTracesSettings &tracesSettings)
Sets settings for vector rendered with traces.
QgsVectorFieldTracesSettings tracesSettings() const
Returns settings for vector rendered with traces.
void setLineWidth(double lineWidth)
Sets line width of the arrow in pixels (in millimeters).
bool isOnUserDefinedGrid() const
Returns whether vectors are drawn on user-defined grid.
void setColoringMethod(const QgsInterpolatedLineColor::ColoringMethod &coloringMethod)
Sets the coloring method used to render vector datasets.
QgsVectorFieldStreamlineSettings streamLinesSettings() const
Returns settings for vector rendered with streamlines.
void setOnUserDefinedGrid(bool enabled)
Toggles drawing of vectors on user defined grid.
int userGridCellHeight() const
Returns height in pixels of user grid cell.
double filterMax() const
Returns filter value for vector magnitudes.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext())
Reads configuration from the given DOM element.
void setFilterMax(double filterMax)
Sets filter value for vector magnitudes.
QgsInterpolatedLineColor::ColoringMethod coloringMethod() const
Returns the coloring method used to render vector datasets.
QgsInterpolatedLineColor vectorStrokeColoring() const
Returns the stroke coloring used to render vector datasets.
void setUserGridCellWidth(int width)
Sets width of user grid cell (in pixels).
void setUserGridCellHeight(int height)
Sets height of user grid cell (in pixels).
void setSymbology(const Qgis::VectorFieldSymbology &symbology)
Sets the displaying method used to render vector datasets.
void setColorRampShader(const QgsColorRampShader &colorRampShader)
Returns the color ramp shader used to render vector datasets.
void setWindBarbSettings(const QgsVectorFieldWindBarbSettings &windBarbSettings)
Sets settings for vector rendered with wind barbs.
QColor color() const
Returns color used for drawing arrows.
Represents a streamline renderer settings for vector datasets displayed by 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.