diff --git a/Classes/Loading.cpp b/Classes/Loading.cpp index 83c2210..e693595 100644 --- a/Classes/Loading.cpp +++ b/Classes/Loading.cpp @@ -3,31 +3,19 @@ Loading::Loading(QWidget *parent) : QWidget(parent) { - // qss - ui.setupUi(this); - QFile file(":/qss/qss/aqua.qss"); - file.open(QFile::ReadOnly); - QTextStream filetext(&file); - QString stylesheet = filetext.readAll(); - this->setStyleSheet(stylesheet); - file.close(); - + + setStyle(); + ui.label_2->hide(); - ui.progressBar->setValue(0); - QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect; - ui.progressBar->setGraphicsEffect(opacityEffect); - opacityEffect->setOpacity(0.9); - - // 背景 - QPixmap *pixmap = new QPixmap("Resources/image/loading.png"); - pixmap->scaled(ui.label_4->size(), Qt::KeepAspectRatio); - ui.label_4->setScaledContents(true); - ui.label_4->setPixmap(*pixmap); + // ui.progressBar->setValue(0); + // QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect; + // ui.progressBar->setGraphicsEffect(opacityEffect); + // opacityEffect->setOpacity(0.9); // todo 加载 + // ui.progressBar->setValue(100); ui.label->hide(); - ui.progressBar->setValue(100); ui.label_2->show(); ready2Enter = true; } @@ -36,9 +24,40 @@ Loading::~Loading() { } +void Loading::setStyle() +{ + // qss + ui.setupUi(this); + QFile file(":/qss/qss/aqua.qss"); + file.open(QFile::ReadOnly); + QTextStream filetext(&file); + QString stylesheet = filetext.readAll(); + this->setStyleSheet(stylesheet); + file.close(); + + // Press any key to continue + QPixmap *pixmap_press = new QPixmap(":/icon/image/loading/press.png"); + pixmap_press->scaled(ui.label_2->size(), Qt::KeepAspectRatio); + ui.label_2->setScaledContents(true); + ui.label_2->setPixmap(*pixmap_press); + + //3D reconstruction + QPixmap *pixmap_label = new QPixmap(":/icon/image/loading/label.png"); + pixmap_label->scaled(ui.label_3->size(), Qt::KeepAspectRatio); + ui.label_3->setScaledContents(true); + ui.label_3->setPixmap(*pixmap_label); + + // 背景 + QPixmap *pixmap = new QPixmap(":/Reconstruction/image/loading/loading.png"); + pixmap->scaled(ui.label_4->size(), Qt::KeepAspectRatio); + ui.label_4->setScaledContents(true); + ui.label_4->setPixmap(*pixmap); +} + + void Loading::updateSlot() { - ui.progressBar->setValue(currentValue); + // ui.progressBar->setValue(currentValue); } void Loading::mousePressEvent(QMouseEvent *event) diff --git a/Classes/Loading.h b/Classes/Loading.h index 1296365..31351b8 100644 --- a/Classes/Loading.h +++ b/Classes/Loading.h @@ -19,6 +19,7 @@ private: bool ready2Enter = false; int currentValue = 0; void updateSlot(); + void setStyle(); protected: void mousePressEvent(QMouseEvent *); diff --git a/Classes/Reconstruction.cpp b/Classes/Reconstruction.cpp index e069523..ac4842d 100644 --- a/Classes/Reconstruction.cpp +++ b/Classes/Reconstruction.cpp @@ -10,8 +10,8 @@ Reconstruction::Reconstruction(QWidget *parent) void Reconstruction::setStyle() { this->setContentsMargins(0, 0, 0, 0); - this->setFixedSize(1110, 580); - ui.centralWidget->setGeometry(0, 40, 1110, 400); + // this->setFixedSize(1240, 680); + // ui.centralWidget->setGeometry(0, 40, 1240, 680); ui.centralWidget->show(); // qss @@ -25,9 +25,6 @@ void Reconstruction::setStyle() QPalette palette1; palette1.setColor(QPalette::Background, qRgba(44, 46, 70, 100)); ui.widget->setPalette(palette1); - // QPa/*lette palette2; - // palette2.setColor(QPalette::Background, Qt::white); - // ui.stackedWidget->setPalette(palette2); ui.stackedWidget->setCurrentIndex(0); setPicStyle(); setButtonStyle(); @@ -81,6 +78,7 @@ void Reconstruction::on_pushButton_2_clicked() void Reconstruction::on_pushButton_3_clicked() { ui.stackedWidget->setCurrentIndex(2); + ui.label_9->setVisible(FALSE); } #pragma endregion @@ -133,8 +131,6 @@ void Reconstruction::on_pushButton_7_clicked() ui.textBrowser_2->append(""); ui.textBrowser_3->append(""); ui.textBrowser_4->append(""); - ui.textBrowser_5->append(""); - ui.textBrowser_6->append(""); } // 保存结果 @@ -257,7 +253,7 @@ void Reconstruction::on_pushButton_13_clicked() { QString fileName = QFileDialog::getOpenFileName( this, tr("open multiple image file"), - "./", tr("Image files(*.bmp *.jpg *.pbm *.pgm *.png *.ppm *.xbm *.xpm);;All files (*.*)")); // todo 文件类型待确认 + "./", tr("PCD files(*.pcd);;All files (*.*)")); // todo 文件类型待确认 if (fileName.isEmpty()) { @@ -266,6 +262,19 @@ void Reconstruction::on_pushButton_13_clicked() return; } + ui.label_9->setVisible(TRUE); + string pcd = fileName.toStdString(); + + PointCloud::Ptr cloud(new PointCloud); + io::loadPCDFile(pcd, *cloud); + boost::shared_ptr viewer(new visualization::PCLVisualizer("3D Viewer")); + viewer->setBackgroundColor(0, 0, 0); + viewer->addPointCloud(cloud, "cloud"); + viewer->setPointCloudRenderingProperties(visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud"); + ui.qvtkWidget->SetRenderWindow(viewer->getRenderWindow()); + ui.label_9->setVisible(FALSE); + ui.qvtkWidget->update(); + // todo 存储文件或文件路径 } diff --git a/Classes/Reconstruction.h b/Classes/Reconstruction.h index 3068fd8..9b718b3 100644 --- a/Classes/Reconstruction.h +++ b/Classes/Reconstruction.h @@ -9,6 +9,13 @@ #include #include "DisplayPic.h" #include "ui_Reconstruction.h" +#include +#include +#include +#include +#include +using namespace pcl; +using namespace std; class Reconstruction : public QMainWindow { diff --git a/Resources/Reconstruction.qrc b/Resources/Reconstruction.qrc index d15f170..c0e5c07 100644 --- a/Resources/Reconstruction.qrc +++ b/Resources/Reconstruction.qrc @@ -1,5 +1,7 @@ - + + image/loading/loading.png + image/common/3D.png image/common/camera.png @@ -15,6 +17,8 @@ image/reconstruction/save2.png image/calibration/novideo.png image/projection/novideo.jpg + image/loading/label.png + image/loading/press.png qss/flat.qss diff --git a/Resources/image/loading/label.png b/Resources/image/loading/label.png new file mode 100644 index 0000000..e0e2ac0 Binary files /dev/null and b/Resources/image/loading/label.png differ diff --git a/Resources/image/loading.png b/Resources/image/loading/loading.png similarity index 100% rename from Resources/image/loading.png rename to Resources/image/loading/loading.png diff --git a/Resources/image/loading/press.png b/Resources/image/loading/press.png new file mode 100644 index 0000000..32ab235 Binary files /dev/null and b/Resources/image/loading/press.png differ diff --git a/UI/Loading.ui b/UI/Loading.ui index f15c7ec..61d80d3 100644 --- a/UI/Loading.ui +++ b/UI/Loading.ui @@ -14,68 +14,11 @@ Loading - - - 360 - 410 - 151 - 41 - - - - - Adobe Devanagari - 14 - - - - color: rgb(255, 255, 255); - - - LOADING... - - - - - - 140 - 330 - 571 - 27 - - - - 0 - - - 330 420 - 181 - 31 - - - - - 涔︿綋鍧婇洩绾綋3500 - 18 - - - - color: rgb(255, 255, 255); - - - 鎸変换鎰忛敭杩涘叆 - - - - - - 260 - 40 - 321 + 201 41 @@ -89,7 +32,51 @@ color: rgb(255, 255, 255); - 3D RECONSTRUCTION + LOADING... + + + + + + 260 + 420 + 301 + 31 + + + + + 娈靛畞姣涚瑪琛屼功 + 18 + + + + color: rgb(255, 255, 255); + + + + + + + + + 210 + 40 + 401 + 51 + + + + + Adobe Devanagari + 20 + + + + color: rgb(255, 255, 255); + + + @@ -113,7 +100,6 @@ label_4 label - progressBar label_2 label_3 diff --git a/UI/Reconstruction.ui b/UI/Reconstruction.ui index cc48dfc..388414e 100644 --- a/UI/Reconstruction.ui +++ b/UI/Reconstruction.ui @@ -6,20 +6,20 @@ 0 0 - 1110 - 580 + 1240 + 680 - 1110 - 580 + 1240 + 680 - 1110 - 580 + 1240 + 680 @@ -37,14 +37,14 @@ - 1110 - 580 + 1240 + 680 - 1110 - 580 + 1240 + 680 @@ -58,8 +58,8 @@ 249 6 - 851 - 541 + 981 + 641 @@ -75,7 +75,7 @@ - 220 + 300 10 81 16 @@ -96,10 +96,10 @@ - 520 - 260 - 321 - 271 + 670 + 430 + 301 + 201 @@ -122,8 +122,8 @@ 10 20 - 301 - 251 + 281 + 181 @@ -145,40 +145,8 @@ 7 - - - - - Adobe Devanagari - 10 - - - - T12 - - - Qt::AlignCenter - - - - - - - - Adobe Devanagari - 10 - - - - R12 - - - Qt::AlignCenter - - - - - + + 250 @@ -215,30 +183,8 @@ - - - - - 250 - 31 - - - - - Adobe Devanagari - 10 - - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - - - + + Adobe Devanagari @@ -246,32 +192,26 @@ - HP2 + T12 Qt::AlignCenter - - - - - 250 - 31 - - + + Adobe Devanagari 10 - - Qt::ScrollBarAlwaysOff + + R12 - - Qt::ScrollBarAlwaysOff + + Qt::AlignCenter @@ -291,24 +231,8 @@ - - - - - Adobe Devanagari - 10 - - - - HC1 - - - Qt::AlignCenter - - - - - + + 250 @@ -329,8 +253,8 @@ - - + + 250 @@ -379,10 +303,10 @@ - 10 - 360 - 251 - 171 + 670 + 20 + 291 + 151 @@ -400,9 +324,9 @@ - 20 - 40 - 211 + 30 + 20 + 231 121 @@ -425,20 +349,11 @@ 7 - - - - - 榛戜綋 - - - - 妫嬬洏灏哄(mm) - - - Qt::AlignCenter - - + + + + + @@ -456,11 +371,20 @@ - - - - - + + + + + 榛戜綋 + + + + 妫嬬洏灏哄(mm) + + + Qt::AlignCenter + + @@ -489,8 +413,8 @@ 10 30 - 491 - 301 + 640 + 512 @@ -502,10 +426,10 @@ - 10 - 10 - 471 - 281 + 0 + 0 + 640 + 512 @@ -526,8 +450,8 @@ 0 0 - 491 - 301 + 640 + 512 @@ -537,8 +461,8 @@ - 280 - 390 + 70 + 580 100 28 @@ -562,8 +486,8 @@ - 400 - 390 + 210 + 580 100 28 @@ -587,8 +511,8 @@ - 280 - 470 + 350 + 580 100 28 @@ -612,8 +536,8 @@ - 400 - 470 + 490 + 580 100 28 @@ -637,10 +561,10 @@ - 520 - 20 - 321 - 221 + 670 + 190 + 301 + 211 @@ -655,18 +579,20 @@ Qt::AlignCenter - - false - 10 20 - 301 - 191 + 281 + 181 + + + 9 + + @@ -674,7 +600,7 @@ - 390 + 460 20 81 16 @@ -695,10 +621,10 @@ - 80 + 180 40 - 701 - 411 + 640 + 512 @@ -709,8 +635,8 @@ 0 0 - 701 - 411 + 640 + 512 @@ -731,8 +657,8 @@ 0 0 - 701 - 411 + 640 + 512 @@ -742,8 +668,8 @@ - 620 - 480 + 710 + 580 93 31 @@ -760,8 +686,8 @@ - 730 - 480 + 840 + 580 93 31 @@ -778,8 +704,8 @@ - 470 - 480 + 520 + 580 111 31 @@ -796,9 +722,9 @@ - 160 - 480 - 294 + 170 + 580 + 331 31 @@ -806,8 +732,8 @@ - 40 - 480 + 50 + 580 111 30 @@ -836,10 +762,10 @@ - 650 - 60 - 201 - 171 + 780 + 70 + 191 + 191 @@ -860,8 +786,8 @@ 90 - 80 - 91 + 90 + 81 22 @@ -873,7 +799,7 @@ 10 - 80 + 90 61 16 @@ -886,7 +812,7 @@ 10 - 40 + 50 61 16 @@ -898,8 +824,8 @@ - 80 - 117 + 70 + 130 51 21 @@ -911,8 +837,8 @@ - 140 - 117 + 130 + 130 51 21 @@ -925,7 +851,7 @@ 10 - 120 + 130 51 16 @@ -938,7 +864,7 @@ 90 - 30 + 40 51 31 @@ -951,8 +877,8 @@ - 690 - 310 + 800 + 330 131 28 @@ -969,8 +895,8 @@ - 690 - 380 + 800 + 400 131 28 @@ -987,8 +913,8 @@ - 690 - 450 + 800 + 470 131 28 @@ -1020,11 +946,33 @@ 10 10 - 631 - 521 + 741 + 621 + + + + 310 + 310 + 131 + 51 + + + + + 榛戜綋 + 11 + + + + color: rgb(255, 255, 255); + + + Loading... + + @@ -1033,7 +981,7 @@ 0 -10 241 - 571 + 671 @@ -1174,15 +1122,6 @@ - - - - 0 - 0 - 0 - - - @@ -1320,15 +1259,6 @@ - - - - 0 - 0 - 0 - - - @@ -1466,15 +1396,6 @@ - - - - 0 - 0 - 0 - - - @@ -1521,7 +1442,7 @@ 20 - 150 + 290 201 91 @@ -1546,7 +1467,7 @@ 10 - 250 + 390 221 241 @@ -1630,7 +1551,7 @@ 0 0 - 1110 + 1240 26