mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
173 lines
5.0 KiB
Plaintext
173 lines
5.0 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgstracer.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsTracer : QObject
|
|
{
|
|
%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
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgstracer.h"
|
|
%End
|
|
public:
|
|
|
|
QgsTracer();
|
|
%Docstring
|
|
Constructor for QgsTracer.
|
|
%End
|
|
~QgsTracer();
|
|
|
|
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
|
|
|
|
QgsCoordinateReferenceSystem destinationCrs() const;
|
|
%Docstring
|
|
Get CRS used for tracing
|
|
:rtype: QgsCoordinateReferenceSystem
|
|
%End
|
|
void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
|
|
%Docstring
|
|
Set CRS used for tracing
|
|
%End
|
|
|
|
QgsRectangle extent() const;
|
|
%Docstring
|
|
Get extent to which graph's features will be limited (empty extent means no limit)
|
|
:rtype: QgsRectangle
|
|
%End
|
|
void setExtent( const QgsRectangle &extent );
|
|
%Docstring
|
|
Set extent to which graph's features will be limited (empty extent means no limit)
|
|
%End
|
|
|
|
double offset() const;
|
|
%Docstring
|
|
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
|
|
|
|
void setOffset( double offset );
|
|
%Docstring
|
|
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
|
|
Get extra parameters for offset curve algorithm (used when offset is non-zero)
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
void setOffsetParameters( int quadSegments, int joinStyle, double miterLimit );
|
|
%Docstring
|
|
Set extra parameters for offset curve algorithm (used when offset is non-zero)
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
int maxFeatureCount() const;
|
|
%Docstring
|
|
Get maximum possible number of features in graph. If the number is exceeded, graph is not created.
|
|
:rtype: int
|
|
%End
|
|
void setMaxFeatureCount( int count );
|
|
%Docstring
|
|
Get 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 findShortestPath()
|
|
if necessary.
|
|
:rtype: bool
|
|
%End
|
|
|
|
bool isInitialized() const;
|
|
%Docstring
|
|
Whether the internal data structures have been initialized
|
|
:rtype: bool
|
|
%End
|
|
|
|
bool hasTopologyProblem() const;
|
|
%Docstring
|
|
Whether there was an error during graph creation due to noding exception,
|
|
indicating some input data topology problems
|
|
.. versionadded:: 2.16
|
|
:rtype: bool
|
|
%End
|
|
|
|
enum PathError
|
|
{
|
|
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 null
|
|
:return: array of points - trace of linestrings of other features (empty array one error)
|
|
:rtype: list of QgsPointXY
|
|
%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)
|
|
:rtype: bool
|
|
%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.pl again *
|
|
************************************************************************/
|