QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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
22
27class CORE_EXPORT QgsSimplifyMethod
28{
29 public:
36
38 QgsSimplifyMethod() = default;
39
43 inline MethodType methodType() const { return mMethodType; }
44
46 void setTolerance( double tolerance );
48 inline double tolerance() const { return mTolerance; }
49
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:
70 double mTolerance = 1;
72 float mThreshold = 1;
75};
76
77#endif // QGSSIMPLIFYMETHOD_H
Abstract base class for simplifying geometries using a specific algorithm.
Contains information about how to simplify geometries fetched from a QgsFeatureIterator.
QgsSimplifyMethod()=default
construct a default method
float threshold() const
Gets the simplification threshold in pixels. Represents the maximum distance in pixels between two co...
void setThreshold(float threshold)
Sets the simplification threshold in pixels. Represents the maximum distance in pixels between two co...
double tolerance() const
Gets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
double mTolerance
Simplification tolerance, it represents the maximum distance between two coordinates which can be con...
bool mForceLocalOptimization
Simplification executes after fetch the geometries from provider, otherwise it executes,...
bool forceLocalOptimization() const
Gets whether the simplification executes after fetch the geometries from provider,...
MethodType mMethodType
Simplification method.
void setMethodType(MethodType methodType)
Sets the simplification type.
float mThreshold
Simplification threshold.
MethodType methodType() const
Gets the simplification type.
@ OptimizeForRendering
Simplify using the map2pixel data to optimize the rendering of geometries.
@ NoSimplification
No simplification is applied.
@ PreserveTopology
Simplify using the Douglas-Peucker algorithm ensuring that the result is a valid geometry.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)