Skip to content

Commit d439dfb

Browse files
ahuarte47m-kuhn
authored andcommitted
#8725-R: include qgsvectorsimplifymethod.sip
1 parent 42fd6a2 commit d439dfb

File tree

3 files changed

+36
-13
lines changed

3 files changed

+36
-13
lines changed

python/core/core.sip

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
%Include qgsvectorlayerimport.sip
8787
%Include qgsvectorlayerjoinbuffer.sip
8888
%Include qgsvectorlayerundocommand.sip
89+
%Include qgsvectorsimplifymethod.sip
8990
%Include qgsfontutils.sip
9091

9192
%Include qgscachedfeatureiterator.sip

python/core/qgsvectorlayer.sip

+6-13
Original file line numberDiff line numberDiff line change
@@ -999,25 +999,18 @@ class QgsVectorLayer : QgsMapLayer
999999
/** @note not available in python bindings */
10001000
// inline QgsGeometryCache* cache();
10011001

1002-
/** Set the Map2pixel simplification threshold for fast rendering of features */
1003-
void setSimplifyDrawingTol( float simplifyDrawingTol );
1004-
/** Returns the Map2pixel simplification threshold for fast rendering of features */
1005-
float simplifyDrawingTol() const;
1006-
10071002
/** Simplification flags for fast rendering of features */
10081003
enum SimplifyHint
10091004
{
10101005
NoSimplification = 0, //!< No simplification can be applied
10111006
GeometrySimplification = 1, //!< The geometries can be simplified using the current map2pixel context state
1012-
EnvelopeSimplification = 2, //!< The geometries can be fully simplified by its BoundingBox using the current map2pixel context state
1013-
AntialiasingSimplification = 4, //!< The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size'
1014-
DefaultSimplification = 3, //!< Default simplification hints can be applied ( Geometry + Envelope )
1015-
FullSimplification = 7, //!< All simplification hints can be applied ( Geometry + Envelope + AA-disabling )
1007+
AntialiasingSimplification = 2, //!< The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size'
1008+
FullSimplification = 3, //!< All simplification hints can be applied ( Geometry + AA-disabling )
10161009
};
1017-
/** Set the Map2pixel simplification hints for fast rendering of features */
1018-
void setSimplifyDrawingHints( int simplifyDrawingHints );
1019-
/** Returns the Map2pixel simplification hints for fast rendering of features */
1020-
int simplifyDrawingHints() const;
1010+
/** Set the simplification settings for fast rendering of features */
1011+
void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod );
1012+
/** Returns the simplification settings for fast rendering of features */
1013+
const QgsVectorSimplifyMethod& simplifyMethod() const;
10211014

10221015
/** Returns whether the VectorLayer can apply the specified simplification hint */
10231016
bool simplifyDrawingCanbeApplied( int simplifyHint ) const;
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
/** This class contains information how to simplify geometries fetched from a vector layer */
3+
class QgsVectorSimplifyMethod
4+
{
5+
%TypeHeaderCode
6+
#include "qgsvectorsimplifymethod.h"
7+
%End
8+
9+
public:
10+
//! construct a default object
11+
QgsVectorSimplifyMethod();
12+
//! copy constructor
13+
QgsVectorSimplifyMethod( const QgsVectorSimplifyMethod& rh );
14+
15+
/** Sets the simplification hints of the vector layer managed */
16+
void setSimplifyHints( int simplifyHints );
17+
/** Gets the simplification hints of the vector layer managed */
18+
int simplifyHints() const;
19+
20+
/** Sets the simplification threshold of the vector layer managed */
21+
void setThreshold( float threshold );
22+
/** Gets the simplification threshold of the vector layer managed */
23+
float threshold() const;
24+
25+
/** Sets where the simplification executes, after fetch the geometries from provider, or when supported, in provider before fetch the geometries */
26+
void setForceLocalOptimization( bool localOptimization );
27+
/** Gets where the simplification executes, after fetch the geometries from provider, or when supported, in provider before fetch the geometries */
28+
bool forceLocalOptimization();
29+
};

0 commit comments

Comments
 (0)