QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgscoordinateoperationwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscoordinateoperationwidget.h
3 ------------------------------
4 begin : December 2019
5 copyright : (C) 2019 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 QGSCOORDINATEOPERATIONWIDGET_H
19#define QGSCOORDINATEOPERATIONWIDGET_H
20
21#include "ui_qgscoordinateoperationwidgetbase.h"
23#include "qgis_gui.h"
24
33class GUI_EXPORT QgsCoordinateOperationWidget : public QWidget, private Ui::QgsCoordinateOperationWidgetBase
34{
35 Q_OBJECT
36 public:
39 {
41 int sourceTransformId = -1;
42
44 int destinationTransformId = -1;
45
47 QString proj;
48
50 bool isAvailable = true;
51
53 bool allowFallback = true;
54 };
55
59 QgsCoordinateOperationWidget( QWidget *parent = nullptr );
60
62
69 QgsCoordinateReferenceSystem sourceCrs() const { return mSourceCrs; }
70
77 QgsCoordinateReferenceSystem destinationCrs() const { return mDestinationCrs; }
78
85 void setSourceCrs( const QgsCoordinateReferenceSystem &crs );
86
93 void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
94
99 void setMapCanvas( QgsMapCanvas *canvas );
100
104 void setShowMakeDefault( bool show );
105
109 bool makeDefaultSelected() const;
110
114 bool hasSelection() const;
115
119 QList<QgsCoordinateOperationWidget::OperationDetails> availableOperations() const;
120
124 QgsCoordinateOperationWidget::OperationDetails defaultOperation() const;
125
130 QgsCoordinateOperationWidget::OperationDetails selectedOperation() const;
131
136 void setSelectedOperation( const QgsCoordinateOperationWidget::OperationDetails &operation );
137
144 void setSelectedOperationUsingContext( const QgsCoordinateTransformContext &context );
145
151 void setShowFallbackOption( bool visible );
152
153 signals:
154
159
164
165 private slots:
166
167 void tableCurrentItemChanged( QTableWidgetItem *, QTableWidgetItem * );
168
169 void showSupersededToggled( bool toggled );
170
171 void installGrid();
172
173 private:
174 enum Roles
175 {
176 TransformIdRole = Qt::UserRole + 1,
177 ProjRole,
178 AvailableRole,
179 BoundsRole,
180 MissingGridsRole,
181 MissingGridPackageNamesRole,
182 MissingGridUrlsRole
183 };
184
185 bool gridShiftTransformation( const QString &itemText ) const;
187 bool testGridShiftFileAvailability( QTableWidgetItem *item ) const;
188 void loadAvailableOperations();
189
193 QString formatScope( const QString &scope );
194
195 QList<QgsDatumTransform::TransformDetails> mDatumTransforms;
196
198 QgsCoordinateReferenceSystem mDestinationCrs;
199 OperationDetails mPreviousOp;
200 int mBlockSignals = 0;
201};
202
203#endif // QGSCOORDINATEOPERATIONWIDGET_H
A widget for selecting the coordinate operation to use when transforming between a source and destina...
QgsCoordinateReferenceSystem sourceCrs() const
Returns the source CRS for the operations shown in the widget.
void operationChanged()
Emitted when the operation selected in the dialog is changed.
void operationDoubleClicked()
Emitted when an operation is double-clicked in the widget.
QgsCoordinateReferenceSystem destinationCrs() const
Returns the destination CRS for the operations shown in the widget.
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Map canvas is a class for displaying all GIS data types on a canvas.
const QgsCoordinateReferenceSystem & crs
QString proj
Proj coordinate operation description, for Proj >= 6.0 builds only.