This is an automated email from the git hooks/post-receive script. sebastic-guest pushed a commit to branch upstream-master in repository pktools.
commit c1e05a3f8cf807e66ef3158b18931fba9f676bfb Author: Pieter Kempeneers <kempe...@gmail.com> Date: Wed Apr 2 16:10:08 2014 +0200 added pkcomposite_gui --- qt/pkcomposite_gui/main.cc | 31 ++ qt/pkcomposite_gui/mainwindow.cc | 124 ++++++ qt/pkcomposite_gui/mainwindow.h | 56 +++ qt/{pksvm_gui => pkcomposite_gui}/mainwindow.ui | 538 ++++++++++++------------ qt/pkcomposite_gui/pkcomposite_gui.pro | 20 + qt/pksvm_gui/mainwindow.ui | 2 +- src/apps/pkcomposite.cc | 20 +- 7 files changed, 519 insertions(+), 272 deletions(-) diff --git a/qt/pkcomposite_gui/main.cc b/qt/pkcomposite_gui/main.cc new file mode 100644 index 0000000..b53cf84 --- /dev/null +++ b/qt/pkcomposite_gui/main.cc @@ -0,0 +1,31 @@ +/********************************************************************** +main.cc +Copyright (C) 2008-2014 Pieter Kempeneers + +This file is part of pktools + +pktools 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 3 of the License, or +(at your option) any later version. + +pktools 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. + +You should have received a copy of the GNU General Public License +along with pktools. If not, see <http://www.gnu.org/licenses/>. +***********************************************************************/ + +#include "mainwindow.h" +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + + return a.exec(); +} diff --git a/qt/pkcomposite_gui/mainwindow.cc b/qt/pkcomposite_gui/mainwindow.cc new file mode 100644 index 0000000..6e61661 --- /dev/null +++ b/qt/pkcomposite_gui/mainwindow.cc @@ -0,0 +1,124 @@ +/********************************************************************** +mainwindow.cpp: GUI for pktools +Copyright (C) 2008-2014 Pieter Kempeneers + +This file is part of pktools + +pktools 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 3 of the License, or +(at your option) any later version. + +pktools 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. + +You should have received a copy of the GNU General Public License +along with pktools. If not, see <http://www.gnu.org/licenses/>. +***********************************************************************/ + +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include <QFileDialog> + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); + QStringList resamplelist; + resamplelist << "near" << "bilinear"; + ui->comboBox_resample->addItems(resamplelist); + QStringList crulelist; + crulelist << "overwrite" << "maxndvi" << "maxband" <<"minband" << "mean" << "mode" << "median" << "sum"; + ui->comboBox_crule->addItems(crulelist); + QStringList interleavedlist; + interleavedlist << "BAND" << "LINE" << "PIXEL" <<"BSQ"; + ui->comboBox_interleaved->addItems(interleavedlist); + QStringList compressedlist; + compressedlist << "NONE" << "LZW" << "PACKBITS" <<"DEFLATE"; + ui->comboBox_compressed->addItems(compressedlist); + QStringList otypelist; + otypelist << "Byte" << "Int16" << "UInt16" << "UInt32" << "Int32" << "Float32" << "Float64" << "CInt16" << "CInt32" << "CFloat32" << "CFloat64"; + ui->otype->addItems(otypelist); + QStringList oformatlist; + oformatlist << "GTiff" << "HFA" << "ENVI"; + ui->oformat->addItems(oformatlist); + setDefaults(); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +void MainWindow::setDefaults() +{ + //input + ui->listWidget_input->clear(); + ui->ulx->clear(); + ui->uly->clear(); + ui->lrx->clear(); + ui->lry->clear(); + //composit + ui->comboBox_resample->setCurrentIndex(0); + ui->comboBox_crule->setCurrentIndex(0); + ui->rband->setText("0"); + ui->bndnodata->setText("0"); + ui->srcnodata->setText("0"); + ui->min->clear(); + ui->max->clear(); + //output + ui->output->clear(); + ui->a_srs->clear(); + ui->otype->setCurrentIndex(0); + ui->oformat->setCurrentIndex(0); + ui->ct->clear(); + ui->description->clear(); + ui->dx->clear(); + ui->dy->clear(); + ui->comboBox_interleaved->setCurrentIndex(0); + ui->tiled->setChecked(false); + ui->comboBox_compressed->setCurrentIndex(0); + ui->dstnodata->clear(); + ui->file->clear(); +} + +void MainWindow::on_toolButton_input_clicked() +{ + on_actionInput_image_triggered(); +} + +void MainWindow::on_toolButton_output_clicked() +{ + on_actionOutput_image_triggered(); +} + +void MainWindow::on_toolButton_defaults_clicked() +{ + setDefaults(); +} + +void MainWindow::on_actionInput_image_triggered() +{ + QFileDialog dialog(this); + dialog.setDirectory(QDir::homePath()); + dialog.setFileMode(QFileDialog::ExistingFiles); + QStringList fileNames; + if (dialog.exec()) + fileNames = dialog.selectedFiles(); + ui->listWidget_input->addItems(fileNames); +} + +void MainWindow::on_actionOutput_image_triggered() +{ + QString outputfilename=QFileDialog::getOpenFileName(this,"Output image"); + ui->output->setText(outputfilename); +} + +void MainWindow::on_actionQuit_triggered() +{ + close(); +} + diff --git a/qt/pkcomposite_gui/mainwindow.h b/qt/pkcomposite_gui/mainwindow.h new file mode 100644 index 0000000..9f61cc6 --- /dev/null +++ b/qt/pkcomposite_gui/mainwindow.h @@ -0,0 +1,56 @@ +/********************************************************************** +mainwindow.h +Copyright (C) 2008-2014 Pieter Kempeneers + +This file is part of pktools + +pktools 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 3 of the License, or +(at your option) any later version. + +pktools 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. + +You should have received a copy of the GNU General Public License +along with pktools. If not, see <http://www.gnu.org/licenses/>. +***********************************************************************/ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include <QMainWindow> + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +private slots: + void on_toolButton_input_clicked(); + + void on_toolButton_defaults_clicked(); + + void on_actionInput_image_triggered(); + + void on_actionOutput_image_triggered(); + + void on_actionQuit_triggered(); + + void on_toolButton_output_clicked(); + +private: + Ui::MainWindow *ui; + void setDefaults(); +}; + +#endif // MAINWINDOW_H diff --git a/qt/pksvm_gui/mainwindow.ui b/qt/pkcomposite_gui/mainwindow.ui similarity index 55% copy from qt/pksvm_gui/mainwindow.ui copy to qt/pkcomposite_gui/mainwindow.ui index 35c1438..b680b08 100644 --- a/qt/pksvm_gui/mainwindow.ui +++ b/qt/pkcomposite_gui/mainwindow.ui @@ -6,78 +6,45 @@ <rect> <x>0</x> <y>0</y> - <width>628</width> - <height>614</height> + <width>798</width> + <height>859</height> </rect> </property> <property name="windowTitle"> - <string>pksvm_gui</string> + <string>MainWindow</string> </property> <widget class="QWidget" name="centralWidget"> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> - <number>2</number> + <number>0</number> </property> <widget class="QWidget" name="tab"> <attribute name="title"> - <string>Training</string> + <string>Input</string> </attribute> - <layout class="QVBoxLayout" name="verticalLayout_3"> + <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="2" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>attribute name for class label</string> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QToolButton" name="toolButton_training"> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="1"> + <widget class="QToolButton" name="toolButton_input"> <property name="text"> <string>...</string> </property> </widget> </item> <item row="0" column="0"> - <widget class="QLabel" name="label_4"> + <widget class="QLabel" name="label"> <property name="text"> - <string>Training vectorfile</string> + <string>Input images</string> </property> </widget> </item> - <item row="3" column="2"> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="training"/> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="nclass"/> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_20"> - <property name="text"> - <string>number of classes to prepare table</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="label"/> + <item row="0" column="2"> + <widget class="QListWidget" name="listWidget_input"/> </item> - <item row="2" column="2"> + <item row="1" column="3"> <spacer name="horizontalSpacer_3"> <property name="orientation"> <enum>Qt::Horizontal</enum> @@ -90,17 +57,17 @@ </property> </spacer> </item> + <item row="3" column="2"> + <widget class="QLineEdit" name="lry"/> + </item> <item row="1" column="0"> - <widget class="QLabel" name="label_21"> + <widget class="QLabel" name="label_2"> <property name="text"> - <string>Training layername (optional)</string> + <string>Geographical extent</string> </property> </widget> </item> <item row="1" column="1"> - <widget class="QLineEdit" name="tln"/> - </item> - <item row="1" column="2"> <spacer name="horizontalSpacer_2"> <property name="orientation"> <enum>Qt::Horizontal</enum> @@ -113,241 +80,321 @@ </property> </spacer> </item> + <item row="1" column="2"> + <widget class="QLineEdit" name="uly"/> + </item> + <item row="2" column="3"> + <widget class="QLineEdit" name="lrx"/> + </item> + <item row="2" column="1"> + <widget class="QLineEdit" name="ulx"/> + </item> </layout> </item> <item> - <widget class="QCommandLinkButton" name="commandLinkButtonPrepareTable"> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="tab_2"> + <attribute name="title"> + <string>Composit</string> + </attribute> + <layout class="QGridLayout" name="gridLayout_4"> + <item row="2" column="0"> + <spacer name="verticalSpacer_3"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="comboBox_resample"/> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_18"> <property name="text"> - <string>prepare table</string> + <string>Composit rule</string> </property> </widget> </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QLabel" name="label_17"> - <property name="text"> - <string>class name-value pairs</string> - </property> - </widget> - </item> - <item> - <widget class="QTableView" name="tableView_labels"/> - </item> - </layout> + <item row="0" column="0"> + <widget class="QLabel" name="label_17"> + <property name="text"> + <string>Resample method</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QComboBox" name="comboBox_crule"/> + </item> + <item row="1" column="3"> + <widget class="QLabel" name="label_19"> + <property name="text"> + <string>Band used for composit rule</string> + </property> + </widget> + </item> + <item row="1" column="4"> + <widget class="QLineEdit" name="rband"/> + </item> + <item row="3" column="0" colspan="4"> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>nodata values in input</string> + </property> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="1" column="0"> + <widget class="QLabel" name="label_21"> + <property name="text"> + <string>nodata value</string> + </property> + </widget> + </item> + <item row="1" column="1" colspan="2"> + <widget class="QLineEdit" name="srcnodata"/> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_23"> + <property name="text"> + <string>max value</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_22"> + <property name="text"> + <string>min value</string> + </property> + </widget> + </item> + <item row="2" column="1" colspan="2"> + <widget class="QLineEdit" name="min"/> + </item> + <item row="3" column="1"> + <widget class="QLineEdit" name="max"/> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_20"> + <property name="text"> + <string>band</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLineEdit" name="bndnodata"/> + </item> + </layout> + </widget> + </item> + <item row="1" column="5"> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="2"> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> </layout> </widget> - <widget class="QWidget" name="tab_2"> + <widget class="QWidget" name="tab_3"> <attribute name="title"> - <string>Input/Output</string> + <string>Output</string> </attribute> - <layout class="QVBoxLayout" name="verticalLayout_4"> + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="1" column="5"> - <widget class="QLineEdit" name="msknodata"/> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="input"/> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_3"> + <layout class="QGridLayout" name="gridLayout"> + <item row="4" column="0"> + <widget class="QLabel" name="label_7"> <property name="text"> - <string>Input data</string> + <string>Output image format</string> </property> </widget> </item> - <item row="0" column="2"> - <widget class="QToolButton" name="toolButton_input"> + <item row="9" column="0"> + <widget class="QLabel" name="label_14"> <property name="text"> - <string>...</string> + <string>Output nodata value</string> </property> </widget> </item> - <item row="2" column="4"> + <item row="10" column="1"> + <widget class="QLineEdit" name="file"/> + </item> + <item row="6" column="0"> <widget class="QLabel" name="label_16"> <property name="text"> - <string>nodata</string> + <string>Description</string> </property> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_15"> + <item row="7" column="2"> + <widget class="QLabel" name="label_10"> <property name="text"> - <string>Output data</string> + <string>dx</string> </property> </widget> </item> - <item row="1" column="2"> - <widget class="QToolButton" name="toolButton_mask"> + <item row="7" column="0"> + <widget class="QLabel" name="label_9"> <property name="text"> - <string>...</string> + <string>Output resolution</string> </property> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_13"> - <property name="text"> - <string>Mask image</string> - </property> - </widget> + <item row="8" column="1"> + <widget class="QComboBox" name="comboBox_interleaved"/> </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="mask"/> + <item row="4" column="1"> + <widget class="QComboBox" name="oformat"/> </item> - <item row="2" column="5"> - <widget class="QLineEdit" name="nodata"/> + <item row="7" column="1"> + <widget class="QLineEdit" name="dx"/> </item> - <item row="1" column="4"> - <widget class="QLabel" name="label_14"> + <item row="5" column="2"> + <widget class="QToolButton" name="toolButton_ct"> <property name="text"> - <string>msknodata</string> + <string>...</string> </property> </widget> </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="output"/> - </item> - <item row="2" column="2"> - <widget class="QToolButton" name="toolButton_output"> + <item row="5" column="0"> + <widget class="QLabel" name="label_8"> <property name="text"> - <string>...</string> + <string>Color table (ASCII)</string> </property> </widget> </item> - <item row="1" column="3"> - <spacer name="horizontalSpacer_15"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_3"> - <attribute name="title"> - <string>Classifier</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="3" column="1"> - <widget class="QLineEdit" name="cv"/> - </item> - <item row="2" column="4"> - <widget class="QLineEdit" name="ccost"/> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_5"> + <item row="8" column="4"> + <widget class="QLabel" name="label_13"> <property name="text"> - <string>n-fold cross validation</string> + <string>compressed</string> </property> </widget> </item> - <item row="2" column="3"> - <widget class="QLabel" name="label_10"> + <item row="8" column="5"> + <widget class="QComboBox" name="comboBox_compressed"/> + </item> + <item row="8" column="0"> + <widget class="QLabel" name="label_12"> <property name="text"> - <string>CCost</string> + <string>Interleaved</string> </property> </widget> </item> - <item row="0" column="3"> - <widget class="QLabel" name="label_11"> + <item row="5" column="1"> + <widget class="QLineEdit" name="ct"/> + </item> + <item row="1" column="2"> + <widget class="QToolButton" name="toolButton_output"> <property name="text"> - <string>Coef 0</string> + <string>...</string> </property> </widget> </item> - <item row="0" column="0"> + <item row="3" column="0"> <widget class="QLabel" name="label_6"> <property name="text"> - <string>SVM type</string> + <string>Output data type</string> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QComboBox" name="svmtype"/> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="gamma"/> + <item row="1" column="1"> + <widget class="QLineEdit" name="output"/> </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_7"> + <item row="10" column="0"> + <widget class="QLabel" name="label_15"> <property name="text"> - <string>Kernel type</string> + <string>Ouput info on selected pixels</string> </property> </widget> </item> - <item row="0" column="4"> - <widget class="QLineEdit" name="coef0"/> + <item row="2" column="1"> + <widget class="QLineEdit" name="a_srs"/> + </item> + <item row="6" column="1"> + <widget class="QLineEdit" name="description"/> + </item> + <item row="7" column="4"> + <widget class="QLineEdit" name="dy"/> </item> <item row="2" column="0"> - <widget class="QLabel" name="label_9"> + <widget class="QLabel" name="label_5"> <property name="text"> - <string>Gamma</string> + <string>Assign projection (EPSG code)</string> </property> </widget> </item> - <item row="0" column="7"> - <widget class="QLineEdit" name="nu"/> - </item> - <item row="1" column="4"> - <widget class="QLineEdit" name="kd"/> - </item> - <item row="0" column="6"> - <widget class="QLabel" name="label_12"> + <item row="8" column="2"> + <widget class="QCheckBox" name="tiled"> <property name="text"> - <string>nu</string> + <string>Tiled</string> </property> </widget> </item> - <item row="0" column="2"> - <spacer name="verticalSpacer_3"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> + <item row="7" column="5"> + <widget class="QLabel" name="label_11"> + <property name="text"> + <string>dy</string> </property> - </spacer> + </widget> </item> - <item row="1" column="1"> - <widget class="QComboBox" name="kerneltype"/> + <item row="3" column="1"> + <widget class="QComboBox" name="otype"/> </item> - <item row="1" column="3"> - <widget class="QLabel" name="label_8"> + <item row="10" column="2"> + <widget class="QToolButton" name="toolButton_file"> <property name="text"> - <string>Kernel degree</string> + <string>...</string> </property> </widget> </item> - <item row="0" column="5"> - <spacer name="horizontalSpacer_5"> + <item row="1" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Output image</string> + </property> + </widget> + </item> + <item row="9" column="1"> + <widget class="QLineEdit" name="dstnodata"/> + </item> + <item row="8" column="3"> + <spacer name="horizontalSpacer_6"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -361,54 +408,27 @@ </item> </layout> </item> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_4"> - <attribute name="title"> - <string>Command line</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QLabel" name="label_18"> - <property name="text"> - <string>Command line</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="commandLineEdit"/> - </item> - <item> - <widget class="QLabel" name="label_19"> - <property name="text"> - <string>Console output</string> - </property> - </widget> - </item> - <item> - <widget class="QPlainTextEdit" name="consoleEdit"/> - </item> </layout> </widget> </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QPushButton" name="pushButton_run"> + <widget class="QToolButton" name="toolButton_Run"> <property name="text"> <string>Run</string> </property> @@ -428,7 +448,7 @@ </spacer> </item> <item> - <widget class="QPushButton" name="pushButton_restore"> + <widget class="QToolButton" name="toolButton_defaults"> <property name="text"> <string>Restore defaults</string> </property> @@ -443,7 +463,7 @@ <rect> <x>0</x> <y>0</y> - <width>628</width> + <width>798</width> <height>27</height> </rect> </property> @@ -451,10 +471,9 @@ <property name="title"> <string>File</string> </property> - <addaction name="actionInput"/> - <addaction name="actionTraining"/> - <addaction name="actionMask"/> - <addaction name="actionOutput"/> + <addaction name="actionInput_image"/> + <addaction name="actionOutput_image"/> + <addaction name="actionQuit"/> </widget> <addaction name="menuFile"/> </widget> @@ -467,24 +486,19 @@ </attribute> </widget> <widget class="QStatusBar" name="statusBar"/> - <action name="actionInput"> - <property name="text"> - <string>Input</string> - </property> - </action> - <action name="actionTraining"> + <action name="actionInput_image"> <property name="text"> - <string>Training</string> + <string>Input image(s)</string> </property> </action> - <action name="actionMask"> + <action name="actionOutput_image"> <property name="text"> - <string>Mask</string> + <string>Output image</string> </property> </action> - <action name="actionOutput"> + <action name="actionQuit"> <property name="text"> - <string>Output</string> + <string>Quit</string> </property> </action> </widget> diff --git a/qt/pkcomposite_gui/pkcomposite_gui.pro b/qt/pkcomposite_gui/pkcomposite_gui.pro new file mode 100644 index 0000000..6b1ab7c --- /dev/null +++ b/qt/pkcomposite_gui/pkcomposite_gui.pro @@ -0,0 +1,20 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2014-04-02T12:11:15 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = pkcomposite_gui +TEMPLATE = app + + +SOURCES += main.cc\ + mainwindow.cc + +HEADERS += mainwindow.h + +FORMS += mainwindow.ui diff --git a/qt/pksvm_gui/mainwindow.ui b/qt/pksvm_gui/mainwindow.ui index 35c1438..9317fc3 100644 --- a/qt/pksvm_gui/mainwindow.ui +++ b/qt/pksvm_gui/mainwindow.ui @@ -18,7 +18,7 @@ <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> - <number>2</number> + <number>3</number> </property> <widget class="QWidget" name="tab"> <attribute name="title"> diff --git a/src/apps/pkcomposite.cc b/src/apps/pkcomposite.cc index a88a430..eacf35f 100644 --- a/src/apps/pkcomposite.cc +++ b/src/apps/pkcomposite.cc @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) Optionpk<string> oformat_opt("of", "oformat", "Output image format (see also gdal_translate). Empty string: inherit from input image"); Optionpk<string> colorTable_opt("ct", "ct", "color table (file with 5 columns: id R G B ALFA (0: transparent, 255: solid)"); Optionpk<string> option_opt("co", "co", "Creation option for output file. Multiple options can be specified."); - Optionpk<unsigned short> resample_opt("r", "resample", "Resampling method (0: nearest neighbour, 1: bi-linear interpolation).", 0); + Optionpk<string> resample_opt("r", "resampling-method", "Resampling method (near: nearest neighbour, bilinear: bi-linear interpolation).", "near"); Optionpk<string> description_opt("d", "description", "Set image description"); Optionpk<string> crule_opt("cr", "crule", "Composite rule for mosaic (overwrite, maxndvi, maxband, minband, mean, mode (only for byte images), median, sum", "overwrite"); Optionpk<int> ruleBand_opt("rb", "rband", "band index used for the rule (for ndvi, use --ruleBand=redBand --ruleBand=nirBand", 0); @@ -136,17 +136,19 @@ int main(int argc, char *argv[]) bndnodata_opt.push_back(bndnodata_opt[0]); } RESAMPLE theResample; - switch(resample_opt[0]){ - case(BILINEAR): - theResample=BILINEAR; - if(verbose_opt[0]) - cout << "resampling: bilinear interpolation" << endl; - break; - default: + if(resample_opt[0]=="near"){ theResample=NEAR; if(verbose_opt[0]) cout << "resampling: nearest neighbour" << endl; - break; + } + else if(resample_opt[0]=="bilinear"){ + theResample=BILINEAR; + if(verbose_opt[0]) + cout << "resampling: bilinear interpolation" << endl; + } + else{ + std::cout << "Error: resampling method " << resample_opt[0] << " not supported" << std::endl; + exit(1); } int nband=0; -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git _______________________________________________ Pkg-grass-devel mailing list Pkg-grass-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel