QGIS API Documentation 3.99.0-Master (09f76ad7019)
Loading...
Searching...
No Matches
qgsfeature3dhandler_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsfeature3dhandler_p.h
3 --------------------------------------
4 Date : January 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 QGSFEATURE3DHANDLER_P_H
17#define QGSFEATURE3DHANDLER_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
32class QgsGeometry;
33class QgsFeature;
34
35#include "qgs3drendercontext.h"
36#include "qgsbox3d.h"
37
38#define SIP_NO_FILE
39
40
45class QgsFeature3DHandler
46{
47 public:
48 virtual ~QgsFeature3DHandler() = default;
49
54 virtual bool prepare( const Qgs3DRenderContext &context, QSet<QString> &attributeNames, const QgsBox3D &chunkExtent ) = 0;
55
60 virtual void processFeature( const QgsFeature &feature, const Qgs3DRenderContext &context ) = 0;
61
66 virtual void finalize( Qt3DCore::QEntity *parent, const Qgs3DRenderContext &context ) = 0;
67
72 float zMinimum() const { return mZMin; }
73
78 float zMaximum() const { return mZMax; }
79
83 int featureCount() const { return mFeatureCount; }
84
90 void setHighlightingEnabled( bool enable ) { mHighlightingEnabled = enable; }
91
96 bool highlightingEnabled() const { return mHighlightingEnabled; }
97
98 protected:
100 void updateZRangeFromPositions( const QVector<QVector3D> &positions );
101
106 bool clipGeometryIfTooLarge( QgsGeometry &geom ) const;
107
108 protected:
109 float mZMin = std::numeric_limits<float>::max();
110 float mZMax = std::numeric_limits<float>::lowest();
111 int mFeatureCount = 0;
112 bool mHighlightingEnabled = false;
113
118 QgsVector3D mChunkOrigin;
119
121 QgsBox3D mChunkExtent;
122
123 private:
125 static constexpr double MAX_GEOM_BBOX_SIZE = 1e6;
126};
127
128
130
131#endif // QGSFEATURE3DHANDLER_P_H
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:60
A geometry is the spatial representation of a feature.