QGIS API Documentation  3.6.0-Noosa (5873452)
qgsquickhighlightsgnode.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsquickhighlightsgnode.h
3  --------------------------------------
4  Date : Nov 2017
5  Copyright : (C) 2017 by Matthias Kuhn
6  Email : [email protected]
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 QGSQUICKHIGHLIGHTSGNODE_H
17 #define QGSQUICKHIGHLIGHTSGNODE_H
18 
19 #include <QtQuick/QSGNode>
20 #include <QtQuick/QSGFlatColorMaterial>
21 
22 #include "qgsgeometry.h"
23 #include "qgis_quick.h"
24 
25 class QgsLineString;
26 class QgsPoint;
27 class QgsPolygon;
28 
38 class QUICK_EXPORT QgsQuickHighlightSGNode : public QSGNode
39 {
40  public:
41 
49  QgsQuickHighlightSGNode( const QgsGeometry &geom, const QColor &color, float width );
51  ~QgsQuickHighlightSGNode() = default;
52 
53  private:
54  void handleGeometryCollection( const QgsAbstractGeometry *geom, QgsWkbTypes::GeometryType type );
55  void handleSingleGeometry( const QgsAbstractGeometry *geom, QgsWkbTypes::GeometryType type );
56 
57  QSGGeometryNode *createLineGeometry( const QgsLineString *line );
58  QSGGeometryNode *createPointGeometry( const QgsPoint *point );
59  QSGGeometryNode *createPolygonGeometry( const QgsPolygon *polygon );
60 
61  QSGFlatColorMaterial mMaterial;
62  float mWidth = 20;
63 };
64 
65 #endif // QGSQUICKHIGHLIGHTSGNODE
This is used to transform (render) QgsGeometry to node for QtQuick scene graph.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:106
Abstract base class for all geometries.
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:138
Line string geometry type, with support for z-dimension and m-values.
Definition: qgslinestring.h:43
Polygon geometry type.
Definition: qgspolygon.h:31