Debian Codegraph @

plugins/core/Standard/qSRA/src/profileImportDlg.cpp

raw
1 //##########################################################################
2 //# #
3 //# CLOUDCOMPARE PLUGIN: qSRA #
4 //# #
5 //# This program is free software; you can redistribute it and/or modify #
6 //# it under the terms of the GNU General Public License as published by #
7 //# the Free Software Foundation; version 2 or later of the License. #
8 //# #
9 //# This program is distributed in the hope that it will be useful, #
10 //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
11 //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12 //# GNU General Public License for more details. #
13 //# #
14 //# COPYRIGHT: EDF #
15 //# #
16 //##########################################################################
17
18 #include "profileImportDlg.h"
19
20 //Qt
21 #include <QFileDialog>
22
23 //System
24 #include <assert.h>
25
26 ProfileImportDlg::ProfileImportDlg(QWidget* parent)
27 : QDialog(parent, Qt::Tool)
28 , Ui::ProfileImportDlg()
29 {
30 setupUi(this);
31
32 connect(browseToolButton, &QAbstractButton::clicked, this, &ProfileImportDlg::browseFile);
33 }
34
35 int ProfileImportDlg::getAxisDimension() const
36 {
37 return axisDimComboBox->currentIndex();
38 }
39
40 void ProfileImportDlg::browseFile()
41 {
42 QString filter("2D profile (*.txt)");
43
44 //open file loading dialog
45 QString filename = QFileDialog::getOpenFileName(nullptr,"Select profile file",getFilename(),filter
46 #if defined( Q_OS_WIN ) && defined( _DEBUG )
47 ,0,QFileDialog::DontUseNativeDialog
48 #endif
49
50 );
51
52 if (filename.isEmpty())
53 return;
54
55 setDefaultFilename(filename);
56 }
57
58 void ProfileImportDlg::setDefaultFilename(QString filename)
59 {
60 inputFileLineEdit->setText(filename);
61 }
62
63 QString ProfileImportDlg::getFilename() const
64 {
65 return inputFileLineEdit->text();
66 }
67
68 bool ProfileImportDlg::absoluteHeightValues() const
69 {
70 return absoluteHeightValuesCheckBox->isChecked();
71 }