修复了点云滤波时,因为内存泄露可能导致的bug,(重新编译了PCL)
parent
7bd8cf83c0
commit
24b84cbd18
|
|
@ -216,8 +216,8 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+56"/>
|
<location line="+56"/>
|
||||||
<source>Canvas %1mm * %2mm </source>
|
<source>Canvas %1m * %2m </source>
|
||||||
<translation>画布 %1mm * %2mm </translation>
|
<translation>画布 %1m * %2m </translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* @file main.cpp
|
* @file main.cpp
|
||||||
* @brief LAMPCAE程序入口文件
|
* @brief LAMPCAE程序入口文件
|
||||||
* @author LAMPCAE研发小组(LAMPCAE@diso.cn)
|
|
||||||
* @version 2.5.0
|
|
||||||
* @date 2022-02-13 15:34
|
|
||||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
|
||||||
*
|
|
||||||
* ============================================================================
|
* ============================================================================
|
||||||
* Program: LAMPCAE
|
|
||||||
*
|
|
||||||
* Copyright (c) 青岛数智船海科技有限公司 Since 2020 All rights reserved.
|
|
||||||
* See License or http://www.LAMPCAE.com/ for details.
|
|
||||||
*
|
|
||||||
* BSD 3-Clause License
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED.
|
|
||||||
* ==================================================================================
|
|
||||||
*/
|
*/
|
||||||
#include "CommandLine.h"
|
#include "CommandLine.h"
|
||||||
#include "LAMPCAEVersionMacros.h"
|
#include "LAMPCAEVersionMacros.h"
|
||||||
|
|
|
||||||
|
|
@ -1429,7 +1429,7 @@ namespace GUI {
|
||||||
_graphRange = new QLabel(this);
|
_graphRange = new QLabel(this);
|
||||||
_ui->statusbar->addPermanentWidget(_graphRange);
|
_ui->statusbar->addPermanentWidget(_graphRange);
|
||||||
}
|
}
|
||||||
QString text = QString(tr("Canvas %1mm * %2mm ")).arg(w).arg(h);
|
QString text = QString(tr("Canvas %1m * %2m ")).arg(w).arg(h);
|
||||||
|
|
||||||
_graphRange->setText(text);
|
_graphRange->setText(text);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,11 +94,8 @@ add_library(PluginMeshDataExchange
|
||||||
${_interface}
|
${_interface}
|
||||||
${_header}
|
${_header}
|
||||||
${_source}
|
${_source}
|
||||||
Dialogmeshsurfacesampling.cpp
|
|
||||||
Dialogmeshsurfacesampling.h
|
|
||||||
Dialogmeshsurfacesampling.ui
|
|
||||||
../PointCloudOperator/MeshSurfaceSamplingAlg.cpp
|
|
||||||
../PointCloudOperator/MeshSurfaceSamplingAlg.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,27 +14,24 @@
|
||||||
#include "ui_DialogMeshSurfaceSampling.h"
|
#include "ui_DialogMeshSurfaceSampling.h"
|
||||||
|
|
||||||
namespace MainWidget {
|
namespace MainWidget {
|
||||||
|
DialogMeshSurfaceSampling::DialogMeshSurfaceSampling(GUI::MainWindow* parent) : QFDialog(parent),
|
||||||
|
_ui(new Ui::DialogMeshSurfaceSampling), _mw(parent), _selectdlg(new DialogSelectComponents(parent)) {
|
||||||
|
|
||||||
|
|
||||||
// DialogMeshSurfaceSampling::DialogMeshSurfaceSampling(GUI::MainWindow* parent) : QFDialog(parent),
|
}
|
||||||
// _ui(new Ui::DialogMeshSurfaceSampling), _mw(parent), _selectdlg(new DialogSelectComponents(parent)) {
|
DialogMeshSurfaceSampling::~DialogMeshSurfaceSampling()
|
||||||
//
|
{
|
||||||
//
|
delete _ui;
|
||||||
//
|
_ui = NULL;
|
||||||
// }
|
delete _selectdlg;
|
||||||
// DialogMeshSurfaceSampling::~DialogMeshSurfaceSampling()
|
_selectdlg = NULL;
|
||||||
// {
|
}
|
||||||
// delete _ui;
|
|
||||||
// _ui = NULL;
|
void DialogMeshSurfaceSampling::removeCurrentItem(QListWidgetItem* curItem) {}
|
||||||
// delete _selectdlg;
|
void DialogMeshSurfaceSampling::accept()
|
||||||
// _selectdlg = NULL;
|
{
|
||||||
// }
|
QDialog::accept();
|
||||||
//
|
}
|
||||||
// void DialogMeshSurfaceSampling::removeCurrentItem(QListWidgetItem* curItem) {}
|
void DialogMeshSurfaceSampling::selectedComponentsSlot(QList<MeshData::MeshSet*> components) {}
|
||||||
// void DialogMeshSurfaceSampling::accept()
|
void DialogMeshSurfaceSampling::customContextMenuRequestedSlot(const QPoint& point) {}
|
||||||
// {
|
|
||||||
// QDialog::accept();
|
|
||||||
// }
|
|
||||||
// void DialogMeshSurfaceSampling::selectedComponentsSlot(QList<MeshData::MeshSet*> components) {}
|
|
||||||
// void DialogMeshSurfaceSampling::customContextMenuRequestedSlot(const QPoint& point) {}
|
|
||||||
} // namespace MeshSurfaceSampling
|
} // namespace MeshSurfaceSampling
|
||||||
|
|
|
||||||
|
|
@ -12,42 +12,47 @@
|
||||||
#include "meshDataExchangePluginAPI.h"
|
#include "meshDataExchangePluginAPI.h"
|
||||||
#include "SelfDefObject/QFDialog.h"
|
#include "SelfDefObject/QFDialog.h"
|
||||||
#include "MeshData/meshSet.h"
|
#include "MeshData/meshSet.h"
|
||||||
|
#include "MainWidgets/DialogVTKTransform.h"
|
||||||
|
#include "MainWindow/MainWindow.h"
|
||||||
|
#include "MainWindow/SubWindowManager.h"
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QListWidgetItem>
|
#include <QListWidgetItem>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace MainWidget {
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class DialogMeshSurfaceSampling;
|
class DialogMeshSurfaceSampling;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class DialogSelectComponents;
|
||||||
|
|
||||||
namespace MainWidget {
|
|
||||||
// class DialogSelectComponents;
|
class MESHDATAEXCHANGEPLUGINAPI DialogMeshSurfaceSampling : public QFDialog {
|
||||||
//
|
Q_OBJECT
|
||||||
//
|
|
||||||
// class MESHDATAEXCHANGEPLUGINAPI DialogMeshSurfaceSampling : public QFDialog {
|
public:
|
||||||
// Q_OBJECT
|
DialogMeshSurfaceSampling(GUI::MainWindow* parent);
|
||||||
//
|
~DialogMeshSurfaceSampling() ;
|
||||||
// public:
|
private:
|
||||||
// DialogMeshSurfaceSampling(GUI::MainWindow* parent);
|
void removeCurrentItem(QListWidgetItem* curItem);
|
||||||
// ~DialogMeshSurfaceSampling() ;
|
signals: // 这里采用信号来直接与 主界面通信,避免参数浪费
|
||||||
// private:
|
private slots:
|
||||||
// void removeCurrentItem(QListWidgetItem* curItem);
|
|
||||||
// signals: // 这里采用信号来直接与 主界面通信,避免参数浪费
|
virtual void accept();
|
||||||
// private slots:
|
void selectedComponentsSlot(QList<MeshData::MeshSet*> components);
|
||||||
//
|
void customContextMenuRequestedSlot(const QPoint& point);
|
||||||
// virtual void accept();
|
|
||||||
// void selectedComponentsSlot(QList<MeshData::MeshSet*> components);
|
private:
|
||||||
// void customContextMenuRequestedSlot(const QPoint& point);
|
GUI::MainWindow* _mw;
|
||||||
//
|
DialogSelectComponents* _selectdlg;
|
||||||
// private:
|
QList<MeshData::MeshSet*> _components;
|
||||||
// GUI::MainWindow* _mw;
|
|
||||||
// DialogSelectComponents* _selectdlg;
|
private:
|
||||||
// QList<MeshData::MeshSet*> _components;
|
Ui::DialogMeshSurfaceSampling* _ui;
|
||||||
//
|
};
|
||||||
// private:
|
|
||||||
// Ui::DialogMeshSurfaceSampling* _ui;
|
|
||||||
// };
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,124 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>MeshSurfaceSampling::DialogMeshSurfaceSampling</class>
|
<class>MainWidget::DialogMeshSurfaceSampling</class>
|
||||||
<widget class="QDialog" name="MeshSurfaceSampling::DialogMeshSurfaceSampling">
|
<widget class="QDialog" name="MainWidget::DialogMeshSurfaceSampling">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>622</width>
|
||||||
<height>300</height>
|
<height>374</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>DialogMeshSurfaceSampling</string>
|
<string>DialogMeshSurfaceSampling</string>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QGroupBox" name="groupBox_4">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>357</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>600</width>
|
||||||
|
<height>300</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Selected Component</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
|
<item row="0" column="0" rowspan="2">
|
||||||
|
<widget class="QListWidget" name="listWidget">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>299</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>550</width>
|
||||||
|
<height>500</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QPushButton" name="geoSelectPoint">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string extracomment="Clicked Button Selected Components"/>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../qrc/qianfan.qrc">
|
||||||
|
<normaloff>:/QUI/geometry/selectface.png</normaloff>:/QUI/geometry/selectface.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>8</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QDialogButtonBox" name="btBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../qrc/qianfan.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,9 @@ WBFZ::PCLBilateralFilter::PCLBilateralFilter(const QString& fileName,
|
||||||
}
|
}
|
||||||
bool WBFZ::PCLBilateralFilter::filter()
|
bool WBFZ::PCLBilateralFilter::filter()
|
||||||
{
|
{
|
||||||
return PCLBilateralFilterAlg( _componentIds, _sigmaR, _sigmaS);
|
bool flag=PCLBilateralFilterAlg( _componentIds, _sigmaR, _sigmaS);
|
||||||
|
qDebug("WBFZ::PCLBilateralFilter::filter finish !!");
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
bool WBFZ::PCLBilateralFilter::PCLBilateralFilterAlg(QString componentIds, double sigmaR,
|
bool WBFZ::PCLBilateralFilter::PCLBilateralFilterAlg(QString componentIds, double sigmaR,
|
||||||
double sigmaS)
|
double sigmaS)
|
||||||
|
|
@ -238,7 +240,7 @@ bool WBFZ::PCLBilateralFilter::PCLBilateralFilterAlg(QString componentIds, doubl
|
||||||
cellToPointFilter->Update();
|
cellToPointFilter->Update();
|
||||||
DebugInfo("cellToPointFilter ");
|
DebugInfo("cellToPointFilter ");
|
||||||
// 获取过滤后的 vtkPolyData
|
// 获取过滤后的 vtkPolyData
|
||||||
vtkPolyData* outpolyData = cellToPointFilter->GetOutput();
|
vtkSmartPointer<vtkPolyData> outpolyData = cellToPointFilter->GetOutput();
|
||||||
DebugInfo("outpolyData ");
|
DebugInfo("outpolyData ");
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -253,19 +255,25 @@ bool WBFZ::PCLBilateralFilter::PCLBilateralFilterAlg(QString componentIds, doubl
|
||||||
fbf.setSigmaR(sigmaR);
|
fbf.setSigmaR(sigmaR);
|
||||||
fbf.filter(*cloud_filtered);
|
fbf.filter(*cloud_filtered);
|
||||||
|
|
||||||
|
DebugInfo("Set up the Convolution Filter \n ");
|
||||||
// 转换处理结果
|
// 转换处理结果
|
||||||
vtkPolyData* polydata=nullptr;
|
vtkSmartPointer<vtkPolyData> polydata=vtkSmartPointer<vtkPolyData>::New();
|
||||||
polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
|
// polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
|
||||||
pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
|
pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
|
||||||
vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
vtkSmartPointer<vtkDataSet> dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
||||||
size_t pointCount = dataset->GetNumberOfPoints();
|
size_t pointCount = dataset->GetNumberOfPoints();
|
||||||
|
DebugInfo("vtkpolydata --> vtkdataset \n ");
|
||||||
if(pointCount==0){
|
if(pointCount==0){
|
||||||
|
//outpolyData->Delete(); // 释放指针
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLBilateralFilterAlg successfully!! Point Count : "+QString::number(pointCount));
|
|
||||||
outpolyData->Delete(); // 释放指针
|
|
||||||
|
|
||||||
return this->saveFilterResultFile(cloud_filtered);
|
emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg successfully!! Point Count : "+QString::number(pointCount));
|
||||||
|
//outpolyData->Delete(); // 释放指针
|
||||||
|
|
||||||
|
qDebug()<<"WBFZ::PCLGuassFilter::PCLGuassFilterAlg finish !!!";
|
||||||
|
bool saveflag=this->saveFilterResultFile(cloud_filtered);
|
||||||
|
qDebug()<<"saveFilterResultFile finish !!!";
|
||||||
|
return saveflag;
|
||||||
}
|
}
|
||||||
WBFZ::PCLBilateralFilter::~PCLBilateralFilter() {}
|
WBFZ::PCLBilateralFilter::~PCLBilateralFilter() {}
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,9 @@ WBFZ::PCLGuassFilter::PCLGuassFilter(const QString& fileName, WBFZ::PointCloudOp
|
||||||
}
|
}
|
||||||
bool WBFZ::PCLGuassFilter::filter()
|
bool WBFZ::PCLGuassFilter::filter()
|
||||||
{
|
{
|
||||||
return PointCloudThreadBase::filter();
|
bool flag=this->PCLGuassFilterAlg(_componentIds,_sigma,_threshold,_radius);
|
||||||
|
qDebug("WBFZ::PCLGuassFilter::filter over!!!!");
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
bool WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma,
|
bool WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma,
|
||||||
double threshold,double radius)
|
double threshold,double radius)
|
||||||
|
|
@ -227,21 +229,21 @@ bool WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma,
|
||||||
QString outfilename;
|
QString outfilename;
|
||||||
for(QString compontId : qCompontIds) {
|
for(QString compontId : qCompontIds) {
|
||||||
meshSet = meshData->getMeshSetByID(compontId.toInt());
|
meshSet = meshData->getMeshSetByID(compontId.toInt());
|
||||||
DebugInfo("point count %d : %d ",compontId.toInt(),meshSet==nullptr);
|
DebugInfo("point count %d : %d \n",compontId.toInt(),meshSet==nullptr);
|
||||||
if(!meshSet)
|
if(!meshSet)
|
||||||
continue;
|
continue;
|
||||||
outfilename=meshSet->getName();
|
outfilename=meshSet->getName();
|
||||||
vtkPolyData* temppolyData=PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
|
vtkPolyData* temppolyData=PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
|
||||||
cellToPointFilter->SetInputData(temppolyData);
|
cellToPointFilter->SetInputData(temppolyData);
|
||||||
DebugInfo("point count %d : %d ",compontId.toInt(),temppolyData==nullptr);
|
DebugInfo("point count %d : %d \n",compontId.toInt(),temppolyData==nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行过滤操作
|
// 执行过滤操作
|
||||||
cellToPointFilter->Update();
|
cellToPointFilter->Update();
|
||||||
DebugInfo("cellToPointFilter ");
|
DebugInfo("cellToPointFilter \n");
|
||||||
// 获取过滤后的 vtkPolyData
|
// 获取过滤后的 vtkPolyData
|
||||||
vtkPolyData* outpolyData = cellToPointFilter->GetOutput();
|
vtkPolyData* outpolyData = cellToPointFilter->GetOutput();
|
||||||
DebugInfo("outpolyData ");
|
DebugInfo("outpolyData \n");
|
||||||
|
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_with_rgba(new pcl::PointCloud<pcl::PointXYZRGBA>);
|
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_with_rgba(new pcl::PointCloud<pcl::PointXYZRGBA>);
|
||||||
|
|
@ -264,7 +266,7 @@ bool WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma,
|
||||||
new pcl::search::KdTree<pcl::PointXYZRGBA>);
|
new pcl::search::KdTree<pcl::PointXYZRGBA>);
|
||||||
(*kdtree).setInputCloud(cloud_with_rgba);
|
(*kdtree).setInputCloud(cloud_with_rgba);
|
||||||
emit _mainwindow->printMessage(Common::Message::Normal,"KdTree made" );
|
emit _mainwindow->printMessage(Common::Message::Normal,"KdTree made" );
|
||||||
|
DebugInfo("KdTree made \n");
|
||||||
// Set up the Convolution Filter
|
// Set up the Convolution Filter
|
||||||
pcl::filters::Convolution3D<
|
pcl::filters::Convolution3D<
|
||||||
pcl::PointXYZRGBA,
|
pcl::PointXYZRGBA,
|
||||||
|
|
@ -281,21 +283,25 @@ bool WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma,
|
||||||
convolution.convolve(*cloud_filtered);
|
convolution.convolve(*cloud_filtered);
|
||||||
emit _mainwindow->printMessage(Common::Message::Normal,"Convoluted" );
|
emit _mainwindow->printMessage(Common::Message::Normal,"Convoluted" );
|
||||||
|
|
||||||
|
DebugInfo("Set up the Convolution Filter \n ");
|
||||||
|
|
||||||
// 转换处理结果
|
// 转换处理结果
|
||||||
vtkPolyData* polydata=nullptr;
|
vtkSmartPointer<vtkPolyData> polydata=vtkSmartPointer<vtkPolyData>::New();
|
||||||
polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
|
// polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
|
||||||
pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
|
pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
|
||||||
vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
vtkSmartPointer<vtkDataSet> dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
||||||
size_t pointCount = dataset->GetNumberOfPoints();
|
size_t pointCount = dataset->GetNumberOfPoints();
|
||||||
|
DebugInfo("vtkpolydata --> vtkdataset \n ");
|
||||||
if(pointCount==0){
|
if(pointCount==0){
|
||||||
|
//outpolyData->Delete(); // 释放指针
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg successfully!! Point Count : "+QString::number(pointCount));
|
emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg successfully!! Point Count : "+QString::number(pointCount));
|
||||||
outpolyData->Delete(); // 释放指针
|
//outpolyData->Delete(); // 释放指针
|
||||||
|
|
||||||
return this->saveFilterResultFile(cloud_filtered);
|
qDebug()<<"WBFZ::PCLGuassFilter::PCLGuassFilterAlg finish !!!";
|
||||||
|
bool saveflag=this->saveFilterResultFile(cloud_filtered);
|
||||||
|
qDebug()<<"saveFilterResultFile finish !!!";
|
||||||
|
return saveflag;
|
||||||
}
|
}
|
||||||
WBFZ::PCLGuassFilter::~PCLGuassFilter() {}
|
WBFZ::PCLGuassFilter::~PCLGuassFilter() {}
|
||||||
|
|
|
||||||
|
|
@ -252,23 +252,34 @@ namespace WBFZ{
|
||||||
sor.setMinNeighborsInRadius(MinNeighborsInRadius); //设置判断是否为离群点的阈值
|
sor.setMinNeighborsInRadius(MinNeighborsInRadius); //设置判断是否为离群点的阈值
|
||||||
sor.filter(*cloud_filtered); //将滤波结果保存在cloud_filtered中
|
sor.filter(*cloud_filtered); //将滤波结果保存在cloud_filtered中
|
||||||
|
|
||||||
|
|
||||||
|
DebugInfo("Set up the Convolution Filter \n ");
|
||||||
// 转换处理结果
|
// 转换处理结果
|
||||||
vtkPolyData* polydata=nullptr;
|
vtkSmartPointer<vtkPolyData> polydata=vtkSmartPointer<vtkPolyData>::New();
|
||||||
polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
|
// polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
|
||||||
pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
|
pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
|
||||||
vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
vtkSmartPointer<vtkDataSet> dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
||||||
size_t pointCount = dataset->GetNumberOfPoints();
|
size_t pointCount = dataset->GetNumberOfPoints();
|
||||||
|
DebugInfo("vtkpolydata --> vtkdataset \n ");
|
||||||
if(pointCount==0){
|
if(pointCount==0){
|
||||||
|
//outpolyData->Delete(); // 释放指针
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLRadiusOutlierRemovalAlg successfully!! Point Count : "+QString::number(pointCount));
|
emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg successfully!! Point Count : "+QString::number(pointCount));
|
||||||
outpolyData->Delete(); // 释放指针
|
//outpolyData->Delete(); // 释放指针
|
||||||
return this->saveFilterResultFile(cloud_filtered);
|
|
||||||
|
qDebug()<<"WBFZ::PCLGuassFilter::PCLGuassFilterAlg finish !!!";
|
||||||
|
bool saveflag=this->saveFilterResultFile(cloud_filtered);
|
||||||
|
qDebug()<<"saveFilterResultFile finish !!!";
|
||||||
|
return saveflag;
|
||||||
}
|
}
|
||||||
bool PCLRadiusOutlierRemoval::filter()
|
bool PCLRadiusOutlierRemoval::filter()
|
||||||
{
|
{
|
||||||
return PCLRadiusOutlierRemovalAlg( _componentIds, _RadiusSearch,_MinNeighborsInRadius);
|
bool flag = PCLRadiusOutlierRemovalAlg(_componentIds, _RadiusSearch, _MinNeighborsInRadius);
|
||||||
|
|
||||||
|
qDebug() << "PCLRadiusOutlierRemoval::filter finish!!!";
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
PCLRadiusOutlierRemoval::~PCLRadiusOutlierRemoval() {}
|
PCLRadiusOutlierRemoval::~PCLRadiusOutlierRemoval() {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,24 +253,33 @@ namespace WBFZ{
|
||||||
sor.setStddevMulThresh(StddevThresh); //设置判断是否为离群点的阈值
|
sor.setStddevMulThresh(StddevThresh); //设置判断是否为离群点的阈值
|
||||||
sor.filter(*cloud_filtered); //将滤波结果保存在cloud_filtered中
|
sor.filter(*cloud_filtered); //将滤波结果保存在cloud_filtered中
|
||||||
|
|
||||||
|
|
||||||
|
DebugInfo("Set up the Convolution Filter \n ");
|
||||||
// 转换处理结果
|
// 转换处理结果
|
||||||
vtkPolyData* polydata=nullptr;
|
vtkSmartPointer<vtkPolyData> polydata=vtkSmartPointer<vtkPolyData>::New();
|
||||||
polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
|
// polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
|
||||||
pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
|
pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
|
||||||
vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
vtkSmartPointer<vtkDataSet> dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
||||||
size_t pointCount = dataset->GetNumberOfPoints();
|
size_t pointCount = dataset->GetNumberOfPoints();
|
||||||
|
DebugInfo("vtkpolydata --> vtkdataset \n ");
|
||||||
if(pointCount==0){
|
if(pointCount==0){
|
||||||
|
//outpolyData->Delete(); // 释放指针
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLStatisticalRemoveFilterAlg successfully!! Point Count : "+QString::number(pointCount));
|
emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg successfully!! Point Count : "+QString::number(pointCount));
|
||||||
outpolyData->Delete(); // 释放指针
|
//outpolyData->Delete(); // 释放指针
|
||||||
|
|
||||||
return this->saveFilterResultFile(cloud_filtered);
|
qDebug()<<"WBFZ::PCLGuassFilter::PCLGuassFilterAlg finish !!!";
|
||||||
|
bool saveflag=this->saveFilterResultFile(cloud_filtered);
|
||||||
|
qDebug()<<"saveFilterResultFile finish !!!";
|
||||||
|
return saveflag;
|
||||||
}
|
}
|
||||||
bool PCLStatisticalRemoveFilter::filter()
|
bool PCLStatisticalRemoveFilter::filter()
|
||||||
{
|
{
|
||||||
return PCLStatisticalRemoveFilterAlg( _componentIds, _MeanK,_StddevThresh);
|
bool flag = PCLStatisticalRemoveFilterAlg(_componentIds, _MeanK, _StddevThresh);
|
||||||
|
qDebug()<<"PCLStatisticalRemoveFilter::filter finish !!!";
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
PCLStatisticalRemoveFilter::~PCLStatisticalRemoveFilter() {}
|
PCLStatisticalRemoveFilter::~PCLStatisticalRemoveFilter() {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ namespace WBFZ{
|
||||||
QString _componentIds;
|
QString _componentIds;
|
||||||
double _MeanK;
|
double _MeanK;
|
||||||
double _StddevThresh;
|
double _StddevThresh;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace WBFZ
|
||||||
information = QString("Successful Import Mesh From \"%1\"").arg(_fileName);
|
information = QString("Successful Import Mesh From \"%1\"").arg(_fileName);
|
||||||
msg.type = Common::Message::Normal;
|
msg.type = Common::Message::Normal;
|
||||||
msg.message = information;
|
msg.message = information;
|
||||||
|
qDebug()<<"PointCloudThreadBase::defaultMeshFinished()";
|
||||||
QFileInfo info(_fileName);
|
QFileInfo info(_fileName);
|
||||||
QString name = info.fileName();
|
QString name = info.fileName();
|
||||||
QString path = info.filePath();
|
QString path = info.filePath();
|
||||||
|
|
@ -69,7 +69,7 @@ namespace WBFZ
|
||||||
msg.message = information;
|
msg.message = information;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
qDebug()<<"emit sign to windows ";
|
||||||
// auto meshdata = MeshData::MeshData::getInstance();
|
// auto meshdata = MeshData::MeshData::getInstance();
|
||||||
// // meshdata->generateDisplayDataSet();
|
// // meshdata->generateDisplayDataSet();
|
||||||
// const int nk = meshdata->getKernalCount();
|
// const int nk = meshdata->getKernalCount();
|
||||||
|
|
@ -88,6 +88,7 @@ namespace WBFZ
|
||||||
}else{}
|
}else{}
|
||||||
emit showInformation(information);
|
emit showInformation(information);
|
||||||
emit _mainwindow->printMessageToMessageWindow(msg);
|
emit _mainwindow->printMessageToMessageWindow(msg);
|
||||||
|
qDebug()<<"filter thread overing !!! ";
|
||||||
}
|
}
|
||||||
// emit showInformation(information);
|
// emit showInformation(information);
|
||||||
// emit _mainwindow->printMessageToMessageWindow(msg);
|
// emit _mainwindow->printMessageToMessageWindow(msg);
|
||||||
|
|
@ -197,5 +198,4 @@ namespace WBFZ
|
||||||
else{}
|
else{}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -863,27 +863,6 @@ void FEKOResultImportTaskNode::getExcuteTaskResult(FEKOResultImport* obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
// FEKOImageSettingTaskNodeClass
|
// FEKOImageSettingTaskNodeClass
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -232,8 +232,8 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+56"/>
|
<location line="+56"/>
|
||||||
<source>Canvas %1mm * %2mm </source>
|
<source>Canvas %1m * %2m </source>
|
||||||
<translation>画布 %1mm * %2mm </translation>
|
<translation>画布 %1m * %2m </translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue