QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
src
core
mesh
qgsmeshvectorrenderer.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmeshvectorrenderer.h
3
-------------------
4
begin : May 2018
5
copyright : (C) 2018 by Peter Petrik
6
email : zilolv at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSMESHVECTORRENDERER_H
19
#define QGSMESHVECTORRENDERER_H
20
21
22
#define SIP_NO_FILE
23
24
#include <QVector>
25
#include <QSize>
26
27
#include "qgis_core.h"
28
#include "
qgsmeshdataprovider.h
"
29
#include "
qgstriangularmesh.h
"
30
#include "
qgsmeshlayer.h
"
31
#include "
qgspointxy.h
"
32
33
class
QgsRenderContext
;
34
class
QgsInterpolatedLineColor
;
36
37
38
class
QgsMeshVectorRenderer
39
{
40
public
:
42
QgsMeshVectorRenderer() =
default
;
43
47
virtual
~QgsMeshVectorRenderer();
48
49
virtual
void
draw() = 0;
50
52
static
QgsMeshVectorRenderer *makeVectorRenderer(
const
QgsTriangularMesh
&m,
53
const
QgsMeshDataBlock
&datasetVectorValues,
54
const
QgsMeshDataBlock
&scalarActiveFaceFlagValues,
55
const
QVector<double> &datasetValuesMag,
56
double
datasetMagMaximumValue,
57
double
datasetMagMinimumValue,
58
QgsMeshDatasetGroupMetadata::DataType
dataType,
59
const
QgsMeshRendererVectorSettings
&settings,
60
QgsRenderContext
&context,
61
const
QgsRectangle
&layerExtent,
62
QSize size );
63
};
64
73
class
QgsMeshVectorArrowRenderer :
public
QgsMeshVectorRenderer
74
{
75
public
:
77
QgsMeshVectorArrowRenderer(
const
QgsTriangularMesh
&m,
78
const
QgsMeshDataBlock
&datasetValues,
79
const
QVector<double> &datasetValuesMag,
80
double
datasetMagMaximumValue,
81
double
datasetMagMinimumValue,
82
QgsMeshDatasetGroupMetadata::DataType
dataType,
83
const
QgsMeshRendererVectorSettings
&settings,
84
QgsRenderContext
&context,
85
QSize size );
87
~QgsMeshVectorArrowRenderer()
override
;
88
92
void
draw()
override
;
93
94
private
:
96
void
drawVectorDataOnVertices( );
98
void
drawVectorDataOnFaces( );
100
void
drawVectorDataOnEdges( );
102
void
drawVectorDataOnPoints(
const
QSet<int> indexesToRender,
const
QVector<QgsMeshVertex> &points );
104
void
drawVectorDataOnGrid( );
106
void
drawVectorArrow(
const
QgsPointXY
&lineStart,
double
xVal,
double
yVal,
double
magnitude );
108
bool
calcVectorLineEnd(
QgsPointXY
&lineEnd,
109
double
&vectorLength,
110
double
&cosAlpha,
111
double
&sinAlpha,
//out
112
const
QgsPointXY
&lineStart,
113
double
xVal,
114
double
yVal,
115
double
magnitude
//in
116
);
117
124
double
calcExtentBufferSize()
const
;
125
126
const
QgsTriangularMesh
&mTriangularMesh;
127
const
QgsMeshDataBlock
&mDatasetValues;
128
const
QVector<double> &mDatasetValuesMag;
//magnitudes
129
double
mMinMag = 0.0;
130
double
mMaxMag = 0.0;
131
QgsRenderContext
&mContext;
132
const
QgsMeshRendererVectorSettings
mCfg;
133
QgsMeshDatasetGroupMetadata::DataType
mDataType = QgsMeshDatasetGroupMetadata::DataType::DataOnVertices;
134
QSize mOutputSize;
135
QgsRectangle
mBufferedExtent;
136
QPen mPen;
137
138
QgsInterpolatedLineColor
mVectorColoring;
139
140
};
141
142
143
145
146
147
148
#endif // QGSMESHVECTORRENDERER_H
QgsMeshRendererVectorSettings
Represents a renderer settings for vector datasets.
Definition:
qgsmeshrenderersettings.h:411
QgsRenderContext
Contains information about the context of a rendering operation.
Definition:
qgsrendercontext.h:58
QgsRectangle
A rectangle specified with double values.
Definition:
qgsrectangle.h:42
qgstriangularmesh.h
QgsInterpolatedLineColor
Class defining color to render mesh datasets.
Definition:
qgsinterpolatedlinerenderer.h:35
qgsmeshlayer.h
QgsPointXY
A class to represent a 2D point.
Definition:
qgspointxy.h:44
QgsMeshDatasetGroupMetadata::DataType
DataType
Location of where data is specified for datasets in the dataset group.
Definition:
qgsmeshdataset.h:355
QgsMeshDataBlock
QgsMeshDataBlock is a block of integers/doubles that can be used to retrieve: active flags (e....
Definition:
qgsmeshdataset.h:136
QgsTriangularMesh
Triangular/Derived Mesh is mesh with vertices in map coordinates.
Definition:
qgstriangularmesh.h:50
qgsmeshdataprovider.h
qgspointxy.h
Generated on Sat Oct 24 2020 17:43:09 for QGIS API Documentation by
1.8.20