QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
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 <QPointF>
21
#include <QVector>
22
23
class
QgsGeometry
;
24
class
QgsRectangle
;
25
class
QgsAbstractGeometry
;
26
27
#include "qgis_core.h"
28
#include "
qgis_sip.h
"
29
34
class
CORE_EXPORT
QgsAbstractGeometrySimplifier
35
{
36
public
:
37
virtual
~QgsAbstractGeometrySimplifier
() =
default
;
38
40
virtual
QgsGeometry
simplify
(
const
QgsGeometry
&geometry )
const
= 0;
41
51
virtual
QgsAbstractGeometry
*
simplify
(
const
QgsAbstractGeometry
*geometry )
const
= 0
SIP_FACTORY
;
52
53
// MapToPixel simplification helper methods
54
public
:
56
static
bool
isGeneralizableByDeviceBoundingBox
(
const
QgsRectangle
&envelope,
float
mapToPixelTol = 1.0f );
58
static
bool
isGeneralizableByDeviceBoundingBox
(
const
QVector<QPointF> &points,
float
mapToPixelTol = 1.0f );
59
};
60
61
/***************************************************************************/
62
70
class
CORE_EXPORT
QgsTopologyPreservingSimplifier
:
public
QgsAbstractGeometrySimplifier
71
{
72
public
:
77
QgsTopologyPreservingSimplifier
(
double
tolerance );
78
79
QgsGeometry
simplify
(
const
QgsGeometry
&geometry )
const override
;
80
QgsAbstractGeometry
*
simplify
(
const
QgsAbstractGeometry
*geometry )
const
override
SIP_FACTORY
;
81
82
protected
:
84
double
mTolerance
;
85
};
86
87
#endif
// QGSGEOMETRYSIMPLIFIER_H
QgsAbstractGeometrySimplifier
Abstract base class for simplifying geometries using a specific algorithm.
Definition
qgsgeometrysimplifier.h:35
QgsAbstractGeometrySimplifier::~QgsAbstractGeometrySimplifier
virtual ~QgsAbstractGeometrySimplifier()=default
QgsAbstractGeometrySimplifier::simplify
virtual QgsAbstractGeometry * simplify(const QgsAbstractGeometry *geometry) const =0
Returns a simplified version the specified geometry.
QgsAbstractGeometrySimplifier::isGeneralizableByDeviceBoundingBox
static bool isGeneralizableByDeviceBoundingBox(const QgsRectangle &envelope, float mapToPixelTol=1.0f)
Returns whether the device-envelope can be replaced by its BBOX when is applied the specified toleran...
Definition
qgsgeometrysimplifier.cpp:25
QgsAbstractGeometrySimplifier::simplify
virtual QgsGeometry simplify(const QgsGeometry &geometry) const =0
Returns a simplified version the specified geometry.
QgsAbstractGeometry
Abstract base class for all geometries.
Definition
qgsabstractgeometry.h:82
QgsGeometry
A geometry is the spatial representation of a feature.
Definition
qgsgeometry.h:267
QgsRectangle
A rectangle specified with double values.
Definition
qgsrectangle.h:47
QgsTopologyPreservingSimplifier::simplify
QgsGeometry simplify(const QgsGeometry &geometry) const override
Returns a simplified version the specified geometry.
Definition
qgsgeometrysimplifier.cpp:48
QgsTopologyPreservingSimplifier::mTolerance
double mTolerance
Distance tolerance for the simplification.
Definition
qgsgeometrysimplifier.h:84
QgsTopologyPreservingSimplifier::QgsTopologyPreservingSimplifier
QgsTopologyPreservingSimplifier(double tolerance)
Constructor for QgsTopologyPreservingSimplifier.
Definition
qgsgeometrysimplifier.cpp:44
qgis_sip.h
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
Generated on
for QGIS API Documentation by
1.17.0