16 #ifndef QGSGCPTRANSFORMER_H
17 #define QGSGCPTRANSFORMER_H
21 #include "qgis_analysis.h"
49 InvalidTransform = 65535
84 virtual
int minimumGcpCount() const = 0;
98 bool transform(
double &x
SIP_INOUT,
double &y
SIP_INOUT,
bool inverseTransform = false ) const;
158 bool getOriginScale(
QgsPointXY &origin,
double &scaleX,
double &scaleY )
const;
161 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
162 int minimumGcpCount()
const override;
163 GDALTransformerFunc GDALTransformer()
const override;
164 void *GDALTransformerArgs()
const override;
168 struct LinearParameters
173 bool invertYAxis =
false;
176 static int linearTransform(
void *pTransformerArg,
int bDstToSrc,
int nPointCount,
177 double *x,
double *y,
double *z,
int *panSuccess );
197 bool getOriginScaleRotation(
QgsPointXY &origin,
double &scale,
double &rotation )
const;
200 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
201 int minimumGcpCount()
const override;
202 GDALTransformerFunc GDALTransformer()
const override;
203 void *GDALTransformerArgs()
const override;
208 struct HelmertParameters
213 bool invertYAxis =
false;
215 HelmertParameters mHelmertParameters;
217 static int helmertTransform(
void *pTransformerArg,
int bDstToSrc,
int nPointCount,
218 double *x,
double *y,
double *z,
int *panSuccess );
237 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
238 int minimumGcpCount()
const override;
239 GDALTransformerFunc GDALTransformer()
const override;
240 void *GDALTransformerArgs()
const override;
244 void destroyGdalArgs();
246 QVector<QgsPointXY> mSourceCoords;
247 QVector<QgsPointXY> mDestCoordinates;
248 bool mInvertYAxis =
false;
250 const int mPolynomialOrder;
251 const bool mIsTPSTransform;
253 void *mGDALTransformerArgs =
nullptr;
274 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
275 int minimumGcpCount()
const override;
276 GDALTransformerFunc GDALTransformer()
const override;
277 void *GDALTransformerArgs()
const override;
281 struct ProjectiveParameters
288 static int projectiveTransform(
void *pTransformerArg,
int bDstToSrc,
int nPointCount,
289 double *x,
double *y,
double *z,
int *panSuccess );
Custom exception class which is raised when an operation is not supported.
A class to represent a 2D point.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)