QGIS API Documentation 3.39.0-Master (bca3cdb6021)
Loading...
Searching...
No Matches
qgsvectorsimplifymethod.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectorsimplifymethod.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 * 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 QGSVECTORSIMPLIFYMETHOD_H
17#define QGSVECTORSIMPLIFYMETHOD_H
18
19#include <QFlags>
20#include <QObject>
21
22#include "qgis_core.h"
23#include "qgis_sip.h"
24#include "qgis.h"
25
30class CORE_EXPORT QgsVectorSimplifyMethod
31{
32 Q_GADGET
33 public:
36
38 void setSimplifyHints( Qgis::VectorRenderingSimplificationFlags simplifyHints ) { mSimplifyHints = simplifyHints; }
40 inline Qgis::VectorRenderingSimplificationFlags simplifyHints() const { return mSimplifyHints; }
41
43 void setSimplifyAlgorithm( Qgis::VectorSimplificationAlgorithm simplifyAlgorithm ) { mSimplifyAlgorithm = simplifyAlgorithm; }
45 inline Qgis::VectorSimplificationAlgorithm simplifyAlgorithm() const { return mSimplifyAlgorithm; }
46
48 void setTolerance( double tolerance ) { mTolerance = tolerance; }
50 inline double tolerance() const { return mTolerance; }
51
53 void setThreshold( float threshold ) { mThreshold = threshold; }
55 inline float threshold() const { return mThreshold; }
56
58 void setForceLocalOptimization( bool localOptimization ) { mLocalOptimization = localOptimization; }
60 inline bool forceLocalOptimization() const { return mLocalOptimization; }
61
63 void setMaximumScale( float maximumScale ) { mMaximumScale = maximumScale; }
65 inline float maximumScale() const { return mMaximumScale; }
66
67 private:
73 double mTolerance = 1;
75 float mThreshold;
77 bool mLocalOptimization = true;
79 float mMaximumScale = 1;
80};
81
82
83#endif // QGSVECTORSIMPLIFYMETHOD_H
QFlags< VectorRenderingSimplificationFlag > VectorRenderingSimplificationFlags
Simplification flags for vector feature rendering.
Definition qgis.h:2812
VectorSimplificationAlgorithm
Simplification algorithms for vector features.
Definition qgis.h:2781
@ Distance
The simplification uses the distance between points to remove duplicate points.
This class contains information how to simplify geometries fetched from a vector layer.
double tolerance() const
Gets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
bool forceLocalOptimization() const
Gets where the simplification executes, after fetch the geometries from provider, or when supported,...
Qgis::VectorRenderingSimplificationFlags simplifyHints() const
Gets the simplification hints of the vector layer managed.
float maximumScale() const
Gets the maximum scale at which the layer should be simplified.
Qgis::VectorSimplificationAlgorithm simplifyAlgorithm() const
Gets the local simplification algorithm of the vector layer managed.
void setThreshold(float threshold)
Sets the simplification threshold of the vector layer managed.
void setForceLocalOptimization(bool localOptimization)
Sets where the simplification executes, after fetch the geometries from provider, or when supported,...
void setSimplifyHints(Qgis::VectorRenderingSimplificationFlags simplifyHints)
Sets the simplification hints of the vector layer managed.
void setTolerance(double tolerance)
Sets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
float threshold() const
Gets the simplification threshold of the vector layer managed.
void setMaximumScale(float maximumScale)
Sets the maximum scale at which the layer should be simplified.
void setSimplifyAlgorithm(Qgis::VectorSimplificationAlgorithm simplifyAlgorithm)
Sets the local simplification algorithm of the vector layer managed.