File: qgsvectorsimplifymethod.sip

package info (click to toggle)
qgis 2.18.28%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,007,948 kB
  • sloc: cpp: 671,774; python: 158,539; xml: 35,690; ansic: 8,346; sh: 1,766; perl: 1,669; sql: 999; yacc: 836; lex: 461; makefile: 292
file content (66 lines) | stat: -rw-r--r-- 3,450 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

/** This class contains information how to simplify geometries fetched from a vector layer
 * @note added in 2.2
 */
class QgsVectorSimplifyMethod
{
%TypeHeaderCode
#include "qgsvectorsimplifymethod.h"
%End

  public:
    //! construct a default object
    QgsVectorSimplifyMethod();
    //! copy constructor
    QgsVectorSimplifyMethod( const QgsVectorSimplifyMethod& rh );

    /** Simplification flags for fast rendering of features */
    enum SimplifyHint
    {
      NoSimplification,           //!< No simplification can be applied
      GeometrySimplification,     //!< The geometries can be simplified using the current map2pixel context state
      AntialiasingSimplification, //!< The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size'
      FullSimplification,         //!< All simplification hints can be applied ( Geometry + AA-disabling )
    };
    typedef QFlags<QgsVectorSimplifyMethod::SimplifyHint> SimplifyHints;

    /** Sets the simplification hints of the vector layer managed */
    void setSimplifyHints( const QFlags<QgsVectorSimplifyMethod::SimplifyHint>& simplifyHints );
    /** Gets the simplification hints of the vector layer managed */
    QFlags<QgsVectorSimplifyMethod::SimplifyHint> simplifyHints() const;

    /** Types of local simplification algorithms that can be used */
    enum SimplifyAlgorithm
    {
      Distance    = 0, //!< The simplification uses the distance between points to remove duplicate points
      SnapToGrid  = 1, //!< The simplification uses a grid (similar to ST_SnapToGrid) to remove duplicate points
      Visvalingam = 2, //!< The simplification gives each point in a line an importance weighting, so that least important points are removed first
    };

    /** Sets the local simplification algorithm of the vector layer managed */
    void setSimplifyAlgorithm( const SimplifyAlgorithm& simplifyAlgorithm );
    /** Gets the local simplification algorithm of the vector layer managed */
    SimplifyAlgorithm simplifyAlgorithm() const;

    /** Sets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal */
    void setTolerance( double tolerance );
    /** Gets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal */
    double tolerance() 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() const;

    /** Sets the maximum scale at which the layer should be simplified */
    void setMaximumScale( float maximumScale );
    /** Gets the maximum scale at which the layer should be simplified */
    float maximumScale() const;
};

QFlags<QgsVectorSimplifyMethod::SimplifyHint> operator|( QgsVectorSimplifyMethod::SimplifyHint f1, QFlags<QgsVectorSimplifyMethod::SimplifyHint> f2 );