QGIS API Documentation 3.99.0-Master (c22de0620c0)
Loading...
Searching...
No Matches
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 "qgis.h"
31#include "qgs3drendercontext.h"
32
33#include <QVector>
34#include <QVector3D>
35
36#define SIP_NO_FILE
37
38namespace Qt3DCore
39{
40 class QNode;
41 class QGeometry;
42} // namespace Qt3DCore
43
44class QgsLineString;
45
46
61struct QgsLineVertexData
62{
63 QVector<QVector3D> vertices;
64 QVector<unsigned int> indexes;
65 QByteArray materialDataDefined;
66
67 bool withAdjacency = false;
68
69 // extra info to calculate elevation
72 float baseHeight = 0;
73 Qgs3DRenderContext renderContext; // used for altitude clamping
74 QgsVector3D origin; // all coordinates are relative to this origin (e.g. center of the chunk)
75 bool geocentricCoordinates = false; // whether input coordinates are geocentric (i.e. Z can't be interpreted as elevation)
76
77 QgsLineVertexData();
78
79 void init( Qgis::AltitudeClamping clamping, Qgis::AltitudeBinding binding, float height, const Qgs3DRenderContext &renderContext, const QgsVector3D &chunkOrigin );
80
81 QByteArray createVertexBuffer();
82 QByteArray createIndexBuffer();
83 Qt3DCore::QGeometry *createGeometry( Qt3DCore::QNode *parent );
84
85 void addLineString( const QgsLineString &lineString, float extraHeightOffset = 0, bool closePolygon = false );
86 void addVerticalLines( const QgsLineString &lineString, float verticalLength, float extraHeightOffset = 0 );
87};
88
90
91#endif // QGSLINEVERTEXDATA_P_H
AltitudeClamping
Altitude clamping.
Definition qgis.h:4068
@ Absolute
Elevation is taken directly from feature and is independent of terrain height (final elevation = feat...
Definition qgis.h:4069
AltitudeBinding
Altitude binding.
Definition qgis.h:4081
@ Vertex
Clamp every vertex of feature.
Definition qgis.h:4082
Line string geometry type, with support for z-dimension and m-values.