QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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"
22
23#include "qgis_gui.h"
26#include "qgsguiutils.h"
27
28#define SIP_NO_FILE
29
36class GUI_EXPORT QgsDatumTransformDialog : public QDialog, private Ui::QgsDatumTransformDialogBase
37{
38 Q_OBJECT
39 public:
61
76 static bool run( const QgsCoordinateReferenceSystem &sourceCrs = QgsCoordinateReferenceSystem(), const QgsCoordinateReferenceSystem &destinationCrs = QgsCoordinateReferenceSystem(), QWidget *parent = nullptr, QgsMapCanvas *mapCanvas = nullptr, const QString &windowTitle = QString() );
77
78 // TODO QGIS 4.0 - remove selectedDatumTransform, forceChoice
79
83 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 );
84
85 void accept() override;
86 void reject() override;
87
92
93 private slots:
94
95 void operationChanged();
96 void setSourceCrs( const QgsCoordinateReferenceSystem &sourceCrs );
97 void setDestinationCrs( const QgsCoordinateReferenceSystem &destinationCrs );
98
99 private:
100 enum Roles
101 {
102 TransformIdRole = Qt::UserRole + 1,
103 ProjRole,
104 AvailableRole,
105 BoundsRole
106 };
107
108 bool gridShiftTransformation( const QString &itemText ) const;
109
110 void setOKButtonEnabled();
111
117 bool shouldAskUserForSelection() const;
118
126 TransformInfo defaultDatumTransform() const;
127
131 void applyDefaultTransform();
132
133 std::unique_ptr<QgsTemporaryCursorRestoreOverride> mPreviousCursorOverride;
134
136};
137
138#endif // QGSDATUMTRANSFORMDIALOG_H
Represents a coordinate reference system (CRS).
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)
Constructor for QgsDatumTransformDialog.
TransformInfo selectedDatumTransform()
Returns the source and destination transforms, each being a pair of QgsCoordinateReferenceSystems and...
static bool run(const QgsCoordinateReferenceSystem &sourceCrs=QgsCoordinateReferenceSystem(), const QgsCoordinateReferenceSystem &destinationCrs=QgsCoordinateReferenceSystem(), QWidget *parent=nullptr, QgsMapCanvas *mapCanvas=nullptr, const QString &windowTitle=QString())
Runs the dialog (if required) prompting for the desired transform to use from sourceCrs to destinatio...
Map canvas is a class for displaying all GIS data types on a canvas.
Dialog transformation entry info.
int destinationTransformId
Destination transform ID.
QString proj
Proj coordinate operation description, for Proj >= 6.0 builds only.
QgsCoordinateReferenceSystem sourceCrs
Source coordinate reference system.
QgsCoordinateReferenceSystem destinationCrs
Destination coordinate reference system.
bool allowFallback
true if fallback transforms can be used