QGIS API Documentation 4.3.0-Master (0ff9723465c)
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
31#include "qgis.h"
32#include "qgs3drendercontext.h"
33
34#include <QByteArray>
35#include <QVector>
36#include <QVector3D>
37
38#define SIP_NO_FILE
39
40namespace Qt3DCore
41{
42 class QNode;
43 class QGeometry;
44 class QEntity;
45} // namespace Qt3DCore
46
47class QgsLineString;
48class QgsMaterial;
49class QgsLineMaterial;
52
63struct QgsLineVertexData
64{
65 QVector<QVector3D> pointsA;
66 QVector<QVector3D> pointsB;
67 QVector<QVector3D> pointsPrev;
68 QVector<QVector3D> pointsNext;
69 QVector<QVector3D> vertices;
70
72 QVector<QVector3D> joinPointA;
73 QVector<QVector3D> joinPointB;
74 QVector<QVector3D> joinPointC;
75
76 QByteArray materialDataDefined;
78 QByteArray materialDataDefinedJoins;
79
80 // extra info to calculate elevation
83 float baseHeight = 0;
84 Qgs3DRenderContext renderContext; // used for altitude clamping
85 QgsVector3D origin; // all coordinates are relative to this origin (e.g. center of the chunk)
86 bool geocentricCoordinates = false; // whether input coordinates are geocentric (i.e. Z can't be interpreted as elevation)
87
88 void init( Qgis::AltitudeClamping clamping, Qgis::AltitudeBinding binding, float height, const Qgs3DRenderContext &renderContext, const QgsVector3D &chunkOrigin );
89
90 void addLineString( const QgsLineString &lineString, float extraHeightOffset = 0, bool closePolygon = false );
91
92 void addVerticalLines( const QgsLineString &lineString, float verticalLength, float extraHeightOffset = 0 );
93
94 QByteArray createPointABuffer() const;
95 QByteArray createPointBBuffer() const;
96 QByteArray createPointPrevBuffer() const;
97 QByteArray createPointNextBuffer() const;
98
99 QByteArray createJoinPointABuffer() const;
100 QByteArray createJoinPointBBuffer() const;
101 QByteArray createJoinPointCBuffer() const;
102
103 Qt3DCore::QGeometry *createGeometry( Qt3DCore::QNode *parent );
104 Qt3DCore::QGeometry *createJoinGeometry( Qt3DCore::QNode *parent );
105 Qt3DCore::QEntity *createSegmentEntity( QgsMaterial *material, const QgsAbstractMaterialSettings *materialSettings = nullptr, const QgsAbstractMaterial3DHandler *materialHandler = nullptr );
106 Qt3DCore::QEntity *createJoinEntity(
107 const QgsLineMaterial *segmentMaterial, const QgsAbstractMaterialSettings *materialSettings = nullptr, const QgsAbstractMaterial3DHandler *materialHandler = nullptr
108 );
109};
110
112
113#endif // QGSLINEVERTEXDATA_P_H
AltitudeClamping
Altitude clamping.
Definition qgis.h:4225
@ Absolute
Elevation is taken directly from feature and is independent of terrain height (final elevation = feat...
Definition qgis.h:4226
AltitudeBinding
Altitude binding.
Definition qgis.h:4238
@ Vertex
Clamp every vertex of feature.
Definition qgis.h:4239
Abstract base class for material 3D handlers.
Abstract base class for material settings.
Line string geometry type, with support for z-dimension and m-values.
Base class for all materials used within QGIS 3D views.
Definition qgsmaterial.h:40