QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
qgs3dmapsceneentity_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgs3dmapsceneentity_p.h
3 --------------------------------------
4 Date : May 2023
5 Copyright : (C) 2023 by Stefanos Natsis
6 Email : uclaros 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 QGS3DMAPSCENEENTITY_P_H
17#define QGS3DMAPSCENEENTITY_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 <Qt3DCore/QEntity>
31#include <QVector3D>
32#include <QMatrix4x4>
33
34#include "qgsrange.h"
35
36#define SIP_NO_FILE
37
38
44class Qgs3DMapSceneEntity : public Qt3DCore::QEntity
45{
46 Q_OBJECT
47 public:
49 Qgs3DMapSceneEntity( Qt3DCore::QNode *parent = nullptr )
50 : Qt3DCore::QEntity( parent )
51 {}
52
54 struct SceneState
55 {
56 QVector3D cameraPos;
57 float cameraFov;
58 int screenSizePx;
59 QMatrix4x4 viewProjectionMatrix;
60 };
61
63 virtual void handleSceneUpdate( const SceneState &state ) { Q_UNUSED( state ) }
64
66 virtual int pendingJobsCount() const { return 0; }
67
69 virtual bool needsUpdate() const { return false; }
70
72 virtual QgsRange<float> getNearFarPlaneRange( const QMatrix4x4 &viewMatrix ) const { Q_UNUSED( viewMatrix ) return QgsRange<float>( 1e9, 0 ); }
73
74 signals:
76 void pendingJobsCountChanged();
77
79 void newEntityCreated( Qt3DCore::QEntity *entity );
80};
81
83
84#endif // QGS3DMAPSCENEENTITY_P_H
A template based class for storing ranges (lower to upper values).
Definition: qgsrange.h:47