QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgssimplifymethod.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgssimplifymethod.h
3
---------------------
4
begin : December 2013
5
copyright : (C) 2013 by Matthias Kuhn / Alvaro Huarte
6
email :
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 QGSSIMPLIFYMETHOD_H
17
#define QGSSIMPLIFYMETHOD_H
18
19
#include "qgis_core.h"
20
21
class
QgsAbstractGeometrySimplifier
;
22
27
class
CORE_EXPORT
QgsSimplifyMethod
28
{
29
public
:
30
enum
MethodType
31
{
32
NoSimplification
,
33
OptimizeForRendering
,
34
PreserveTopology
35
};
36
38
QgsSimplifyMethod
() =
default
;
39
41
void
setMethodType
(
MethodType
methodType
);
43
inline
MethodType
methodType
()
const
{
return
mMethodType
; }
44
46
void
setTolerance(
double
tolerance );
48
inline
double
tolerance
()
const
{
return
mTolerance
; }
49
51
void
setThreshold
(
float
threshold
) {
mThreshold
=
threshold
; }
53
inline
float
threshold
()
const
{
return
mThreshold
; }
54
56
void
setForceLocalOptimization(
bool
localOptimization );
58
inline
bool
forceLocalOptimization
()
const
{
return
mForceLocalOptimization
; }
59
61
static
QgsAbstractGeometrySimplifier
*createGeometrySimplifier(
const
QgsSimplifyMethod
&simplifyMethod );
62
63
bool
operator==
(
const
QgsSimplifyMethod
&v )
const
;
64
bool
operator!=
(
const
QgsSimplifyMethod
&v )
const
;
65
66
protected
:
68
MethodType
mMethodType
=
QgsSimplifyMethod::NoSimplification
;
70
double
mTolerance
= 1;
72
float
mThreshold
= 1;
74
bool
mForceLocalOptimization
=
true
;
75
};
76
77
#endif
// QGSSIMPLIFYMETHOD_H
QgsAbstractGeometrySimplifier
Abstract base class for simplifying geometries using a specific algorithm.
Definition
qgsgeometrysimplifier.h:35
QgsSimplifyMethod
Contains information about how to simplify geometries fetched from a QgsFeatureIterator.
Definition
qgssimplifymethod.h:28
QgsSimplifyMethod::QgsSimplifyMethod
QgsSimplifyMethod()=default
construct a default method
QgsSimplifyMethod::threshold
float threshold() const
Gets the simplification threshold in pixels. Represents the maximum distance in pixels between two co...
Definition
qgssimplifymethod.h:53
QgsSimplifyMethod::setThreshold
void setThreshold(float threshold)
Sets the simplification threshold in pixels. Represents the maximum distance in pixels between two co...
Definition
qgssimplifymethod.h:51
QgsSimplifyMethod::tolerance
double tolerance() const
Gets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
Definition
qgssimplifymethod.h:48
QgsSimplifyMethod::mTolerance
double mTolerance
Simplification tolerance, it represents the maximum distance between two coordinates which can be con...
Definition
qgssimplifymethod.h:70
QgsSimplifyMethod::mForceLocalOptimization
bool mForceLocalOptimization
Simplification executes after fetch the geometries from provider, otherwise it executes,...
Definition
qgssimplifymethod.h:74
QgsSimplifyMethod::forceLocalOptimization
bool forceLocalOptimization() const
Gets whether the simplification executes after fetch the geometries from provider,...
Definition
qgssimplifymethod.h:58
QgsSimplifyMethod::mMethodType
MethodType mMethodType
Simplification method.
Definition
qgssimplifymethod.h:68
QgsSimplifyMethod::setMethodType
void setMethodType(MethodType methodType)
Sets the simplification type.
Definition
qgssimplifymethod.cpp:26
QgsSimplifyMethod::mThreshold
float mThreshold
Simplification threshold.
Definition
qgssimplifymethod.h:72
QgsSimplifyMethod::methodType
MethodType methodType() const
Gets the simplification type.
Definition
qgssimplifymethod.h:43
QgsSimplifyMethod::MethodType
MethodType
Definition
qgssimplifymethod.h:31
QgsSimplifyMethod::OptimizeForRendering
@ OptimizeForRendering
Simplify using the map2pixel data to optimize the rendering of geometries.
Definition
qgssimplifymethod.h:33
QgsSimplifyMethod::NoSimplification
@ NoSimplification
No simplification is applied.
Definition
qgssimplifymethod.h:32
QgsSimplifyMethod::PreserveTopology
@ PreserveTopology
Simplify using the Douglas-Peucker algorithm ensuring that the result is a valid geometry.
Definition
qgssimplifymethod.h:34
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition
qgsfeatureiterator.h:427
operator!=
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition
qgsfeatureiterator.h:432
Generated on
for QGIS API Documentation by
1.17.0