diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index dc32eb31b..7a554451a 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -32,12 +32,14 @@ set(gui_am_ui set(gui_ui ${gui_am_ui} AboutDialog.ui + OutputDialog.ui CameraOptions.ui DataColorOptions.ui DataFilterOptions.ui FeatureOptions.ui ImageOptions.ui PointOptions.ui + LaunchPlaneSweepView.ui ) set(gui_resources @@ -47,6 +49,7 @@ set(gui_resources set(gui_moc_headers AboutDialog.h + OutputDialog.h ActorColorButton.h CameraOptions.h CameraView.h @@ -63,10 +66,12 @@ set(gui_moc_headers tools/BundleAdjustTool.h tools/CanonicalTransformTool.h tools/NeckerReversalTool.h + LaunchPlaneSweepView.h ) set(gui_sources AboutDialog.cxx + OutputDialog.cxx ActorColorButton.cxx CameraOptions.cxx CameraView.cxx @@ -90,6 +95,7 @@ set(gui_sources tools/BundleAdjustTool.cxx tools/CanonicalTransformTool.cxx tools/NeckerReversalTool.cxx + LaunchPlaneSweepView.cxx ) maptk_use_appdata( diff --git a/gui/LaunchPlaneSweepView.cxx b/gui/LaunchPlaneSweepView.cxx new file mode 100644 index 000000000..0ed41fc61 --- /dev/null +++ b/gui/LaunchPlaneSweepView.cxx @@ -0,0 +1,351 @@ +/*ckwg +29 + * Copyright 2016 by Kitware, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither name of Kitware, Inc. nor the names of any contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "LaunchPlaneSweepView.h" + +#include "ui_LaunchPlaneSweepView.h" + +#include "OutputDialog.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////// + +//BEGIN LaunchPlaneSweepViewPrivate + +//----------------------------------------------------------------------------- +class LaunchPlaneSweepViewPrivate +{ +public: + + Ui::LaunchPlaneSweepView UI; + qtUiState uiState; + + QStringList args; + + QProcess *psl; + + QString krtdFolder; + QString framesFolder; + QString frameList; + QString landmarksFile; + + void addArg(QWidget* item, QString value=""); + void addArg(QWidget *item, double value); + + OutputDialog* dialog; +}; + +QTE_IMPLEMENT_D_FUNC(LaunchPlaneSweepView) + +//END LaunchPlaneSweepViewPrivate + +//BEGIN LaunchPlaneSweepView + +//----------------------------------------------------------------------------- +LaunchPlaneSweepView::LaunchPlaneSweepView(QWidget* parent, Qt::WindowFlags flags) + : QWidget(parent, flags), d_ptr(new LaunchPlaneSweepViewPrivate) +{ + QTE_D(); + + this->setAttribute(Qt::WA_DeleteOnClose); + + // Set up UI + d->UI.setupUi(this); + + // Set up UI persistence and restore previous state + d->uiState.setCurrentGroup("LaunchPlaneSweepView"); + + + // Set up signals/slots + connect(d->UI.pushButtonCompute, SIGNAL(clicked(bool)), + this, SLOT(compute())); + + connect(d->UI.checkBoxDepthAuto, SIGNAL(toggled(bool)), + d->UI.doubleSpinBoxDepthMin, SLOT(setDisabled(bool))); + + + connect(d->UI.checkBoxDepthAuto, SIGNAL(toggled(bool)), + d->UI.doubleSpinBoxDepthMax, SLOT(setDisabled(bool))); + + connect(d->UI.comboBoxMatchCost, SIGNAL(currentIndexChanged(int)), + this, SLOT(enableColorMatching())); + + d->dialog = new OutputDialog(); + + d->psl = new QProcess(); + + connect(d->psl, SIGNAL(readyRead()), + d->dialog, SLOT(ouputProcess())); + + connect(d->psl, SIGNAL(finished(int)), + this, SLOT(initialState())); + + connect(d->UI.pushButtonStop, SIGNAL(clicked(bool)), + d->psl, SLOT(kill())); + + connect(d->UI.pushButtonExplore, SIGNAL(clicked(bool)), + this, SLOT(openFileExplorer())); + + initializeComboBoxes(); +} + +//----------------------------------------------------------------------------- +LaunchPlaneSweepView::~LaunchPlaneSweepView() +{ + QTE_D(); + d->uiState.save(); +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::setKrtdFolder(QString krtdFolder) +{ + QTE_D(); + + d->krtdFolder = "--krtdFolder="+krtdFolder; +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::setLandmarksFile(QString landmarksFile) +{ + QTE_D(); + + d->landmarksFile = "--landmarksPLY=" + landmarksFile; +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::compute() +{ + QTE_D(); + + QString pslPath = d->UI.lineEditPSLPath->text(); + + d->args << "--debug"; + + //Getting frame folder + + std::ifstream frameList(d->frameList.toStdString()); + std::string framePath, frameFolder, imageListFile; + + imageListFile = "--imageListFile=" + d->frameList.toStdString(); + + frameList >> framePath; + frameFolder = framePath.substr(0,framePath.find_last_of("/\\")); + + frameList.close(); + + frameFolder = "--frameFolder=" + frameFolder; + + d->args << QString::fromStdString(frameFolder) ; + d->args << d->krtdFolder; + d->args << QString::fromStdString(imageListFile); + d->args << d->landmarksFile; + + //Parsing arguments from form + + for (int i = 0; i < this->children().size(); ++i) + { + if (this->children().at(i)->inherits("QCheckBox")) + { + QCheckBox *child = qobject_cast(this->children().at(i)); + + if (child->isChecked()) + { + d->addArg(child); + } + } + else if (this->children().at(i)->inherits("QComboBox")) + { + QComboBox *child = qobject_cast(this->children().at(i)); + + d->addArg(child, child->itemData(child->currentIndex()).toString()); + } + else if (this->children().at(i)->inherits("QSpinBox")) + { + QSpinBox *child = qobject_cast(this->children().at(i)); + + d->addArg(child,child->value()); + } + } + + d->addArg(d->UI.lineEditOutputDirectory, d->UI.lineEditOutputDirectory->text()); + + + d->dialog->show(); + d->dialog->setOutputToDisplay(d->psl); + + runningState(); + + d->psl->setProcessChannelMode(QProcess::MergedChannels); + d->psl->start(pslPath,d->args); +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::enableColorMatching() +{ + + QTE_D(); + + if (d->UI.comboBoxMatchCost->currentText().toStdString() == "SAD") + { + d->UI.checkBoxColorMatching->setEnabled(true); + d->UI.checkBoxColorMatching->setChecked(true); + } + else + { + d->UI.checkBoxColorMatching->setEnabled(false); + d->UI.checkBoxColorMatching->setChecked(false); + } +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::setFrameList(QString frameList) +{ + QTE_D(); + + d->frameList = frameList; +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::setNumCam(int numCam) +{ + QTE_D(); + + d->UI.spinBoxFrameSample->setMaximum(numCam); + d->UI.spinBoxRefFrameStep->setMaximum(numCam); +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::initalizeValues(QString krtdFolder, + QString landmarksFile, + QString frameList, int numCam) +{ + setKrtdFolder(krtdFolder); + setLandmarksFile(landmarksFile); + setFrameList(frameList); + setNumCam(numCam); +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::initialState() +{ + QTE_D(); + + d->args.clear(); + for (int i = 0; i < this->children().size(); ++i) { + if (this->children().at(i)->inherits("QWidget")) { + QWidget *child = qobject_cast(this->children().at(i)); + child->setEnabled(true); + } + } + d->UI.pushButtonStop->setEnabled(false); + + d->UI.doubleSpinBoxDepthMin->setEnabled(false); + d->UI.doubleSpinBoxDepthMax->setEnabled(false); + +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::openFileExplorer() +{ + QTE_D(); + QString path = QFileDialog::getOpenFileName(); + + d->UI.lineEditPSLPath->setText(path); + +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::runningState() +{ + QTE_D(); + + for (int i = 0; i < this->children().size(); ++i) + { + if (this->children().at(i)->inherits("QWidget")) + { + QWidget *child = qobject_cast(this->children().at(i)); + child->setEnabled(false); + } + } + d->UI.pushButtonStop->setEnabled(true); +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::initializeComboBoxes() +{ + QTE_D(); + + d->UI.comboBoxMatchCost->addItem("SAD",QVariant("SAD")); + d->UI.comboBoxMatchCost->addItem("ZNCC",QVariant("ZNCC")); + + d->UI.comboBoxOcclusionMode->addItem("None",QVariant("None")); + d->UI.comboBoxOcclusionMode->addItem("Ref Split",QVariant("RefSplit")); + d->UI.comboBoxOcclusionMode->addItem("Best K",QVariant("BestK")); + + d->UI.comboBoxOutputs->addItem("VTI files only",QVariant("vti")); + d->UI.comboBoxOutputs->addItem("VTI and VTS",QVariant("vts")); + d->UI.comboBoxOutputs->addItem("VTI and VTP",QVariant("vtp")); + d->UI.comboBoxOutputs->addItem("VTI, VTP and VTS files",QVariant("vtpvts")); + d->UI.comboBoxOutputs->addItem("VTI and VRML files",QVariant("vrml")); +} + +//END LaunchPlaneSweepView + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepViewPrivate::addArg(QWidget *item, QString value) +{ + QString arg = item->property("configField").toString(); + + if(!value.isEmpty()) + { + arg = arg + "=" + value; + } + args << arg; + +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepViewPrivate::addArg(QWidget *item, double value) +{ + std::ostringstream sstream; + sstream << value; + std::string valueStr = sstream.str(); + + addArg(item,QString::fromStdString(valueStr)); +} diff --git a/gui/LaunchPlaneSweepView.h b/gui/LaunchPlaneSweepView.h new file mode 100644 index 000000000..164e6dbd2 --- /dev/null +++ b/gui/LaunchPlaneSweepView.h @@ -0,0 +1,77 @@ +/*ckwg +29 + * Copyright 2016 by Kitware, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither name of Kitware, Inc. nor the names of any contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef MAPTK_LAUNCHPLANESWEEPVIEW_H_ +#define MAPTK_LAUNCHPLANESWEEPVIEW_H_ + +#include + +#include + +#include + +class LaunchPlaneSweepViewPrivate; + +class LaunchPlaneSweepView : public QWidget +{ + Q_OBJECT + +public: + explicit LaunchPlaneSweepView(QWidget* parent = 0, Qt::WindowFlags flags = 0); + virtual ~LaunchPlaneSweepView(); + + void setKrtdFolder(QString krtdFolder); + void setLandmarksFile(QString landmarksFile); + void setFrameList(QString frameList); + void setNumCam(int numCam); + + void initalizeValues(QString krtdFolder,QString landmarksFile, + QString frameList,int numCam); + void runningState(); + + +public slots: + void compute(); + void enableColorMatching(); + void initialState(); + void openFileExplorer(); + + +protected slots: + void initializeComboBoxes(); + +private: + QTE_DECLARE_PRIVATE_RPTR(LaunchPlaneSweepView) + QTE_DECLARE_PRIVATE(LaunchPlaneSweepView) + + QTE_DISABLE_COPY(LaunchPlaneSweepView) +}; + +#endif diff --git a/gui/LaunchPlaneSweepView.ui b/gui/LaunchPlaneSweepView.ui new file mode 100644 index 000000000..3346cecac --- /dev/null +++ b/gui/LaunchPlaneSweepView.ui @@ -0,0 +1,394 @@ + + + LaunchPlaneSweepView + + + + 0 + 0 + 518 + 691 + + + + Compute Depthmaps with PSL + + + + + + Rescale Factor + + + + + + + Output Directory + + + + + + + + 75 + true + + + + Misc. parameters + + + + + + + false + + + 2 + + + 0.000000000000000 + + + --PS_MIN_DEPTH + + + + + + + + 75 + true + + + + Matching Cost Parameters + + + + + + + PlaneSweepLib path + + + + + + + Depth Min + + + + + + + --PS_OCCLUSION_MODE + + + + + + + Number of Frame to Use + + + + + + + Compute + + + + + + + Use Sub Pixel Computation + + + true + + + --PS_USE_SUBPIXEL + + + + + + + ... + + + + + + + Matching Window Size + + + + + + + Depth Max + + + + + + + Occlusion Mode + + + + + + + ArrowCursor + + + 1 + + + 5 + + + --ref_view_step + + + + + + + Number of Planes + + + + + + + 1 + + + 5 + + + --PS_MATCHING_WINDOW_SIZE + + + + + + + Depth Auto + + + true + + + + + + --PS_AUTO_RANGE + + + + + + + 10000 + + + 512 + + + --PS_NUM_PLANES + + + + + + + --writePointClouds + + + + + + + Outputs + + + + + + + 0.100000000000000 + + + 0.250000000000000 + + + 1.000000000000000 + + + --PS_RESCALE_FACTOR + + + + + + + + 75 + true + + + + Frames Parameters + + + + + + + --PS_MATCHING_COSTS + + + + + + + false + + + --PS_MAX_DEPTH + + + + + + + false + + + Stop + + + false + + + + + + + + 75 + true + + + + Depth Parameters + + + + + + + Matching Costs Algorithm + + + + + + + + + + + + + + true + + + depthmaps + + + --outputDirectory + + + + + + + Use Color matching + + + true + + + --PS_COLOR_MATCHING + + + + + + + + 75 + true + + + + Outputs parameters + + + + + + + 1 + + + 20 + + + --PS_MAX_NUM_IMAGES + + + + + + + 2.000000000000000 + + + --PS_MIN_ANGLE_DEGREE + + + + + + + Reference Frame Step + + + + + + + Min. Angle Degree Between Frames + + + + + + + + diff --git a/gui/MainWindow.cxx b/gui/MainWindow.cxx index b77ef4483..8850ae544 100644 --- a/gui/MainWindow.cxx +++ b/gui/MainWindow.cxx @@ -41,6 +41,7 @@ #include "MatchMatrixWindow.h" #include "Project.h" #include "vtkMaptkCamera.h" +#include "LaunchPlaneSweepView.h" #include #include @@ -266,6 +267,10 @@ class MainWindowPrivate QQueue orphanImages; QQueue orphanCameras; + + QString krtdFolder; + QString landmarksFile; + QString framesFolder; }; QTE_IMPLEMENT_D_FUNC(MainWindow) @@ -631,6 +636,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags) connect(d->UI.camera, SIGNAL(valueChanged(int)), this, SLOT(setActiveCamera(int))); + connect(d->UI.actionPlaneSweepLib, SIGNAL(triggered(bool)), + this, SLOT(showComputeDepthmaps())); + this->setSlideDelay(d->UI.slideDelay->value()); // Set up UI persistence and restore previous state @@ -773,6 +781,11 @@ void MainWindow::loadProject(QString const& path) } } + d->krtdFolder = project.cameraPath; + d->landmarksFile = project.landmarks; + d->framesFolder = project.frameListPath; + d->UI.menuDepthmaps->setEnabled(true); + d->UI.worldView->resetView(); } @@ -1118,6 +1131,21 @@ void MainWindow::showMatchMatrix() } } +void MainWindow::showComputeDepthmaps() +{ + QTE_D(); + + auto window = new LaunchPlaneSweepView(); + +// window->setKrtdFolder(d->krtdFolder); +// window->setFrameList(d->framesFolder); +// window->setLandmarksFile(d->landmarksFile); + + window->initalizeValues(d->krtdFolder, d->landmarksFile, + d->framesFolder, d->cameras.size()); + window->show(); +} + //----------------------------------------------------------------------------- void MainWindow::setViewBackroundColor() { diff --git a/gui/MainWindow.h b/gui/MainWindow.h index 06776d7e5..04cc860f8 100644 --- a/gui/MainWindow.h +++ b/gui/MainWindow.h @@ -67,6 +67,8 @@ public slots: void showMatchMatrix(); + void showComputeDepthmaps(); + void showAboutDialog(); void showUserManual(); diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui index 2395eb4b4..a9194b857 100644 --- a/gui/MainWindow.ui +++ b/gui/MainWindow.ui @@ -20,7 +20,7 @@ 0 0 800 - 21 + 27 @@ -63,6 +63,16 @@ &Compute + + + false + + + Depthmaps... + + + + @@ -275,6 +285,14 @@ Change the background color of the views + + + true + + + Plane Sweep Lib + + true diff --git a/gui/OutputDialog.cxx b/gui/OutputDialog.cxx new file mode 100644 index 000000000..87068d256 --- /dev/null +++ b/gui/OutputDialog.cxx @@ -0,0 +1,101 @@ +/*ckwg +29 + * Copyright 2016 by Kitware, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither name of Kitware, Inc. nor the names of any contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "OutputDialog.h" + +#include "ui_OutputDialog.h" + +#include +#include +#include +#include +#include +#include + +//BEGIN OutputDialogPrivate + +//----------------------------------------------------------------------------- +class OutputDialogPrivate +{ +public: + + Ui::OutputDialog UI; + qtUiState uiState; + + QProcess *process; +}; + +QTE_IMPLEMENT_D_FUNC(OutputDialog) + + +//END OutputDialogPrivate + + +//BEGIN OutputDialog + +//----------------------------------------------------------------------------- +OutputDialog::OutputDialog(QWidget* parent, Qt::WindowFlags flags) + : QDialog(parent, flags), d_ptr(new OutputDialogPrivate) +{ + QTE_D(); + + this->setAttribute(Qt::WA_DeleteOnClose); + + // Set up UI + d->UI.setupUi(this); + +} + +//----------------------------------------------------------------------------- +OutputDialog::~OutputDialog() +{ + QTE_D(); + d->uiState.save(); +} + +//----------------------------------------------------------------------------- +void OutputDialog::setOutputToDisplay(QProcess *process) +{ + QTE_D(); + + d->process = process; +} + +//----------------------------------------------------------------------------- +void OutputDialog::ouputProcess() +{ + QTE_D(); + + QString outputText(d->process->readAll()); + d->UI.plainTextEdit->appendPlainText(outputText); +} + + +//END OutputDialog diff --git a/gui/OutputDialog.h b/gui/OutputDialog.h new file mode 100644 index 000000000..0e024fa58 --- /dev/null +++ b/gui/OutputDialog.h @@ -0,0 +1,64 @@ +/*ckwg +29 + * Copyright 2016 by Kitware, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither name of Kitware, Inc. nor the names of any contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef MAPTK_OUTPUTDIALOG_H_ +#define MAPTK_OUTPUTDIALOG_H_ + +#include +#include + +#include + + +class OutputDialogPrivate; + +class QProcess; + +class OutputDialog : public QDialog +{ + Q_OBJECT + +public: + explicit OutputDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); + virtual ~OutputDialog(); + void setOutputToDisplay(QProcess *process); + + +public slots: + void ouputProcess(); + +private: + QTE_DECLARE_PRIVATE_RPTR(OutputDialog) + QTE_DECLARE_PRIVATE(OutputDialog) + + QTE_DISABLE_COPY(OutputDialog) +}; + +#endif diff --git a/gui/OutputDialog.ui b/gui/OutputDialog.ui new file mode 100644 index 000000000..658bafd1e --- /dev/null +++ b/gui/OutputDialog.ui @@ -0,0 +1,24 @@ + + + OutputDialog + + + + 0 + 0 + 508 + 369 + + + + Output Trace + + + + + + + + + + diff --git a/gui/Project.cxx b/gui/Project.cxx index 95d989b8f..59e034181 100644 --- a/gui/Project.cxx +++ b/gui/Project.cxx @@ -79,6 +79,7 @@ bool Project::read(QString const& path) // Read image list auto const& iflPath = config->get_value("image_list_file"); + this->frameListPath = QString::fromStdString(iflPath); QFile ifl(base.filePath(qtString(iflPath))); if (!ifl.open(QIODevice::ReadOnly | QIODevice::Text)) { diff --git a/gui/Project.h b/gui/Project.h index c47ca942a..834b3e7ed 100644 --- a/gui/Project.h +++ b/gui/Project.h @@ -38,6 +38,7 @@ struct Project bool read(QString const& path); QStringList images; + QString frameListPath; QString cameraPath; QString tracks;