[pktools] 259/375: pkextract_gui default sample

Bas Couwenberg sebastic at xs4all.nl
Wed Dec 3 21:54:19 UTC 2014


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 7f336399e8fbdbb1b16ee33f78ad5ca8e6a91931
Author: Pieter Kempeneers <kempenep at gmail.com>
Date:   Thu May 8 08:58:08 2014 +0200

    pkextract_gui default sample
---
 qt/pkcomposite_gui/mainwindow.cc | 2 ++
 qt/pkcrop_gui/mainwindow.cc      | 2 ++
 qt/pkdiff_gui/mainwindow.cpp     | 2 ++
 qt/pkextract_gui/mainwindow.cpp  | 3 +++
 qt/pksvm_gui/mainwindow.cpp      | 2 ++
 src/apps/pkextract.cc            | 6 +++++-
 6 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/qt/pkcomposite_gui/mainwindow.cc b/qt/pkcomposite_gui/mainwindow.cc
index 6e52eb6..b56769f 100644
--- a/qt/pkcomposite_gui/mainwindow.cc
+++ b/qt/pkcomposite_gui/mainwindow.cc
@@ -227,7 +227,9 @@ void MainWindow::on_toolButton_Run_clicked()
         QProcess *myProcess = new QProcess(this);
         myProcess->start(program);
         myProcess->setProcessChannelMode(QProcess::MergedChannels);
+        this->setCursor(Qt::WaitCursor);
         myProcess->waitForFinished(-1);
+        this->setCursor(Qt::ArrowCursor);
         QString p_stderr = myProcess->readAllStandardError();
         if(!p_stderr.isEmpty()){
             QMessageBox msgBox;
diff --git a/qt/pkcrop_gui/mainwindow.cc b/qt/pkcrop_gui/mainwindow.cc
index 65794ac..b11cd42 100644
--- a/qt/pkcrop_gui/mainwindow.cc
+++ b/qt/pkcrop_gui/mainwindow.cc
@@ -142,7 +142,9 @@ void MainWindow::on_actionInput_triggered()
     //todo: loop over all filenames and get the minimum number of bands?
     program+=fileNames[0];
     myProcess->start(program);
+    this->setCursor(Qt::WaitCursor);
     myProcess->waitForFinished(-1);
+    this->setCursor(Qt::ArrowCursor);
     QString p_stdout=myProcess->readAll();
     int nband=p_stdout.section(' ',1).toInt();
     QStringList bandlist;
diff --git a/qt/pkdiff_gui/mainwindow.cpp b/qt/pkdiff_gui/mainwindow.cpp
index 6a1ce6f..0123eec 100644
--- a/qt/pkdiff_gui/mainwindow.cpp
+++ b/qt/pkdiff_gui/mainwindow.cpp
@@ -167,7 +167,9 @@ void MainWindow::on_pushButton_run_clicked()
         QProcess *myProcess = new QProcess(this);
         myProcess->start(program);
         myProcess->setProcessChannelMode(QProcess::MergedChannels);
+        this->setCursor(Qt::WaitCursor);
         myProcess->waitForFinished(-1);
+        this->setCursor(Qt::ArrowCursor);
         QMessageBox msgBox;
         QString p_stderr = myProcess->readAllStandardError();
         if(!p_stderr.isEmpty()){
diff --git a/qt/pkextract_gui/mainwindow.cpp b/qt/pkextract_gui/mainwindow.cpp
index 5d6e339..aab8aad 100644
--- a/qt/pkextract_gui/mainwindow.cpp
+++ b/qt/pkextract_gui/mainwindow.cpp
@@ -29,6 +29,7 @@ void MainWindow::setDefaults()
 {
     //tab input/output
     ui->input->clear();
+    ui->sample->clear();
     ui->mask->clear();
     ui->msknodata->setText("0");
     ui->polygon->setChecked(false);
@@ -158,7 +159,9 @@ void MainWindow::on_pushButton_run_clicked()
         QProcess *myProcess = new QProcess(this);
         myProcess->start(program);
         myProcess->setProcessChannelMode(QProcess::MergedChannels);
+        this->setCursor(Qt::WaitCursor);
         myProcess->waitForFinished(-1);
+        this->setCursor(Qt::ArrowCursor);
         QString p_stderr = myProcess->readAllStandardError();
         if(!p_stderr.isEmpty()){
             QMessageBox msgBox;
diff --git a/qt/pksvm_gui/mainwindow.cpp b/qt/pksvm_gui/mainwindow.cpp
index af8b84c..2e5e136 100644
--- a/qt/pksvm_gui/mainwindow.cpp
+++ b/qt/pksvm_gui/mainwindow.cpp
@@ -233,7 +233,9 @@ void MainWindow::on_pushButton_run_clicked()
         QProcess *myProcess = new QProcess(this);
         myProcess->start(program);
         myProcess->setProcessChannelMode(QProcess::MergedChannels);
+        this->setCursor(Qt::WaitCursor);
         myProcess->waitForFinished(-1);
+        this->setCursor(Qt::ArrowCursor);
         QMessageBox msgBox;
         QString p_stderr = myProcess->readAllStandardError();
         if(!p_stderr.isEmpty()){
diff --git a/src/apps/pkextract.cc b/src/apps/pkextract.cc
index 2a42071..b03a69f 100644
--- a/src/apps/pkextract.cc
+++ b/src/apps/pkextract.cc
@@ -1688,7 +1688,11 @@ int main(int argc, char *argv[])
 
 	    if(verbose_opt[0]>1)
 	      std::cout << "get centroid point from polygon" << std::endl;
-	    assert(ruleMap[rule_opt[0]]!=rule::pointOnSurface);//not supported for multipolygons
+	    if(ruleMap[rule_opt[0]]==rule::pointOnSurface){
+	      string errorString="Error: pointOnSurface is not supported for multi polygons";
+	      throw(errorString);
+	    }
+		
 	    readPolygon.Centroid(&writeCentroidPoint);
 
 	    double ulx,uly,lrx,lry;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git



More information about the Pkg-grass-devel mailing list