QGIS API Documentation  3.20.0-Odense (decaadbb31)
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 "qgs3dtypes.h"
36 
37 namespace Qt3DCore
38 {
39  class QNode;
40 }
41 namespace Qt3DRender
42 {
43  class QGeometry;
44 }
45 
46 class QgsLineString;
47 class Qgs3DMapSettings;
48 
49 
63 struct QgsLineVertexData
64 {
65  QVector<QVector3D> vertices;
66  QVector<unsigned int> indexes;
67 
68  bool withAdjacency = false;
69 
70  // extra info to calculate elevation
73  float baseHeight = 0;
74  const Qgs3DMapSettings *mapSettings = nullptr;
75 
76  QgsLineVertexData();
77 
78  void init( Qgs3DTypes::AltitudeClamping clamping, Qgs3DTypes::AltitudeBinding binding, float height, const Qgs3DMapSettings *map );
79 
80  QByteArray createVertexBuffer();
81  QByteArray createIndexBuffer();
82  Qt3DRender::QGeometry *createGeometry( Qt3DCore::QNode *parent );
83 
84  void addLineString( const QgsLineString &lineString, float extraHeightOffset = 0 );
85  void addVerticalLines( const QgsLineString &lineString, float verticalLength, float extraHeightOffset = 0 );
86 };
87 
89 
90 #endif // QGSLINEVERTEXDATA_P_H
AltitudeClamping
how to handle altitude of vector features
Definition: qgs3dtypes.h:35
@ AltClampRelative
Z_final = z_terrain + z_geometry.
Definition: qgs3dtypes.h:37
AltitudeBinding
how to handle clamping of vertices of individual features
Definition: qgs3dtypes.h:43
@ AltBindVertex
Clamp every vertex of feature.
Definition: qgs3dtypes.h:44
Line string geometry type, with support for z-dimension and m-values.
Definition: qgslinestring.h:44