-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1249 from Oslandia/expose_simplifier
Expose QgsMapToPixelSimplifier to Python
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
class QgsMapToPixelSimplifier : public QgsAbstractGeometrySimplifier | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsmaptopixelgeometrysimplifier.h" | ||
%End | ||
public: | ||
QgsMapToPixelSimplifier( int simplifyFlags, double tolerance ); | ||
virtual ~QgsMapToPixelSimplifier(); | ||
|
||
//! Applicable simplification flags | ||
enum SimplifyFlag | ||
{ | ||
NoFlags = 0, //!< No simplification can be applied | ||
SimplifyGeometry = 1, //!< The geometries can be simplified using the current map2pixel context state | ||
SimplifyEnvelope = 2, //!< The geometries can be fully simplified by its BoundingBox | ||
}; | ||
|
||
public: | ||
int simplifyFlags() const; | ||
void setSimplifyFlags( int simplifyFlags ); | ||
|
||
//! Returns a simplified version the specified geometry | ||
virtual QgsGeometry* simplify( QgsGeometry* geometry ) const; | ||
//! Simplifies the specified geometry | ||
virtual bool simplifyGeometry( QgsGeometry* geometry ) const; | ||
|
||
// MapToPixel simplification helper methods | ||
public: | ||
|
||
//! Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context | ||
static bool canbeGeneralizedByMapBoundingBox( const QgsRectangle& envelope, double map2pixelTol ); | ||
|
||
//! Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context | ||
bool canbeGeneralizedByMapBoundingBox( const QgsRectangle& envelope ) const; | ||
|
||
//! Simplifies the geometry when is applied the specified map2pixel context | ||
static bool simplifyGeometry( QgsGeometry* geometry, int simplifyFlags, double tolerance ); | ||
|
||
}; |