QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
qgslinevertexdata_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslinevertexdata_p.h
3 --------------------------------------
4 Date : Apr 2019
5 Copyright : (C) 2019 by Martin Dobias
6 Email : wonder dot sk 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 QGSLINEVERTEXDATA_P_H
17#define QGSLINEVERTEXDATA_P_H
18
20
21//
22// W A R N I N G
23// -------------
24//
25// This file is not part of the QGIS API. It exists purely as an
26// implementation detail. This header file may change from version to
27// version without notice, or even be removed.
28//
29
30#include <QVector>
31#include <QVector3D>
32
33#define SIP_NO_FILE
34
35#include "qgis.h"
36
37
38namespace Qt3DCore
39{
40 class QNode;
41#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
42 class QGeometry;
43#endif
44}
45
46#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
47namespace Qt3DRender
48{
49 class QGeometry;
50}
51#endif
52
53class QgsLineString;
55
56
70struct QgsLineVertexData
71{
72 QVector<QVector3D> vertices;
73 QVector<unsigned int> indexes;
74
75 bool withAdjacency = false;
76
77 // extra info to calculate elevation
80 float baseHeight = 0;
81 const Qgs3DMapSettings *mapSettings = nullptr;
82
83 QgsLineVertexData();
84
85 void init( Qgis::AltitudeClamping clamping, Qgis::AltitudeBinding binding, float height, const Qgs3DMapSettings *map );
86
87 QByteArray createVertexBuffer();
88 QByteArray createIndexBuffer();
89#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
90 Qt3DRender::QGeometry *createGeometry( Qt3DCore::QNode *parent );
91#else
92 Qt3DCore::QGeometry *createGeometry( Qt3DCore::QNode *parent );
93#endif
94
95 void addLineString( const QgsLineString &lineString, float extraHeightOffset = 0 );
96 void addVerticalLines( const QgsLineString &lineString, float verticalLength, float extraHeightOffset = 0 );
97};
98
100
101#endif // QGSLINEVERTEXDATA_P_H
AltitudeClamping
Altitude clamping.
Definition: qgis.h:2502
@ Relative
Elevation is relative to terrain height (final elevation = terrain elevation + feature elevation)
AltitudeBinding
Altitude binding.
Definition: qgis.h:2515
@ Vertex
Clamp every vertex of feature.
Line string geometry type, with support for z-dimension and m-values.
Definition: qgslinestring.h:45