QGIS API Documentation  3.0.2-Girona (307d082)
qgspolygon3dsymbol_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspolygon3dsymbol_p.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 QGSPOLYGON3DSYMBOL_P_H
17 #define QGSPOLYGON3DSYMBOL_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 <Qt3DExtras/QPhongMaterial>
32 #include <Qt3DRender/QGeometryRenderer>
33 
34 class Qgs3DMapSettings;
36 class QgsPolygon3DSymbol;
37 
38 class QgsPointXY;
39 class QgsVectorLayer;
40 class QgsFeatureRequest;
41 
42 
44 class QgsPolygon3DSymbolEntity : public Qt3DCore::QEntity
45 {
46  public:
47  QgsPolygon3DSymbolEntity( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsPolygon3DSymbol &symbol, Qt3DCore::QNode *parent = nullptr );
48 
49  private:
50  void addEntityForSelectedPolygons( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsPolygon3DSymbol &symbol );
51  void addEntityForNotSelectedPolygons( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsPolygon3DSymbol &symbol );
52 
53  Qt3DExtras::QPhongMaterial *material( const QgsPolygon3DSymbol &symbol ) const;
54 };
55 
56 class QgsPolygon3DSymbolEntityNode : public Qt3DCore::QEntity
57 {
58  public:
59  QgsPolygon3DSymbolEntityNode( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsPolygon3DSymbol &symbol, const QgsFeatureRequest &req, Qt3DCore::QNode *parent = nullptr );
60 
61  private:
62  Qt3DRender::QGeometryRenderer *renderer( const Qgs3DMapSettings &map, const QgsPolygon3DSymbol &symbol, const QgsVectorLayer *layer, const QgsFeatureRequest &request );
63 
64  QgsTessellatedPolygonGeometry *mGeometry = nullptr;
65 };
66 
68 
69 #endif // QGSPOLYGON3DSYMBOL_P_H
A class to represent a 2D point.
Definition: qgspointxy.h:43
3 3D symbol that draws polygon geometries as planar polygons, optionally extruded (with added walls)...
3 Definition of the world
3 Class derived from Qt3DRender::QGeometry that represents polygons tessellated into 3D geometry...
This class wraps a request for features to a vector layer (or directly its vector data provider)...
Represents a vector layer which manages a vector based data sets.