PointCloudLibrary/pcl

Can we have makeShared() for pcl::PolygonMesh?

Open

#2,752 建立於 2018年12月30日

在 GitHub 查看
 (6 留言) (0 反應) (0 負責人)C++ (4,506 fork)batch import
good first issuekind: todomodule: common

倉庫指標

Star
 (9,023 star)
PR 合併指標
 (平均合併 8天 7小時) (30 天內合併 3 個 PR)

描述

Your Environment

  • Operating System and version: Ubuntu 18.04
  • Compiler: GCC 7
  • PCL Version: Latest

Context

I was experimenting with pcl::MeshSmoothingLaplacianVTK and then I realize there isn't a makeShared() function of pcl::PolygonMesh. For example, for the usual pcl::PointCloud<pcl::PointXYZ> we can do something like below

pcl::PointCloud<pcl::PointXYZ> cld;

pcl::VoxelGrid<pcl::PointXYZ> vox;
vox.setInputCloud(cld.makeShared());
vox.filter(cld);

but I can't do the below

pcl::PolygonMesh mesh;

pcl::MeshSmoothingLaplacianVTK vtk;

vtk.setInputMesh(mesh.makeShared());
vtk.process(mesh);

eventually I figured out if I want to keep my variables as object based and avoid mixing and matching with pointers, the below seems to work

pcl::PolygonMesh mesh;

pcl::MeshSmoothingLaplacianVTK vtk;

vtk.setInputMesh(boost::make_shared<pcl::PolygonMesh>(mesh));
vtk.process(mesh);

I am wondering is there a reason there isn't a makeShared() function for pcl::PolygonMesh? Or is it simply someone need to submit a PR to add that functionality?

貢獻者指南