QGIS API Documentation  2.17.0-Master (3a3b9ab7)
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 
20 
25 class CORE_EXPORT QgsSimplifyMethod
26 {
27  public:
29  {
32  PreserveTopology
33  };
34 
37 
39  void setMethodType( MethodType methodType );
41  inline MethodType methodType() const { return mMethodType; }
42 
44  void setTolerance( double tolerance );
46  inline double tolerance() const { return mTolerance; }
47 
49  void setThreshold( float threshold ) { mThreshold = threshold; }
51  inline float threshold() const { return mThreshold; }
52 
54  void setForceLocalOptimization( bool localOptimization );
56  inline bool forceLocalOptimization() const { return mForceLocalOptimization; }
57 
59  static QgsAbstractGeometrySimplifier* createGeometrySimplifier( const QgsSimplifyMethod& simplifyMethod );
60 
61  protected:
65  double mTolerance;
67  float mThreshold;
70 };
71 
72 #endif // QGSSIMPLIFYMETHOD_H
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...
MethodType mMethodType
Simplification method.
Simplify using the map2pixel data to optimize the rendering of geometries.
double tolerance() const
Gets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
No simplification is applied.
float mThreshold
Simplification threshold.
bool mForceLocalOptimization
Simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries.
double mTolerance
Simplification tolerance, it represents the maximum distance between two coordinates which can be con...
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
Abstract base class for simplify geometries using a specific algorithm.
MethodType methodType() const
Gets the simplification type.
bool forceLocalOptimization() const
Gets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries.