Vespucci  1.0.0
vcadialog.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright (C) 2014-2016 Wright State University - All Rights Reserved
3  Daniel P. Foose - Maintainer/Lead Developer
4 
5  This file is part of Vespucci.
6 
7  Vespucci is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Vespucci is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Vespucci. If not, see <http://www.gnu.org/licenses/>.
19 *******************************************************************************/
20 #include "GUI/Analysis/vcadialog.h"
21 #include "ui_vcadialog.h"
23 
30 VCADialog::VCADialog(QWidget *parent, QSharedPointer<VespucciWorkspace> ws, QSharedPointer<AbstractDataAnalyzer> analyzer) :
31  QDialog(parent),
32  ui(new Ui::VCADialog),
33  workspace_(ws),
34  analyzer_(analyzer)
35 {
36  ui->setupUi(this);
37 }
38 
40 {
41  delete ui;
42 }
43 
47 void VCADialog::on_buttonBox_accepted()
48 {
49  int endmembers;
50  QString name = ui->nameLineEdit->text();
51  if (name.isEmpty()) name = "VCA";
52  endmembers = ui->endmembersSpinBox->value();
53 
54  if (!analyzer_.isNull()){
55  try{
56  analyzer_->VertexComponents(name, endmembers);
57  }catch(std::exception e){
58  workspace_->main_window()->DisplayExceptionWarning(e);
59  }
60  }
61 
62  close();
63  analyzer_.clear();
64 }
65 
69 void VCADialog::on_buttonBox_rejected()
70 {
71  close();
72  analyzer_.clear();
73 }
VCADialog(QWidget *parent, QSharedPointer< VespucciWorkspace > ws, QSharedPointer< AbstractDataAnalyzer > analyzer)
VCADialog::VCADialog.
Definition: vcadialog.cpp:30
Definition: ahcadialog.h:26
The VCADialog class A dialog that allows the user to perform vertex components analysis.
Definition: vcadialog.h:32