From d439dfbc881ec56f4539a3b8306e2ae309f0d4dd Mon Sep 17 00:00:00 2001 From: ahuarte47 Date: Mon, 6 Jan 2014 22:54:07 +0100 Subject: [PATCH] #8725-R: include qgsvectorsimplifymethod.sip --- python/core/core.sip | 1 + python/core/qgsvectorlayer.sip | 19 +++++----------- python/core/qgsvectorsimplifymethod.sip | 29 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 python/core/qgsvectorsimplifymethod.sip diff --git a/python/core/core.sip b/python/core/core.sip index e958e926843..aca5927372c 100644 --- a/python/core/core.sip +++ b/python/core/core.sip @@ -86,6 +86,7 @@ %Include qgsvectorlayerimport.sip %Include qgsvectorlayerjoinbuffer.sip %Include qgsvectorlayerundocommand.sip +%Include qgsvectorsimplifymethod.sip %Include qgsfontutils.sip %Include qgscachedfeatureiterator.sip diff --git a/python/core/qgsvectorlayer.sip b/python/core/qgsvectorlayer.sip index a159ecb2f3e..1bd1acf1a1b 100644 --- a/python/core/qgsvectorlayer.sip +++ b/python/core/qgsvectorlayer.sip @@ -999,25 +999,18 @@ class QgsVectorLayer : QgsMapLayer /** @note not available in python bindings */ // inline QgsGeometryCache* cache(); - /** Set the Map2pixel simplification threshold for fast rendering of features */ - void setSimplifyDrawingTol( float simplifyDrawingTol ); - /** Returns the Map2pixel simplification threshold for fast rendering of features */ - float simplifyDrawingTol() const; - /** Simplification flags for fast rendering of features */ enum SimplifyHint { NoSimplification = 0, //!< No simplification can be applied GeometrySimplification = 1, //!< The geometries can be simplified using the current map2pixel context state - EnvelopeSimplification = 2, //!< The geometries can be fully simplified by its BoundingBox using the current map2pixel context state - AntialiasingSimplification = 4, //!< The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size' - DefaultSimplification = 3, //!< Default simplification hints can be applied ( Geometry + Envelope ) - FullSimplification = 7, //!< All simplification hints can be applied ( Geometry + Envelope + AA-disabling ) + AntialiasingSimplification = 2, //!< The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size' + FullSimplification = 3, //!< All simplification hints can be applied ( Geometry + AA-disabling ) }; - /** Set the Map2pixel simplification hints for fast rendering of features */ - void setSimplifyDrawingHints( int simplifyDrawingHints ); - /** Returns the Map2pixel simplification hints for fast rendering of features */ - int simplifyDrawingHints() const; + /** Set the simplification settings for fast rendering of features */ + void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ); + /** Returns the simplification settings for fast rendering of features */ + const QgsVectorSimplifyMethod& simplifyMethod() const; /** Returns whether the VectorLayer can apply the specified simplification hint */ bool simplifyDrawingCanbeApplied( int simplifyHint ) const; diff --git a/python/core/qgsvectorsimplifymethod.sip b/python/core/qgsvectorsimplifymethod.sip new file mode 100644 index 00000000000..61a4ef665fa --- /dev/null +++ b/python/core/qgsvectorsimplifymethod.sip @@ -0,0 +1,29 @@ + +/** This class contains information how to simplify geometries fetched from a vector layer */ +class QgsVectorSimplifyMethod +{ +%TypeHeaderCode +#include "qgsvectorsimplifymethod.h" +%End + + public: + //! construct a default object + QgsVectorSimplifyMethod(); + //! copy constructor + QgsVectorSimplifyMethod( const QgsVectorSimplifyMethod& rh ); + + /** Sets the simplification hints of the vector layer managed */ + void setSimplifyHints( int simplifyHints ); + /** Gets the simplification hints of the vector layer managed */ + int simplifyHints() const; + + /** Sets the simplification threshold of the vector layer managed */ + void setThreshold( float threshold ); + /** Gets the simplification threshold of the vector layer managed */ + float threshold() const; + + /** Sets where the simplification executes, after fetch the geometries from provider, or when supported, in provider before fetch the geometries */ + void setForceLocalOptimization( bool localOptimization ); + /** Gets where the simplification executes, after fetch the geometries from provider, or when supported, in provider before fetch the geometries */ + bool forceLocalOptimization(); +};