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
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geometry/qgsgeometrytransformer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsAbstractGeometryTransformer
{
%Docstring(signature="appended")
An abstract base class for classes which transform geometries by
transforming input points to output points.
.. versionadded:: 3.18
%End
%TypeHeaderCode
#include "qgsgeometrytransformer.h"
%End
public:
virtual ~QgsAbstractGeometryTransformer();
virtual bool transformPoint( double &x /In,Out/, double &y /In,Out/, double &z /In,Out/, double &m /In,Out/ ) = 0;
%Docstring
Transforms the point defined by the coordinates (``x``, ``y``, ``z``)
and the specified ``m`` value.
:param x: point x coordinate
:param y: point y coordinate
:param z: point z coordinate, or NaN if the input point is 2D only
:param m: point m value, or NaN if not available
:return: ``True`` if point was transformed (or no transformation was
required), or ``False`` if point could not be transformed
successfully.
Example
-------------------------------------
A transformer which multiples the x coordinate by 3 and adds 10 to the y
coordinate:
.. code-block:: python
class MyTransformer(QgsAbstractGeometryTransformer):
def transformPoint(self, x, y, z, m):
# returns a tuple of True to indicate success, then the modified x/y/z/m values
return True, x*3, y+10, z, m
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geometry/qgsgeometrytransformer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|