You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.2 KiB
C++
79 lines
2.2 KiB
C++
#include "importscenedatadialog.h"
|
|
#include "qprogressbar.h"
|
|
#include "ui_importscenedatadialog.h"
|
|
|
|
#include <QFileDialog>
|
|
#include <QProgressDialog>
|
|
|
|
ImportSceneDataDialog::ImportSceneDataDialog(QWidget *parent) :
|
|
QDialog(parent),
|
|
ui(new Ui::ImportSceneDataDialog)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
this->setWindowTitle("导入场景文件");
|
|
this->resize(800,500);
|
|
this->setWindowFlags(Qt::WindowCloseButtonHint); //关闭右上角帮助(?)按钮。
|
|
}
|
|
|
|
ImportSceneDataDialog::~ImportSceneDataDialog()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void ImportSceneDataDialog::on_selectImageBtn_clicked()
|
|
{
|
|
ui->imageTextBw->clear();
|
|
//获取影像文件路径,并写入文本框
|
|
imagePathList = QFileDialog::getOpenFileNames(this,"选择影像文件",
|
|
":/",
|
|
"GeoTIFF"+tr("文件")+"(*.tif *.tiff)");
|
|
for(int i = 0;i<imagePathList.size();i++)
|
|
{
|
|
ui->imageTextBw->append(imagePathList.at(i));
|
|
}
|
|
}
|
|
|
|
|
|
void ImportSceneDataDialog::on_selectTerrainBtn_clicked()
|
|
{
|
|
ui->terrainTextBw->clear();
|
|
//获取地形文件路径,并写入文本框
|
|
terrianPathList = QFileDialog::getOpenFileNames(this,"选择地形文件",
|
|
":/",
|
|
"GeoTIFF"+tr("文件")+"(*.tif *.tiff)");
|
|
for(int i = 0;i<terrianPathList.size();i++)
|
|
{
|
|
ui->terrainTextBw->append(terrianPathList.at(i));
|
|
}
|
|
}
|
|
|
|
|
|
void ImportSceneDataDialog::on_cancelBtn_clicked()
|
|
{
|
|
this->close();
|
|
}
|
|
|
|
|
|
void ImportSceneDataDialog::on_importBtn_clicked()
|
|
{
|
|
this->accept();
|
|
|
|
// QProgressDialog* progressDlg = new QProgressDialog("影像文件导入中...", "取消", 0, 100);
|
|
// progressDlg->setWindowFlags(Qt::CustomizeWindowHint|Qt::WindowMinimizeButtonHint);
|
|
// progressDlg->setWindowTitle("提示");
|
|
// progressDlg->setFocus();
|
|
// QProgressBar* bar = new QProgressBar(progressDlg);
|
|
// bar->setRange(0, 0);
|
|
// bar->setValue(0);
|
|
// progressDlg->setBar(bar);
|
|
// progressDlg->setMinimumWidth(500);
|
|
// progressDlg->setMinimumDuration(1000);
|
|
// progressDlg->setWindowModality(Qt::WindowModal);
|
|
// progressDlg->setValue(0);
|
|
// progressDlg->showNormal();
|
|
|
|
emit sendSceneDataPath(imagePathList,terrianPathList);
|
|
}
|
|
|