ui 0.12 点云颜色修改功能完成,help界面更新,loading界面去边框
This commit is contained in:
@@ -4,10 +4,10 @@ Help::Help(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
// QTextCodec *codec = QTextCodec::codecForName("utf-8"); //不起作用
|
||||
// QTextCodec::setCodecForLocale(codec);
|
||||
ui.textBrowser->setText(QString::fromUtf8("help")); // 暂时不能写显示中文
|
||||
QPixmap *pixmap = new QPixmap(":/Reconstruction/image/reconstruction/help.png");
|
||||
pixmap->scaled(ui.label->size(), Qt::KeepAspectRatio);
|
||||
ui.label->setScaledContents(true);
|
||||
ui.label->setPixmap(*pixmap);
|
||||
}
|
||||
|
||||
Help::~Help()
|
||||
|
||||
@@ -5,7 +5,7 @@ Loading::Loading(QWidget *parent)
|
||||
{
|
||||
|
||||
setStyle();
|
||||
|
||||
setWindowFlags(Qt::FramelessWindowHint);
|
||||
ui.label_2->hide();
|
||||
// ui.progressBar->setValue(0);
|
||||
// QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect;
|
||||
|
||||
@@ -89,7 +89,7 @@ void Reconstruction::on_pushButton_2_clicked()
|
||||
void Reconstruction::on_pushButton_3_clicked()
|
||||
{
|
||||
ui.stackedWidget->setCurrentIndex(2);
|
||||
updateQVTK(cloud);
|
||||
updateQVTK(cloud, color);
|
||||
if(loadingStatus)
|
||||
{
|
||||
ui.label_9->setVisible(true);
|
||||
@@ -106,9 +106,9 @@ void Reconstruction::setCloud()
|
||||
ui.label_9->setVisible(false);
|
||||
loadingStatus = false;
|
||||
cloud = t->getCloud();
|
||||
updateQVTK(cloud);
|
||||
updateQVTK(cloud, color);
|
||||
}
|
||||
void Reconstruction::updateQVTK(PointCloud<PointXYZRGB> cloud)
|
||||
void Reconstruction::updateQVTK(PointCloud<PointXYZRGB> cloud, QColor color)
|
||||
{
|
||||
boost::shared_ptr<visualization::PCLVisualizer> viewer(new visualization::PCLVisualizer("3D Viewer"));
|
||||
viewer->setBackgroundColor(0.458, 0.529, 0.844);
|
||||
@@ -117,7 +117,12 @@ void Reconstruction::updateQVTK(PointCloud<PointXYZRGB> cloud)
|
||||
{
|
||||
PointCloud<PointXYZRGB>::Ptr cloudPtr(new PointCloud<PointXYZRGB>);
|
||||
cloudPtr = cloud.makeShared();
|
||||
viewer->addPointCloud(cloudPtr, "cloud");
|
||||
|
||||
int x = int(color.redF() * 255);
|
||||
int y = int(color.greenF() * 255);
|
||||
int z = int(color.blueF() * 255);
|
||||
visualization::PointCloudColorHandlerCustom<PointXYZRGB> cloud_color(cloudPtr, x, y, z);// 统一处理点云颜色
|
||||
viewer->addPointCloud(cloudPtr, cloud_color, "cloud");
|
||||
viewer->setPointCloudRenderingProperties(visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud");
|
||||
}
|
||||
ui.qvtkWidget->SetRenderWindow(viewer->getRenderWindow());
|
||||
@@ -353,10 +358,10 @@ void Reconstruction::on_pushButton_15_clicked()
|
||||
// 颜色选取
|
||||
void Reconstruction::on_pushButton_16_clicked()
|
||||
{
|
||||
color = QColorDialog::getColor(Qt::black);
|
||||
if (color.isValid()){
|
||||
// qDebug("x:%f, %f, %f",color.redF(), color.greenF(), color.blueF());
|
||||
// todo 颜色选取框已选择颜色color,接下来对color进行处理
|
||||
QColor colortmp = QColorDialog::getColor(Qt::black);
|
||||
if (colortmp.isValid()){
|
||||
color = colortmp;
|
||||
updateQVTK(cloud, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
void setStyle();
|
||||
void setPicStyle();
|
||||
void setButtonStyle();
|
||||
void updateQVTK(PointCloud<PointXYZRGB> cloud);
|
||||
void updateQVTK(PointCloud<PointXYZRGB> cloud, QColor color);
|
||||
|
||||
private slots:
|
||||
void on_pushButton_clicked();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<RCC>
|
||||
<qresource prefix="/Reconstruction">
|
||||
<file>image/loading/loading.png</file>
|
||||
<file>image/reconstruction/help.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/icon">
|
||||
<file>image/common/3D.png</file>
|
||||
|
||||
BIN
Resources/image/reconstruction/help.png
Normal file
BIN
Resources/image/reconstruction/help.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
35
UI/Help.ui
35
UI/Help.ui
@@ -6,22 +6,43 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>601</width>
|
||||
<height>411</height>
|
||||
<width>1000</width>
|
||||
<height>500</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>1000</width>
|
||||
<height>500</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>1000</width>
|
||||
<height>500</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>581</width>
|
||||
<height>391</height>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1001</width>
|
||||
<height>501</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
|
||||
@@ -6,10 +6,28 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>858</width>
|
||||
<height>485</height>
|
||||
<width>860</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>860</width>
|
||||
<height>480</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>860</width>
|
||||
<height>480</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Loading</string>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user