QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 
28 class CORE_EXPORT QgsSimplifyMethod
29 {
30  public:
32  {
35  PreserveTopology
36  };
37 
39  QgsSimplifyMethod() = default;
40 
42  void setMethodType( MethodType methodType );
44  inline MethodType methodType() const { return mMethodType; }
45 
47  void setTolerance( double tolerance );
49  inline double tolerance() const { return mTolerance; }
50 
52  void setThreshold( float threshold ) { mThreshold = threshold; }
54  inline float threshold() const { return mThreshold; }
55 
57  void setForceLocalOptimization( bool localOptimization );
59  inline bool forceLocalOptimization() const { return mForceLocalOptimization; }
60 
62  static QgsAbstractGeometrySimplifier *createGeometrySimplifier( const QgsSimplifyMethod &simplifyMethod );
63 
65  bool operator==( const QgsSimplifyMethod &v ) const;
66 
68  bool operator!=( const QgsSimplifyMethod &v ) const;
69 
70  protected:
74  double mTolerance = 1;
76  float mThreshold = 1;
78  bool mForceLocalOptimization = true;
79 };
80 
81 #endif // QGSSIMPLIFYMETHOD_H
QgsSimplifyMethod
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
Definition: qgssimplifymethod.h:28
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:425
QgsSimplifyMethod::forceLocalOptimization
bool forceLocalOptimization() const
Gets whether the simplification executes after fetch the geometries from provider,...
Definition: qgssimplifymethod.h:59
QgsSimplifyMethod::setThreshold
void setThreshold(float threshold)
Sets the simplification threshold in pixels. Represents the maximum distance in pixels between two co...
Definition: qgssimplifymethod.h:52
operator!=
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:430
QgsSimplifyMethod::OptimizeForRendering
@ OptimizeForRendering
Simplify using the map2pixel data to optimize the rendering of geometries.
Definition: qgssimplifymethod.h:34
QgsAbstractGeometrySimplifier
Abstract base class for simplify geometries using a specific algorithm.
Definition: qgsgeometrysimplifier.h:34
QgsSimplifyMethod::tolerance
double tolerance() const
Gets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
Definition: qgssimplifymethod.h:49
QgsSimplifyMethod::NoSimplification
@ NoSimplification
No simplification is applied.
Definition: qgssimplifymethod.h:33
QgsSimplifyMethod::methodType
MethodType methodType() const
Gets the simplification type.
Definition: qgssimplifymethod.h:44
QgsSimplifyMethod::MethodType
MethodType
Definition: qgssimplifymethod.h:31
QgsSimplifyMethod::threshold
float threshold() const
Gets the simplification threshold in pixels. Represents the maximum distance in pixels between two co...
Definition: qgssimplifymethod.h:54