-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgscustomprojectiondialog.h
76 lines (60 loc) · 2.96 KB
/
qgscustomprojectiondialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/***************************************************************************
qgscustomprojectiondialog.h
-------------------
begin : 2005
copyright : (C) 2005 by Tim Sutton
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSCUSTOMCRSDIALOG_H
#define QGSCUSTOMCRSDIALOG_H
#include "ui_qgscustomprojectiondialogbase.h"
#include "qgshelp.h"
#include "qgscoordinatereferencesystem.h"
#include "qgis_app.h"
class QDir;
/**
The custom projection widget is used to define the projection family, ellipsoid and paremters needed by proj4 to assemble a customised projection definition. The resulting projection will be store in an sqlite backend.
@author Tim Sutton
*/
class APP_EXPORT QgsCustomProjectionDialog : public QDialog, private Ui::QgsCustomProjectionDialogBase
{
Q_OBJECT
public:
QgsCustomProjectionDialog( QWidget *parent = nullptr, Qt::WindowFlags fl = 0 );
~QgsCustomProjectionDialog();
public slots:
void on_pbnCalculate_clicked();
void on_pbnAdd_clicked();
void on_pbnRemove_clicked();
void on_pbnCopyCRS_clicked();
void on_leNameList_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *prev );
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_projections/working_with_projections.html#custom-coordinate-reference-system" ) ); }
void on_buttonBox_accepted();
private:
//helper functions
void populateList();
QString quotedValue( QString value );
bool deleteCrs( const QString &id );
bool saveCrs( QgsCoordinateReferenceSystem myParameters, const QString &myName, QString myId, bool newEntry );
void insertProjection( const QString &myProjectionAcronym );
//These two QMap store the values as they are on the database when loading
QMap <QString, QString> existingCRSparameters;
QMap <QString, QString> existingCRSnames;
//These three list store the value updated with the current modifications
QStringList customCRSnames;
QStringList customCRSids;
QStringList customCRSparameters;
//vector saving the CRS to be deleted
QStringList deletedCRSs;
//Columns in the tree widget
enum Columns { QgisCrsNameColumn, QgisCrsIdColumn, QgisCrsParametersColumn };
};
#endif