Skip to content
Permalink
Browse files

#8725-R: include qgsvectorsimplifymethod.sip

  • Loading branch information
ahuarte47 authored and m-kuhn committed Jan 15, 2014
1 parent 42fd6a2 commit d439dfbc881ec56f4539a3b8306e2ae309f0d4dd
Showing with 36 additions and 13 deletions.
  1. +1 −0 python/core/core.sip
  2. +6 −13 python/core/qgsvectorlayer.sip
  3. +29 −0 python/core/qgsvectorsimplifymethod.sip
@@ -86,6 +86,7 @@
%Include qgsvectorlayerimport.sip
%Include qgsvectorlayerjoinbuffer.sip
%Include qgsvectorlayerundocommand.sip
%Include qgsvectorsimplifymethod.sip
%Include qgsfontutils.sip

%Include qgscachedfeatureiterator.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;
@@ -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();
};

0 comments on commit d439dfb

Please sign in to comment.
You can’t perform that action at this time.