QGIS API Documentation 4.3.0-Master (16eddb2670e)
Loading...
Searching...
No Matches
qgsterrainentity.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsterrainentity.h
3 --------------------------------------
4 Date : July 2017
5 Copyright : (C) 2017 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 QGSTERRAINENTITY_H
17#define QGSTERRAINENTITY_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 <memory>
32
33#include "qgschunkedentity.h"
35#include "qobjectuniqueptr.h"
36
37#define SIP_NO_FILE
38
39namespace Qt3DCore
40{
41 class QTransform;
42}
43
45class QgsTerrainTextureGenerator;
47class QgsMapLayer;
49class QgsLayerStyleWatcher;
50
56class QgsTerrainEntity : public QgsChunkedEntity
57{
58 Q_OBJECT
59 public:
61 explicit QgsTerrainEntity( Qgs3DMapSettings *map, Qt3DCore::QNode *parent = nullptr );
62
63 ~QgsTerrainEntity() override;
64
66 QgsTerrainTextureGenerator *textureGenerator() { return mTextureGenerator.get(); }
67
69 Qt3DCore::QTransform *transform() const { return mTerrainTransform; }
71 float terrainElevationOffset() const;
72
73 QList<QgsRayCastHit> rayIntersection( const QgsRay3D &ray, const QgsRayCastContext &context ) const override;
74
75 private slots:
76 void onShowBoundingBoxesChanged();
77 void invalidateMapImages();
78 void onTerrainElevationOffsetChanged();
79
80 private:
81 std::unique_ptr<QgsTerrainTextureGenerator> mTextureGenerator;
82 Qt3DCore::QTransform *mTerrainTransform = nullptr;
83
84 QObjectUniquePtr<QgsLayerStyleWatcher> mLayerWatcher;
85};
86
88
89#endif // QGSTERRAINENTITY_H
Definition of the world.
Handles coordinate transforms between two coordinate systems.
Base class for all map layer types.
Definition qgsmaplayer.h:83
Base class for generators of terrain.