QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsdatumtransformdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdatumtransformdialog.h
3 -------------------------
4 begin : November 2013
5 copyright : (C) 2013 by Marco Hugentobler
6 email : marco.hugentobler at sourcepole dot ch
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 QGSDATUMTRANSFORMDIALOG_H
19#define QGSDATUMTRANSFORMDIALOG_H
20
21#include "ui_qgsdatumtransformdialogbase.h"
24#include "qgsguiutils.h"
25#include "qgis_gui.h"
26
27#define SIP_NO_FILE
28
34class GUI_EXPORT QgsDatumTransformDialog : public QDialog, private Ui::QgsDatumTransformDialogBase
35{
36 Q_OBJECT
37 public:
40 {
43
45 int sourceTransformId = -1;
46
49
51 int destinationTransformId = -1;
52
54 QString proj;
55
57 bool allowFallback = true;
58 };
59
74 static bool run( const QgsCoordinateReferenceSystem &sourceCrs = QgsCoordinateReferenceSystem(), const QgsCoordinateReferenceSystem &destinationCrs = QgsCoordinateReferenceSystem(), QWidget *parent = nullptr, QgsMapCanvas *mapCanvas = nullptr, const QString &windowTitle = QString() );
75
76 // TODO QGIS 4.0 - remove selectedDatumTransform, forceChoice
77
81 QgsDatumTransformDialog( const QgsCoordinateReferenceSystem &sourceCrs = QgsCoordinateReferenceSystem(), const QgsCoordinateReferenceSystem &destinationCrs = QgsCoordinateReferenceSystem(), bool allowCrsChanges = false, bool showMakeDefault = true, bool forceChoice = true, QPair<int, int> selectedDatumTransforms = qMakePair( -1, -1 ), QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags(), const QString &selectedProj = QString(), QgsMapCanvas *mapCanvas = nullptr, bool allowFallback = true );
82
83 void accept() override;
84 void reject() override;
85
89 TransformInfo selectedDatumTransform();
90
91 private slots:
92
93 void operationChanged();
94 void setSourceCrs( const QgsCoordinateReferenceSystem &sourceCrs );
95 void setDestinationCrs( const QgsCoordinateReferenceSystem &destinationCrs );
96
97 private:
98 enum Roles
99 {
100 TransformIdRole = Qt::UserRole + 1,
101 ProjRole,
102 AvailableRole,
103 BoundsRole
104 };
105
106 bool gridShiftTransformation( const QString &itemText ) const;
107
108 void setOKButtonEnabled();
109
115 bool shouldAskUserForSelection() const;
116
124 TransformInfo defaultDatumTransform() const;
125
129 void applyDefaultTransform();
130
131 std::unique_ptr<QgsTemporaryCursorRestoreOverride> mPreviousCursorOverride;
132
133 friend class TestQgsDatumTransformDialog;
134};
135
136#endif // QGSDATUMTRANSFORMDIALOG_H
This class represents a coordinate reference system (CRS).
Map canvas is a class for displaying all GIS data types on a canvas.
Dialog transformation entry info.
QString proj
Proj coordinate operation description, for Proj >= 6.0 builds only.
QgsCoordinateReferenceSystem sourceCrs
Source coordinate reference system.
QgsCoordinateReferenceSystem destinationCrs
Destination coordinate reference system.