File: qgsrasterpipe.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 (88 lines) | stat: -rw-r--r-- 2,681 bytes parent folder | download | duplicates (3)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

/** Raster pipe */

class QgsRasterPipe
{
%TypeHeaderCode
#include <qgsrasterpipe.h>
#include <qgsrasterresamplefilter.h>
#include <qgsrasterprojector.h>
%End

  public:
    // Role of known interfaces
    enum Role
    {
      UnknownRole,
      ProviderRole,
      RendererRole,
      BrightnessRole,
      ResamplerRole,
      ProjectorRole,
      NullerRole,
      HueSaturationRole,
    };

    QgsRasterPipe();
    //made private for python bindings
    //QgsRasterPipe( const QgsRasterPipe& thePipe );

    ~QgsRasterPipe();

    /** Try to insert interface at specified index and connect
     * if connection would fail, the interface is not inserted and false is returned */
    bool insert( int idx, QgsRasterInterface* theInterface /Transfer/ );
%MethodCode
      sipRes = sipCpp->insert( a0, a1 );
      if( !sipRes )
      {
	// if insertion failed transfer ownership back to python
	PyObject *o = sipGetPyObject( a1, sipType_QgsRasterInterface );
	if( o )
	  sipTransferBreak( o );
      }
%End

    /** Try to replace interface at specified index and connect
     * if connection would fail, the interface is not inserted and false is returned */
    bool replace( int idx, QgsRasterInterface* theInterface /Transfer/ );

    /** Insert a new known interface in default place or replace interface of the same
     * role if it already exists. Known interfaces are: QgsRasterDataProvider,
     * QgsRasterRenderer, QgsRasterResampleFilter, QgsRasterProjector and their
     * subclasses. For unknown interfaces it mus be explicitly specified position
     * where it should be inserted using insert() method.
     */
    bool set( QgsRasterInterface * theInterface /Transfer/ );

    /** Remove and delete interface at given index if possible */
    bool remove( int idx );

    /** Remove and delete interface from pipe if possible */
    bool remove( QgsRasterInterface * theInterface );

    int size() const;
    QgsRasterInterface * at( int idx ) const;
    QgsRasterInterface * last() const;

    /** Set interface at index on/off
     *  Returns true on success */
    bool setOn( int idx, bool on );

    /** Test if interface at index may be swithed on/off */
    bool canSetOn( int idx, bool on );

    // Getters for special types of interfaces
    QgsRasterDataProvider * provider() const;
    QgsRasterRenderer * renderer() const;
    QgsRasterResampleFilter * resampleFilter() const;
    QgsBrightnessContrastFilter * brightnessFilter() const;
    QgsHueSaturationFilter * hueSaturationFilter() const;
    QgsRasterProjector * projector() const;
    QgsRasterNuller * nuller() const;

  private:

    QgsRasterPipe( const QgsRasterPipe& thePipe );

};