QGIS/python/core/qgstracer.sip

173 lines
5.0 KiB
Plaintext
Raw Normal View History

2017-05-22 09:01:45 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgstracer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2016-01-11 20:57:28 +01:00
class QgsTracer : QObject
{
2017-05-22 09:01:45 +02:00
%Docstring
Utility class that construct a planar graph from the input vector
layers and provides shortest path search for tracing of existing
features.
.. versionadded:: 2.14
2016-01-11 20:57:28 +01:00
%End
2017-05-22 09:01:45 +02:00
%TypeHeaderCode
#include "qgstracer.h"
%End
2016-01-11 20:57:28 +01:00
public:
2016-01-11 20:57:28 +01:00
QgsTracer();
%Docstring
Constructor for QgsTracer.
%End
2016-01-11 20:57:28 +01:00
~QgsTracer();
2017-05-22 09:01:45 +02:00
QList<QgsVectorLayer *> layers() const;
%Docstring
Get layers used for tracing
:rtype: list of QgsVectorLayer
%End
void setLayers( const QList<QgsVectorLayer *> &layers );
%Docstring
Set layers used for tracing
%End
2016-01-11 20:57:28 +01:00
QgsCoordinateReferenceSystem destinationCrs() const;
2017-05-22 09:01:45 +02:00
%Docstring
Get CRS used for tracing
:rtype: QgsCoordinateReferenceSystem
%End
void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
2017-05-22 09:01:45 +02:00
%Docstring
Set CRS used for tracing
%End
2016-01-11 20:57:28 +01:00
QgsRectangle extent() const;
2017-05-22 09:01:45 +02:00
%Docstring
Get extent to which graph's features will be limited (empty extent means no limit)
:rtype: QgsRectangle
%End
void setExtent( const QgsRectangle &extent );
2017-05-22 09:01:45 +02:00
%Docstring
Set extent to which graph's features will be limited (empty extent means no limit)
%End
double offset() const;
%Docstring
2017-10-10 12:22:17 +02:00
Get offset in map units that should be applied to the traced paths returned from findShortestPath().
Positive offset for right side, negative offset for left side.
.. versionadded:: 3.0
:rtype: float
%End
2017-10-10 12:22:17 +02:00
void setOffset( double offset );
%Docstring
2017-10-10 12:22:17 +02:00
Set offset in map units that should be applied to the traced paths returned from findShortestPath().
Positive offset for right side, negative offset for left side.
.. versionadded:: 3.0
%End
void offsetParameters( int &quadSegments /Out/, int &joinStyle /Out/, double &miterLimit /Out/ );
%Docstring
2017-10-10 12:22:17 +02:00
Get extra parameters for offset curve algorithm (used when offset is non-zero)
.. versionadded:: 3.0
%End
2017-10-10 12:22:17 +02:00
void setOffsetParameters( int quadSegments, int joinStyle, double miterLimit );
%Docstring
2017-10-10 12:22:17 +02:00
Set extra parameters for offset curve algorithm (used when offset is non-zero)
.. versionadded:: 3.0
2017-05-22 09:01:45 +02:00
%End
2016-01-11 20:57:28 +01:00
int maxFeatureCount() const;
2017-05-22 09:01:45 +02:00
%Docstring
Get maximum possible number of features in graph. If the number is exceeded, graph is not created.
:rtype: int
%End
2016-01-11 20:57:28 +01:00
void setMaxFeatureCount( int count );
2017-05-22 09:01:45 +02:00
%Docstring
Get maximum possible number of features in graph. If the number is exceeded, graph is not created.
%End
2016-01-11 20:57:28 +01:00
bool init();
2017-05-22 09:01:45 +02:00
%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 findShortestPath()
if necessary.
2017-05-22 09:01:45 +02:00
:rtype: bool
%End
2016-01-11 20:57:28 +01:00
bool isInitialized() const;
2017-05-22 09:01:45 +02:00
%Docstring
Whether the internal data structures have been initialized
:rtype: bool
%End
2016-01-11 20:57:28 +01:00
bool hasTopologyProblem() const;
2017-05-22 09:01:45 +02:00
%Docstring
Whether there was an error during graph creation due to noding exception,
indicating some input data topology problems
2017-05-22 09:01:45 +02:00
.. versionadded:: 2.16
:rtype: bool
%End
2016-01-11 20:57:28 +01:00
enum PathError
{
2017-05-22 09:01:45 +02:00
ErrNone,
ErrTooManyFeatures,
ErrPoint1,
ErrPoint2,
ErrNoPath,
2016-01-11 20:57:28 +01:00
};
QVector<QgsPointXY> findShortestPath( const QgsPointXY &p1, const QgsPointXY &p2, PathError *error /Out/ = 0 );
2017-05-22 09:01:45 +02:00
%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 null
:return: array of points - trace of linestrings of other features (empty array one error)
:rtype: list of QgsPointXY
2017-05-22 09:01:45 +02:00
%End
2016-01-11 20:57:28 +01:00
bool isPointSnapped( const QgsPointXY &pt );
2017-05-22 09:01:45 +02:00
%Docstring
Find out whether the point is snapped to a vertex or edge (i.e. it can be used for tracing start/stop)
:rtype: bool
%End
2016-01-11 20:57:28 +01:00
protected:
2016-01-11 20:57:28 +01:00
virtual void configure();
2017-05-22 09:01:45 +02:00
%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.
2017-05-22 09:01:45 +02:00
%End
2016-01-11 20:57:28 +01:00
protected slots:
void invalidateGraph();
2017-05-22 09:01:45 +02:00
%Docstring
Destroy the existing graph structure if any (de-initialize)
%End
2016-01-11 20:57:28 +01:00
};
2017-05-22 09:01:45 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgstracer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/