//===============================================structureFromMotion======================================================// bool TextureGenrator::structureFromMotion(){ int start = 0; int end = 0; //start to reconstruction m_parent->progressBar->setRange(0,0); m_parent->m_time->setInterval(10); m_parent->m_time->start(); connect(m_parent->m_time, SIGNAL(timeout()), m_parent, SLOT(stepOne())); //run structrure from motion of VisualSFM.exe m_parent->textEditConsole->append("正在进行稀疏重建,请稍候..."); m_parent->update(); start = clock(); QString command = " sfm+cmvs imgList.txt TempData"; if(!shellExecute("VisualSFM.exe", command.toStdString().c_str())){ m_parent->textEditConsole->append("稀疏重建出现错误"); return false; } end = clock(); m_parent->textEditConsole->append(QString("稀疏重建完成,用时 %1 s\n").arg((double)(end-start)/CLOCKS_PER_SEC)); m_parent->m_time->disconnect(); m_parent->m_time->stop(); return true; }
bool QWindowsServices::openUrl(const QUrl &url) { const QString scheme = url.scheme(); if (scheme == QLatin1String("mailto") && launchMail(url)) return true; return shellExecute(url); }
bool QWindowsServices::openUrl(const QUrl &url) { const QString scheme = url.scheme(); if (scheme.isEmpty()) return openDocument(url); if (scheme == QStringLiteral("mailto") && launchMail(url)) return true; return shellExecute(QLatin1String(url.toEncoded())); }
virtual void run() { BException rex; HANDLE hProcess = NULL; try { wstring params = makeValidParams(args); wstring fileToOpen = jsfs->makeValidPath(args->at(0)); PExecuteNotifyInfo notifyInfo; pwstring pstandardOut, pstandardError; if (notify) { notifyInfo = PExecuteNotifyInfo(new ExecuteNotifyInfo()); } if (execOpts->getStandardInput().size() || (notifyInfo && (execOpts->getCaptureOutput() || execOpts->getCaptureError()))) { if (notifyInfo && execOpts->getCaptureOutput()) pstandardOut = pwstring(new wstring()); if (notifyInfo && execOpts->getCaptureError()) pstandardError = pwstring(new wstring()); createProcess(fileToOpen, params, execOpts->getStandardInput(), pstandardOut, pstandardError); } else { shellExecute(fileToOpen, params); } if (notifyInfo) { PFileSystemNotify notifyService = jsfs->getNotifyService(); if (notifyService) { notifyInfo->setExtraInfo(execOpts->getExtraInfo()); if (pstandardOut) notifyInfo->setStandardOutput(*pstandardOut); if (pstandardError) notifyInfo->setStandardError(*pstandardError); notifyService->notify(notifyInfo); } } } catch (const BException& ex) { rex = ex; } if (hProcess) ::CloseHandle(hProcess); if (rex) { throw rex; } }
//===============================================densePointCloudReconstruction============================================// bool TextureGenrator::densePointCloudReconstruction(){ int start = 0; int end = 0; m_parent->textEditConsole->append("正在进行稠密点云重建,请稍候..."); //run PMVS for dense reconstruction QString path = "TempData" + tr(".nvm.cmvs/00/"); start = clock(); // find all the files QDir dir; dir.setPath(path); dir.setFilter(QDir::Files | QDir::NoSymLinks | QDir::NoDotAndDotDot); QStringList filter; filter<<"option-*"; QFileInfoList fileList = dir.entryInfoList(filter); int nOpts = fileList.size(); m_parent->progressBar->setRange(0,nOpts); m_parent->progressBar->setValue(0); for(int i=0; i< nOpts; i++){ // option files QString optFile = fileList.at(i).filePath(); QStringList fields= optFile.split("/"); // commad line arguments QString cmdArgu = path +" " + fields.takeLast(); m_parent->textEditConsole->append( QString("%1 th reconstruction ").arg(i)); m_parent->textEditConsole->append( dir.currentPath()+ "/" + optFile); if(!shellExecute("pmvs2.exe", cmdArgu.toStdString().c_str()))return false; m_parent->progressBar->setValue(i+1); QApplication::processEvents(); } end = clock(); m_parent->textEditConsole->append(QString("稠密重建完成,用时 %1 s\n").arg((double)(end-start)/CLOCKS_PER_SEC)); m_parent->textEditConsole->append("重建结果保存在 " + dir.currentPath()+ "/" + path); update(); return true; }
bool QWindowsServices::openDocument(const QUrl &url) { return shellExecute(url); }
bool QWindowsServices::openDocument(const QUrl &url) { return shellExecute(url.isLocalFile() ? url.toLocalFile() : url.toString()); }