QGIS API Documentation  3.2.0-Bonn (bc43194)
qgspoint3dsymbol_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspoint3dsymbol_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 QGSPOINT3DSYMBOL_P_H
17 #define QGSPOINT3DSYMBOL_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 <Qt3DRender/QMaterial>
32 #include <Qt3DRender/QGeometryRenderer>
33 #include <Qt3DCore/QTransform>
34 
35 #include "qgspoint3dsymbol.h"
36 
37 class Qgs3DMapSettings;
38 class QgsPoint3DSymbol;
39 
40 class QgsVectorLayer;
41 class QgsFeatureRequest;
42 
43 
45 class QgsPoint3DSymbolEntity : public Qt3DCore::QEntity
46 {
47  public:
48  QgsPoint3DSymbolEntity( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsPoint3DSymbol &symbol, Qt3DCore::QNode *parent = nullptr );
49 };
50 
51 class QgsPoint3DSymbolInstancedEntityFactory
52 {
53  public:
54  static void addEntityForSelectedPoints( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsPoint3DSymbol &symbol, QgsPoint3DSymbolEntity *parent );
55  static void addEntityForNotSelectedPoints( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsPoint3DSymbol &symbol, QgsPoint3DSymbolEntity *parent );
56 
57  private:
58  static Qt3DRender::QMaterial *material( const QgsPoint3DSymbol &symbol );
59 };
60 
61 class QgsPoint3DSymbolInstancedEntityNode : public Qt3DCore::QEntity
62 {
63  public:
64  QgsPoint3DSymbolInstancedEntityNode( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsPoint3DSymbol &symbol, const QgsFeatureRequest &req, Qt3DCore::QNode *parent = nullptr );
65 
66  private:
67  Qt3DRender::QGeometryRenderer *renderer( const QgsPoint3DSymbol &symbol, const QList<QVector3D> &positions ) const;
68  Qt3DRender::QGeometry *symbolGeometry( QgsPoint3DSymbol::Shape shape, const QVariantMap &shapeProperties ) const;
69 };
70 
71 class QgsPoint3DSymbolModelEntityFactory
72 {
73  public:
74  static void addEntitiesForSelectedPoints( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsPoint3DSymbol &symbol, QgsPoint3DSymbolEntity *parent );
75  static void addEntitiesForNotSelectedPoints( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsPoint3DSymbol &symbol, QgsPoint3DSymbolEntity *parent );
76 
77  private:
78  static void addSceneEntities( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsFeatureRequest &req, const QgsPoint3DSymbol &symbol, QgsPoint3DSymbolEntity *parent );
79  static void addMeshEntities( const Qgs3DMapSettings &map, QgsVectorLayer *layer, const QgsFeatureRequest &req, const QgsPoint3DSymbol &symbol, QgsPoint3DSymbolEntity *parent, bool are_selected );
80 
81  static Qt3DCore::QTransform *transform( const QVector3D &position, const QgsPoint3DSymbol &symbol );
82 };
83 
85 
86 #endif // QGSPOINT3DSYMBOL_P_H
3 Definition of the world
3 3D symbol that draws point geometries as 3D objects using one of the predefined shapes...
This class wraps a request for features to a vector layer (or directly its vector data provider)...
Shape
3D shape types supported by the symbol
Represents a vector layer which manages a vector based data sets.