Skip to content

Commit

Permalink
#8725-R: include qgsvectorsimplifymethod.sip
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuarte47 authored and m-kuhn committed Jan 15, 2014
1 parent 42fd6a2 commit d439dfb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
1 change: 1 addition & 0 deletions python/core/core.sip
Expand Up @@ -86,6 +86,7 @@
%Include qgsvectorlayerimport.sip
%Include qgsvectorlayerjoinbuffer.sip
%Include qgsvectorlayerundocommand.sip
%Include qgsvectorsimplifymethod.sip
%Include qgsfontutils.sip

%Include qgscachedfeatureiterator.sip
Expand Down
19 changes: 6 additions & 13 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -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;
Expand Down
29 changes: 29 additions & 0 deletions 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();
};

0 comments on commit d439dfb

Please sign in to comment.