QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
qgsrubberband3d.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrubberband3d.h
3 --------------------------------------
4 Date : June 2021
5 Copyright : (C) 2021 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 QGSRUBBERBAND3D_H
17#define QGSRUBBERBAND3D_H
18
19#include "qgis_3d.h"
20
21#define SIP_NO_FILE
22
24
25//
26// W A R N I N G
27// -------------
28//
29// This file is not part of the QGIS API. It exists purely as an
30// implementation detail. This header file may change from version to
31// version without notice, or even be removed.
32//
33
34#include "qgslinestring.h"
35
37class QgsLineMaterial;
39
40namespace Qt3DCore
41{
42 class QEntity;
43#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
44 class QBuffer;
45 class QGeometry;
46 class QAttribute;
47#endif
48}
49
50namespace Qt3DRender
51{
52#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
53 class QBuffer;
54 class QGeometry;
55 class QAttribute;
56#endif
57 class QGeometryRenderer;
58 class QMaterial;
59}
60
72class _3D_EXPORT QgsRubberBand3D
73{
74 public:
75 QgsRubberBand3D( Qgs3DMapSettings &map, QgsWindow3DEngine *engine, Qt3DCore::QEntity *parentEntity );
76 ~QgsRubberBand3D();
77
78 float width() const;
79 void setWidth( float width );
80
81 QColor color() const;
82 void setColor( QColor color );
83
84 void reset();
85
86 void addPoint( const QgsPoint &pt );
87
88 void removeLastPoint();
89
90 private:
91 void updateGeometry();
92
93 private:
94 QgsLineString mLineString;
95
96 Qgs3DMapSettings *mMapSettings = nullptr; // not owned
97
98 Qt3DCore::QEntity *mEntity = nullptr; // owned by parentEntity (from constructor)
99
100 // all these are owned by mEntity
101 Qt3DRender::QGeometryRenderer *mGeomRenderer = nullptr;
102#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
103 Qt3DRender::QGeometry *mGeometry = nullptr;
104 Qt3DRender::QAttribute *mPositionAttribute = nullptr;
105 Qt3DRender::QAttribute *mIndexAttribute = nullptr;
106#else
107 Qt3DCore::QGeometry *mGeometry = nullptr;
108 Qt3DCore::QAttribute *mPositionAttribute = nullptr;
109 Qt3DCore::QAttribute *mIndexAttribute = nullptr;
110#endif
111 QgsLineMaterial *mLineMaterial = nullptr;
112
113 // Disable copying as we have pointer members.
114 QgsRubberBand3D( const QgsRubberBand3D & ) = delete;
115 QgsRubberBand3D &operator= ( const QgsRubberBand3D & ) = delete;
116};
117
119
120#endif // QGSRUBBERBAND3D_H
Line string geometry type, with support for z-dimension and m-values.
Definition: qgslinestring.h:45
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:49