QGIS API Documentation
3.14.0-Pi (9f7028fd23)
src
core
qgsgeometrysimplifier.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsgeometrysimplifier.h
3
---------------------
4
begin : December 2013
5
copyright : (C) 2013 by Alvaro Huarte
6
email : http://wiki.osgeo.org/wiki/Alvaro_Huarte
7
8
***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
17
#ifndef QGSGEOMETRYSIMPLIFIER_H
18
#define QGSGEOMETRYSIMPLIFIER_H
19
20
#include <QVector>
21
#include <QPointF>
22
23
class
QgsGeometry
;
24
class
QgsRectangle
;
25
26
#include "qgis_core.h"
27
32
class
CORE_EXPORT
QgsAbstractGeometrySimplifier
33
{
34
public
:
35
virtual
~
QgsAbstractGeometrySimplifier
() =
default
;
36
38
virtual
QgsGeometry
simplify(
const
QgsGeometry
&geometry )
const
= 0;
39
40
// MapToPixel simplification helper methods
41
public
:
43
static
bool
isGeneralizableByDeviceBoundingBox(
const
QgsRectangle
&envelope,
float
mapToPixelTol = 1.0f );
45
static
bool
isGeneralizableByDeviceBoundingBox(
const
QVector<QPointF> &points,
float
mapToPixelTol = 1.0f );
46
};
47
48
/***************************************************************************/
49
57
class
CORE_EXPORT
QgsTopologyPreservingSimplifier
:
public
QgsAbstractGeometrySimplifier
58
{
59
public
:
60
65
QgsTopologyPreservingSimplifier
(
double
tolerance );
66
67
QgsGeometry
simplify
(
const
QgsGeometry
&geometry )
const override
;
68
69
protected
:
71
double
mTolerance
;
72
73
};
74
75
#endif // QGSGEOMETRYSIMPLIFIER_H
QgsRectangle
Definition:
qgsrectangle.h:41
QgsAbstractGeometrySimplifier
Definition:
qgsgeometrysimplifier.h:32
QgsTopologyPreservingSimplifier
Definition:
qgsgeometrysimplifier.h:57
QgsGeometry
Definition:
qgsgeometry.h:122
QgsAbstractGeometrySimplifier::simplify
virtual QgsGeometry simplify(const QgsGeometry &geometry) const =0
Returns a simplified version the specified geometry.
QgsTopologyPreservingSimplifier::mTolerance
double mTolerance
Distance tolerance for the simplification.
Definition:
qgsgeometrysimplifier.h:71
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17