diff --git a/Classes/AboutDialog.cpp b/Classes/AboutDialog.cpp new file mode 100644 index 0000000..af36d04 --- /dev/null +++ b/Classes/AboutDialog.cpp @@ -0,0 +1,21 @@ +#include "AboutDialog.h" +#include +#include + +AboutDialog::AboutDialog(QWidget *parent) + : QDialog(parent), ui(new Ui::AboutDialog) +{ + ui->setupUi(this); + ui->textEdit->setReadOnly(true); + auto w = ui->label->width(); + auto h = ui->label->height(); + ui->label->setPixmap(QPixmap(":/Reconstruction/image/common/logo.png").scaled(w, h, Qt::KeepAspectRatio)); +} + +AboutDialog::~AboutDialog() +{ +} + +void AboutDialog::on_pushButton_clicked() { + QDialog::accept(); +} diff --git a/Classes/AboutDialog.h b/Classes/AboutDialog.h new file mode 100644 index 0000000..7e4c344 --- /dev/null +++ b/Classes/AboutDialog.h @@ -0,0 +1,23 @@ +#pragma once + +#include "ui_aboutdialog.h" +#include + +namespace Ui { + class AboutDialog; +} + +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + AboutDialog(QWidget *parent = Q_NULLPTR); + ~AboutDialog(); + +public slots: + void on_pushButton_clicked(); + +private: + Ui::AboutDialog *ui; +}; diff --git a/Classes/Reconstruction.cpp b/Classes/Reconstruction.cpp index be8e470..15f6255 100644 --- a/Classes/Reconstruction.cpp +++ b/Classes/Reconstruction.cpp @@ -61,6 +61,12 @@ Reconstruction::Reconstruction(QWidget* parent) #pragma region Style void Reconstruction::setStyle() { + QAction* aboutAction = ui.menuBar->addAction(tr("About"), this, SLOT(about())); + aboutAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_A)); + + QAction* quitAction = ui.menuBar->addAction(tr("Exit"), this, SLOT(close())); + quitAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q)); + this->setContentsMargins(0, 0, 0, 0); // this->setFixedSize(1240, 680); // ui.centralWidget->setGeometry(0, 40, 1240, 680); @@ -216,6 +222,7 @@ void Reconstruction::updateQVTK(PointCloud cloud, QColor color) { boost::shared_ptr viewer; visualization::Camera camera; + double size = 1; if (PointCloudData::getInstance() != nullptr) { auto pclData = PointCloudData::getInstance(); @@ -229,6 +236,7 @@ void Reconstruction::updateQVTK(PointCloud cloud, QColor color) if(location) { viewer->setCameraParameters(camera); + pclData->getViewer()->getPointCloudRenderingProperties(visualization::PCL_VISUALIZER_POINT_SIZE, size, "cloud"); }else { location = true; @@ -249,8 +257,7 @@ void Reconstruction::updateQVTK(PointCloud cloud, QColor color) pclData->setViewer(viewer); pclData->setUI(ui); } - double size = 1; - viewer->getPointCloudRenderingProperties(visualization::PCL_VISUALIZER_POINT_SIZE, size, "cloud"); + viewer->removeAllPointClouds(); if (cloud.size() != 0) { @@ -785,3 +792,13 @@ void Reconstruction::on_pushButton_18_clicked() } #pragma endregion + +void Reconstruction::about() +{ + AboutDialog* aboutDialog; + aboutDialog = new AboutDialog(this); + aboutDialog->setWindowFlags(Qt::Window); + aboutDialog->setWindowModality(Qt::ApplicationModal); + aboutDialog->setWindowTitle(QString::fromLocal8Bit("¹ØÓÚ")); + aboutDialog->show(); +} \ No newline at end of file diff --git a/Classes/Reconstruction.h b/Classes/Reconstruction.h index e38dbbc..4368df5 100644 --- a/Classes/Reconstruction.h +++ b/Classes/Reconstruction.h @@ -40,6 +40,7 @@ #include "QVTKWidget.h" #include "vtkRenderWindow.h" #include "Help.h" +#include "AboutDialog.h" #include #include @@ -122,4 +123,5 @@ private slots: void on_pushButton_19_clicked(); void setPicAction(QString action); void setCloud(); + void about(); }; \ No newline at end of file diff --git a/DialogButtonRight.ui b/DialogButtonRight.ui new file mode 100644 index 0000000..75b84d9 --- /dev/null +++ b/DialogButtonRight.ui @@ -0,0 +1,93 @@ + + + AboutDialog + + + + 0 + 0 + 407 + 300 + + + + Dialog + + + + true + + + + 13 + 16 + 271 + 271 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">结构光三维é‡å»ºè½¯ä»¶ V1.0</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;"> åŸºäºŽç›¸æœºå’Œç»“æž„å…‰æŠ•å½±ä»ªå®žçŽ°çš„ä¸‰ç»´é‡æž„软件。通过投影基于 DeBruijn åºåˆ—ç¼–ç çš„æ¡çº¹å›¾æ¡ˆï¼Œå¯¹æ•获的图片进行结构光解ç ï¼ŒèŽ·å¾—ç‰©ä½“çš„ä¸‰ç»´ç‚¹äº‘æ•°æ®å¹¶å¯è§†åŒ–展示。</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">ç‰ˆæƒæ‰€æœ‰ï¼šåŒ—京交通大学</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">17301138@bjtu.edu.cn</span></p></body></html> + + + + + + 300 + 220 + 93 + 28 + + + + 关闭 + + + + + + 300 + 60 + 91 + 91 + + + + + + + Resources/image/common/logo.png + + + true + + + + + + + closeButton + clicked() + AboutDialog + accept() + + + 351 + 38 + + + 233 + 29 + + + + + diff --git a/Reconstruction.vcxproj b/Reconstruction.vcxproj index c39b521..da952f2 100644 --- a/Reconstruction.vcxproj +++ b/Reconstruction.vcxproj @@ -94,12 +94,14 @@ + + @@ -151,6 +153,7 @@ + diff --git a/Reconstruction.vcxproj.filters b/Reconstruction.vcxproj.filters index d9b4141..54dc035 100644 --- a/Reconstruction.vcxproj.filters +++ b/Reconstruction.vcxproj.filters @@ -81,6 +81,9 @@ ui + + ui + @@ -212,6 +215,9 @@ src\scene\resultscene + + src\scene\common + @@ -226,6 +232,9 @@ src\scene\resultscene + + src\scene\common + diff --git a/Resources/Reconstruction.qrc b/Resources/Reconstruction.qrc index c46958c..887d7c2 100644 --- a/Resources/Reconstruction.qrc +++ b/Resources/Reconstruction.qrc @@ -2,6 +2,7 @@ image/loading/loading.png image/reconstruction/help.png + image/common/logo.png image/common/3D.png diff --git a/Resources/image/common/logo.png b/Resources/image/common/logo.png new file mode 100644 index 0000000..fe2f88d Binary files /dev/null and b/Resources/image/common/logo.png differ diff --git a/UI/AboutDialog.ui b/UI/AboutDialog.ui new file mode 100644 index 0000000..d5f9e16 --- /dev/null +++ b/UI/AboutDialog.ui @@ -0,0 +1,93 @@ + + + AboutDialog + + + + 0 + 0 + 407 + 300 + + + + Dialog + + + + true + + + + 13 + 16 + 271 + 271 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">结构光三维é‡å»ºè½¯ä»¶ V1.0</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;"> åŸºäºŽç›¸æœºå’Œç»“æž„å…‰æŠ•å½±ä»ªå®žçŽ°çš„ä¸‰ç»´é‡æž„软件。通过投影基于 DeBruijn åºåˆ—ç¼–ç çš„æ¡çº¹å›¾æ¡ˆï¼Œå¯¹æ•获的图片进行结构光解ç ï¼ŒèŽ·å¾—ç‰©ä½“çš„ä¸‰ç»´ç‚¹äº‘æ•°æ®å¹¶å¯è§†åŒ–展示。</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">ç‰ˆæƒæ‰€æœ‰ï¼šåŒ—京交通大学</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">17301138@bjtu.edu.cn</span></p></body></html> + + + + + + 300 + 220 + 93 + 28 + + + + 关闭 + + + + + + 300 + 60 + 91 + 91 + + + + + + + ../Resources/image/common/logo.png + + + true + + + + + + + closeButton + clicked() + AboutDialog + accept() + + + 351 + 38 + + + 233 + 29 + + + + + diff --git a/UI/Reconstruction.ui b/UI/Reconstruction.ui index 4f5029e..8d9b846 100644 --- a/UI/Reconstruction.ui +++ b/UI/Reconstruction.ui @@ -451,7 +451,7 @@ 0 0 640 - 512 + 511 @@ -588,7 +588,7 @@ 690 200 291 - 211 + 231 @@ -1709,6 +1709,7 @@ + @@ -1718,32 +1719,7 @@ 26 - - - - 黑体 - 8 - - - - 相机设置 - - - - - - 黑体 - 8 - - - - 关于 - - - - - camera