2017-05-14 09:48:41 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsmaptopixelgeometrysimplifier.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-09 04:38:20 +02:00
|
|
|
class QgsMapToPixelSimplifier : QgsAbstractGeometrySimplifier
|
2014-03-13 11:27:16 +01:00
|
|
|
{
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Implementation of GeometrySimplifier using the "MapToPixel" algorithm
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
Simplifies a geometry removing points within of the maximum distance difference that defines the MapToPixel info of a RenderContext request.
|
|
|
|
This class enables simplify the geometries to be rendered in a MapCanvas target to speed up the vector drawing.
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
|
|
|
|
2014-03-13 11:27:16 +01:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmaptopixelgeometrysimplifier.h"
|
|
|
|
%End
|
|
|
|
public:
|
2016-03-23 09:28:20 +01:00
|
|
|
enum SimplifyAlgorithm
|
|
|
|
{
|
2017-05-14 09:48:41 +02:00
|
|
|
Distance,
|
|
|
|
SnapToGrid,
|
|
|
|
Visvalingam,
|
2016-03-23 09:28:20 +01:00
|
|
|
};
|
|
|
|
|
2016-05-15 05:18:16 +02:00
|
|
|
QgsMapToPixelSimplifier( int simplifyFlags, double tolerance, SimplifyAlgorithm simplifyAlgorithm = Distance );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Constructor
|
|
|
|
%End
|
2014-03-13 11:27:16 +01:00
|
|
|
|
|
|
|
enum SimplifyFlag
|
|
|
|
{
|
2017-05-14 09:48:41 +02:00
|
|
|
NoFlags,
|
|
|
|
SimplifyGeometry,
|
|
|
|
SimplifyEnvelope,
|
2014-03-13 11:27:16 +01:00
|
|
|
};
|
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
protected:
|
|
|
|
|
2017-05-14 09:48:41 +02:00
|
|
|
|
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
static float calculateLengthSquared2D( double x1, double y1, double x2, double y2 );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the squared 2D-distance of the vector defined by the two points specified
|
|
|
|
%End
|
2016-01-04 22:51:18 +11:00
|
|
|
|
2016-03-23 09:28:20 +01:00
|
|
|
static bool equalSnapToGrid( double x1, double y1, double x2, double y2, double gridOriginX, double gridOriginY, float gridInverseSizeXY );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Returns whether the points belong to the same grid
|
|
|
|
%End
|
2016-03-23 09:28:20 +01:00
|
|
|
|
2014-03-13 11:27:16 +01:00
|
|
|
public:
|
|
|
|
int simplifyFlags() const;
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Gets the simplification hints of the vector layer managed
|
|
|
|
%End
|
2014-03-13 11:27:16 +01:00
|
|
|
void setSimplifyFlags( int simplifyFlags );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the simplification hints of the vector layer managed
|
|
|
|
%End
|
2014-03-13 11:27:16 +01:00
|
|
|
|
2016-03-23 09:28:20 +01:00
|
|
|
SimplifyAlgorithm simplifyAlgorithm() const;
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Gets the local simplification algorithm of the vector layer managed
|
|
|
|
%End
|
2016-03-23 09:28:20 +01:00
|
|
|
void setSimplifyAlgorithm( SimplifyAlgorithm simplifyAlgorithm );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the local simplification algorithm of the vector layer managed
|
|
|
|
%End
|
2016-03-23 09:28:20 +01:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsGeometry simplify( const QgsGeometry &geometry ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Returns a simplified version the specified geometry
|
|
|
|
%End
|
2016-09-01 08:04:39 +10:00
|
|
|
|
2016-08-21 18:21:01 +02:00
|
|
|
void setTolerance( double value );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the tolerance of the vector layer managed
|
|
|
|
%End
|
2016-03-23 09:08:24 +01:00
|
|
|
|
2014-03-13 11:27:16 +01:00
|
|
|
public:
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
static bool isGeneralizableByMapBoundingBox( const QgsRectangle &envelope, double map2pixelTol );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context
|
|
|
|
%End
|
|
|
|
|
|
|
|
bool isGeneralizableByMapBoundingBox( const QgsRectangle &envelope ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context
|
|
|
|
%End
|
2014-03-13 11:27:16 +01:00
|
|
|
};
|
2017-05-14 09:48:41 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsmaptopixelgeometrysimplifier.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|