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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
/**
*
* This file is part of Tulip (http://tulip.labri.fr)
*
* Authors: David Auber and the Tulip development Team
* from LaBRI, University of Bordeaux
*
* Tulip is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* Tulip is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
*/
#include "PathFinderConfigurationWidget.h"
#include "ui_PathFinderConfiguration.h"
using namespace tlp;
using namespace std;
PathFinderConfigurationWidget::PathFinderConfigurationWidget(QWidget *parent)
: QWidget(parent), _ui(new Ui::PathFinderConfigurationData) {
_ui->setupUi(this);
connect(_ui->weightCombo, SIGNAL(activated(const QString &)), this,
SIGNAL(setWeightMetric(const QString &)));
connect(_ui->edgeOrientationCombo, SIGNAL(activated(const QString &)), this,
SIGNAL(setEdgeOrientation(const QString &)));
connect(_ui->pathsTypeCombo, SIGNAL(activated(const QString &)), this,
SIGNAL(setPathsType(const QString &)));
connect(_ui->toleranceCheck, SIGNAL(clicked(bool)), this, SIGNAL(activateTolerance(bool)));
connect(_ui->toleranceSpin, SIGNAL(valueChanged(int)), this, SIGNAL(setTolerance(int)));
}
PathFinderConfigurationWidget::~PathFinderConfigurationWidget() {
delete _ui;
}
void PathFinderConfigurationWidget::addweightComboItem(const QString &s) {
_ui->weightCombo->addItem(s);
}
void PathFinderConfigurationWidget::addedgeOrientationComboItem(const QString &s) {
_ui->edgeOrientationCombo->addItem(s);
}
void PathFinderConfigurationWidget::addpathsTypeComboItem(const QString &s) {
_ui->pathsTypeCombo->addItem(s);
}
void PathFinderConfigurationWidget::setCurrentweightComboIndex(const int i) {
_ui->weightCombo->setCurrentIndex(i);
}
int PathFinderConfigurationWidget::weightComboFindText(const QString &text) const {
return _ui->weightCombo->findText(text);
}
void PathFinderConfigurationWidget::setCurrentedgeOrientationComboIndex(const int i) {
_ui->edgeOrientationCombo->setCurrentIndex(i);
}
int PathFinderConfigurationWidget::edgeOrientationComboFindText(const QString &text) const {
return _ui->edgeOrientationCombo->findText(text);
}
void PathFinderConfigurationWidget::toleranceChecked(const bool checked) {
_ui->toleranceCheck->setChecked(checked);
}
void PathFinderConfigurationWidget::setToleranceSpinValue(const int val) {
_ui->toleranceSpin->setValue(val);
}
void PathFinderConfigurationWidget::highlightersLabelDisabled(const bool disable) {
_ui->highlightersLabel->setDisabled(disable);
}
void PathFinderConfigurationWidget::addbottomWidget(QWidget *w) {
_ui->bottomArea->addWidget(w, 0, Qt::AlignLeft);
}
void PathFinderConfigurationWidget::toleranceDisabled(const bool disabled) {
_ui->toleranceCheck->setDisabled(disabled);
_ui->toleranceSpin->setDisabled(disabled);
_ui->toleranceLabel->setDisabled(disabled);
_ui->tolerancePercentLabel->setDisabled(disabled);
}
|