QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 );
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
QgsPolygon
Polygon geometry type.
Definition: qgspolygon.h:34
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:38
QgsLineString
Line string geometry type, with support for z-dimension and m-values.
Definition: qgslinestring.h:44
QgsQuickHighlightSGNode
This is used to transform (render) QgsGeometry to node for QtQuick scene graph.
Definition: qgsquickhighlightsgnode.h:39
QgsAbstractGeometry
Abstract base class for all geometries.
Definition: qgsabstractgeometry.h:74
qgsgeometry.h
QgsWkbTypes::GeometryType
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:141
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsQuickHighlightSGNode::~QgsQuickHighlightSGNode
~QgsQuickHighlightSGNode()=default
Destructor.