QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgscoordinatetransformcontext_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscoordinatetransformcontext_p.h
3  -------------------------------
4  begin : November 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSCOORDINATETRANSFORMCONTEXT_PRIVATE_H
19 #define QGSCOORDINATETRANSFORMCONTEXT_PRIVATE_H
20 
22 
23 //
24 // W A R N I N G
25 // -------------
26 //
27 // This file is not part of the QGIS API. It exists purely as an
28 // implementation detail. This header file may change from version to
29 // version without notice, or even be removed.
30 //
31 
32 /***************************************************************************
33  * This class is considered CRITICAL and any change MUST be accompanied with
34  * full unit tests in testqgsfeature.cpp.
35  * See details in QEP #17
36  ****************************************************************************/
37 
38 #define SIP_NO_FILE
39 
41 #include "qgsdatumtransform.h"
42 
43 class QgsCoordinateTransformContextPrivate : public QSharedData
44 {
45 
46  public:
47 
48  QgsCoordinateTransformContextPrivate() = default;
49 
50  QgsCoordinateTransformContextPrivate( const QgsCoordinateTransformContextPrivate &other )
51  : QSharedData( other )
52  {
53  other.mLock.lockForRead();
54  mSourceDestDatumTransforms = other.mSourceDestDatumTransforms;
55  other.mLock.unlock();
56  }
57 
61 #if PROJ_VERSION_MAJOR>=6
62  class OperationDetails
63  {
64  public:
65  QString operation;
66  bool allowFallback = true;
67 
68  bool operator==( const OperationDetails &other ) const
69  {
70  return operation == other.operation && allowFallback == other.allowFallback;
71  }
72  };
73  QMap< QPair< QgsCoordinateReferenceSystem, QgsCoordinateReferenceSystem >, OperationDetails > mSourceDestDatumTransforms;
74 #else
75  QMap< QPair< QString, QString >, QgsDatumTransform::TransformPair > mSourceDestDatumTransforms;
76 #endif
77 
79  mutable QReadWriteLock mLock{};
80 
81  private:
82  QgsCoordinateTransformContextPrivate &operator= ( const QgsCoordinateTransformContextPrivate & ) = delete;
83 };
84 
85 
87 
88 
89 #endif // QGSCOORDINATETRANSFORMCONTEXT_PRIVATE_H
90 
91 
92 
93 
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:400
QgsDatumTransform::TransformPair
Contains datum transform information.
Definition: qgsdatumtransform.h:55
qgsdatumtransform.h
qgscoordinatereferencesystem.h