QGIS API Documentation  3.0.2-Girona (307d082)
qgstessellator.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgstessellator.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 QGSTESSELLATOR_H
17 #define QGSTESSELLATOR_H
18 
19 #include "qgis_3d.h"
20 
21 class QgsPolygon;
22 class QgsMultiPolygon;
23 
24 #include <QVector>
25 #include <memory>
26 
38 class _3D_EXPORT QgsTessellator
39 {
40  public:
42  QgsTessellator( double originX, double originY, bool addNormals, bool invertNormals = false );
43 
45  void addPolygon( const QgsPolygon &polygon, float extrusionHeight );
46 
48  QVector<float> data() const { return mData; }
50  int stride() const { return mStride; }
51 
55  std::unique_ptr< QgsMultiPolygon > asMultiPolygon() const;
56 
57  private:
58  double mOriginX, mOriginY;
59  bool mAddNormals;
60  bool mInvertNormals;
61  QVector<float> mData;
62  int mStride;
63 };
64 
65 #endif // QGSTESSELLATOR_H
QVector< float > data() const
Returns array of triangle vertex data.
int stride() const
Returns size of one vertex entry in bytes.
3 Class that takes care of tessellation of polygons into triangles.
Multi polygon geometry collection.
Polygon geometry type.
Definition: qgspolygon.h:31