|
| 1 | +class QgsMapToPixelSimplifier : public QgsAbstractGeometrySimplifier |
| 2 | +{ |
| 3 | +%TypeHeaderCode |
| 4 | +#include "qgsmaptopixelgeometrysimplifier.h" |
| 5 | +%End |
| 6 | + public: |
| 7 | + QgsMapToPixelSimplifier( int simplifyFlags, double tolerance ); |
| 8 | + virtual ~QgsMapToPixelSimplifier(); |
| 9 | + |
| 10 | + //! Applicable simplification flags |
| 11 | + enum SimplifyFlag |
| 12 | + { |
| 13 | + NoFlags = 0, //!< No simplification can be applied |
| 14 | + SimplifyGeometry = 1, //!< The geometries can be simplified using the current map2pixel context state |
| 15 | + SimplifyEnvelope = 2, //!< The geometries can be fully simplified by its BoundingBox |
| 16 | + }; |
| 17 | + |
| 18 | + public: |
| 19 | + int simplifyFlags() const; |
| 20 | + void setSimplifyFlags( int simplifyFlags ); |
| 21 | + |
| 22 | + //! Returns a simplified version the specified geometry |
| 23 | + virtual QgsGeometry* simplify( QgsGeometry* geometry ) const; |
| 24 | + //! Simplifies the specified geometry |
| 25 | + virtual bool simplifyGeometry( QgsGeometry* geometry ) const; |
| 26 | + |
| 27 | + // MapToPixel simplification helper methods |
| 28 | + public: |
| 29 | + |
| 30 | + //! Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context |
| 31 | + static bool canbeGeneralizedByMapBoundingBox( const QgsRectangle& envelope, double map2pixelTol ); |
| 32 | + |
| 33 | + //! Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context |
| 34 | + bool canbeGeneralizedByMapBoundingBox( const QgsRectangle& envelope ) const; |
| 35 | + |
| 36 | + //! Simplifies the geometry when is applied the specified map2pixel context |
| 37 | + static bool simplifyGeometry( QgsGeometry* geometry, int simplifyFlags, double tolerance ); |
| 38 | + |
| 39 | +}; |
0 commit comments