File: qgstracer.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (197 lines) | stat: -rw-r--r-- 5,765 bytes parent folder | download | duplicates (6)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgstracer.h                                                 *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/






class QgsTracer : QObject
{
%Docstring(signature="appended")
Utility class that construct a planar graph from the input vector layers
and provides shortest path search for tracing of existing features.
%End

%TypeHeaderCode
#include "qgstracer.h"
%End
  public:

    QgsTracer();
%Docstring
Constructor for QgsTracer.
%End
    ~QgsTracer();

    QList<QgsVectorLayer *> layers() const;
%Docstring
Gets layers used for tracing
%End
    void setLayers( const QList<QgsVectorLayer *> &layers );
%Docstring
Sets layers used for tracing
%End

    QgsCoordinateReferenceSystem destinationCrs() const;
%Docstring
Returns the CRS used for tracing.

.. seealso:: :py:func:`setDestinationCrs`
%End

    void setDestinationCrs( const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context );
%Docstring
Sets the ``crs`` and transform ``context`` used for tracing.

.. seealso:: :py:func:`destinationCrs`
%End

    void setRenderContext( const QgsRenderContext *renderContext );
%Docstring
Sets the ``renderContext`` used for tracing only on visible features.

.. versionadded:: 3.4
%End

    QgsRectangle extent() const;
%Docstring
Gets extent to which graph's features will be limited (empty extent
means no limit)
%End
    void setExtent( const QgsRectangle &extent );
%Docstring
Sets extent to which graph's features will be limited (empty extent
means no limit)
%End

    double offset() const;
%Docstring
Gets offset in map units that should be applied to the traced paths
returned from :py:func:`~QgsTracer.findShortestPath`. Positive offset
for right side, negative offset for left side.
%End

    void setOffset( double offset );
%Docstring
Set offset in map units that should be applied to the traced paths
returned from :py:func:`~QgsTracer.findShortestPath`. Positive offset
for right side, negative offset for left side.
%End


    void offsetParameters( int &quadSegments /Out/, int &joinStyle /Out/, double &miterLimit /Out/ );
%Docstring
Gets extra parameters for offset curve algorithm (used when offset is
non-zero)
%End


    void setOffsetParameters( int quadSegments, int joinStyle, double miterLimit );
%Docstring
Set extra parameters for offset curve algorithm (used when offset is
non-zero)
%End

    int maxFeatureCount() const;
%Docstring
Gets maximum possible number of features in graph. If the number is
exceeded, graph is not created.
%End
    void setMaxFeatureCount( int count );
%Docstring
Gets maximum possible number of features in graph. If the number is
exceeded, graph is not created.
%End

    bool init();
%Docstring
Build the internal data structures. This may take some time depending on
how big the input layers are. It is not necessary to call this method
explicitly - it will be called by :py:func:`~QgsTracer.findShortestPath`
if necessary.
%End

    bool isInitialized() const;
%Docstring
Whether the internal data structures have been initialized
%End

    bool hasTopologyProblem() const;
%Docstring
Whether there was an error during graph creation due to noding
exception, indicating some input data topology problems
%End

    enum PathError /BaseType=IntEnum/
    {
      ErrNone,
      ErrTooManyFeatures,
      ErrPoint1,
      ErrPoint2,
      ErrNoPath,
    };

    QVector<QgsPointXY> findShortestPath( const QgsPointXY &p1, const QgsPointXY &p2, PathError *error /Out/ = 0 );
%Docstring
Given two points, find the shortest path and return points on the way.
The optional "error" argument may receive error code (PathError enum) if
it is not ``None``

:return: array of points - trace of linestrings of other features (empty
         array one error)
%End

    bool isPointSnapped( const QgsPointXY &pt );
%Docstring
Find out whether the point is snapped to a vertex or edge (i.e. it can
be used for tracing start/stop)
%End

    void setAddPointsOnIntersectionsEnabled( bool enable );
%Docstring
When ``enable`` is ``True``, the shortest path's straight segments will
include vertices where the input layers intersect, even if no such
vertex existed on the input layers

.. versionadded:: 3.40
%End

    bool addPointsOnIntersectionsEnabled() const;
%Docstring
Returns whether the shortest path's straight segments will include
vertices where the input layers intersect, even if no such vertex
existed on the input layers

.. versionadded:: 3.40
%End
  protected:

    virtual void configure();
%Docstring
Allows derived classes to setup the settings just before the tracer is
initialized. This allows the configuration to be set in a lazy way only
when it is really necessary. Default implementation does nothing.
%End

  protected slots:
    void invalidateGraph();
%Docstring
Destroy the existing graph structure if any (de-initialize)
%End

};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgstracer.h                                                 *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/