| 1 |
//########################################################################## |
| 2 |
//# # |
| 3 |
//# CLOUDCOMPARE PLUGIN: qCork # |
| 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: Daniel Girardeau-Montaut # |
| 15 |
//# # |
| 16 |
//########################################################################## |
| 17 |
|
| 18 |
#include "ccCorkDlg.h" |
| 19 |
|
| 20 |
ccCorkDlg::ccCorkDlg(QWidget* parent) |
| 21 |
: QDialog(parent, Qt::Tool) |
| 22 |
, Ui::CorkDialog() |
| 23 |
, m_selectedOperation(UNION) |
| 24 |
, m_isSwapped(false) |
| 25 |
{ |
| 26 |
setupUi(this); |
| 27 |
|
| 28 |
connect(unionPushButton, SIGNAL(clicked()), this, SLOT(unionSelected())); |
| 29 |
connect(interPushButton, SIGNAL(clicked()), this, SLOT(intersectSelected())); |
| 30 |
connect(diffPushButton, SIGNAL(clicked()), this, SLOT(diffSelected())); |
| 31 |
connect(symDiffPushButton, SIGNAL(clicked()), this, SLOT(symDiffSelected())); |
| 32 |
connect(swapToolButton, SIGNAL(clicked()), this, SLOT(swap())); |
| 33 |
} |
| 34 |
|
| 35 |
void ccCorkDlg::setNames(QString A, QString B) |
| 36 |
{ |
| 37 |
meshALineEdit->setText(A); |
| 38 |
meshBLineEdit->setText(B); |
| 39 |
} |
| 40 |
|
| 41 |
void ccCorkDlg::unionSelected() |
| 42 |
{ |
| 43 |
m_selectedOperation = UNION; |
| 44 |
accept(); |
| 45 |
} |
| 46 |
|
| 47 |
void ccCorkDlg::intersectSelected() |
| 48 |
{ |
| 49 |
m_selectedOperation = INTERSECT; |
| 50 |
accept(); |
| 51 |
} |
| 52 |
|
| 53 |
void ccCorkDlg::diffSelected() |
| 54 |
{ |
| 55 |
m_selectedOperation = DIFF; |
| 56 |
accept(); |
| 57 |
} |
| 58 |
|
| 59 |
void ccCorkDlg::symDiffSelected() |
| 60 |
{ |
| 61 |
m_selectedOperation = SYM_DIFF; |
| 62 |
accept(); |
| 63 |
} |
| 64 |
|
| 65 |
void ccCorkDlg::swap() |
| 66 |
{ |
| 67 |
m_isSwapped = !m_isSwapped; |
| 68 |
|
| 69 |
QString A = meshALineEdit->text(); |
| 70 |
QString B = meshBLineEdit->text(); |
| 71 |
setNames(B,A); |
| 72 |
} |