Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From new to pcl::make_shared using clang-tidy #3206

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8913082
apps: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
1e4f25a
common: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
a2000ed
examples: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
62337b2
filters: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
53733f6
io: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
cb27660
keypoints: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
6a8ef83
outofcore: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
3946e1f
people: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
5d3da10
recognition: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
baa4275
registration: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
a9afd0b
search: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
502fe5f
segmentation: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
5b7153e
simulation: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
65ea25a
surface: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
bd7e25e
test: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
c559213
tools: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
f0a1cd7
tracking: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
e949c49
visualization: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <pcl/features/shot.h>
#include <pcl/io/pcd_io.h>

#include <pcl/make_shared.h>

namespace pcl
{
namespace rec_3d_framework
Expand Down Expand Up @@ -60,7 +62,7 @@ namespace pcl
mls.setUpsamplingStepSize (0.001);
}

normals.reset (new pcl::PointCloud<pcl::Normal>);
normals = pcl::make_shared<pcl::PointCloud<pcl::Normal>> ();
{
pcl::ScopeTime t ("Compute normals");
normal_estimator_->estimate (in, processed, normals);
Expand All @@ -73,7 +75,7 @@ namespace pcl
mls.process(*filtered);

processed.reset(new pcl::PointCloud<PointInT>);
normals.reset (new pcl::PointCloud<pcl::Normal>);
normals = pcl::make_shared<pcl::PointCloud<pcl::Normal>> ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line above this one should also be replaced no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PointInT is a template parameter, I didn't test for that and apparently the check is failing with those. As is, I also have a failing test for when there is typedef boost::shared_ptr<Derived> Ptr;

{
pcl::ScopeTime t ("Compute normals after MLS");
filtered->is_dense = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <pcl/features/shot_omp.h>
#include <pcl/io/pcd_io.h>

#include <pcl/make_shared.h>

namespace pcl
{
namespace rec_3d_framework
Expand Down Expand Up @@ -63,7 +65,7 @@ namespace pcl
mls.setUpsamplingStepSize (0.001);
}

normals.reset (new pcl::PointCloud<pcl::Normal>);
normals = pcl::make_shared<pcl::PointCloud<pcl::Normal>> ();
{
pcl::ScopeTime t ("Compute normals");
normal_estimator_->estimate (in, processed, normals);
Expand All @@ -77,7 +79,7 @@ namespace pcl
mls.process (*filtered);

processed.reset (new pcl::PointCloud<PointInT>);
normals.reset (new pcl::PointCloud<pcl::Normal>);
normals = pcl::make_shared<pcl::PointCloud<pcl::Normal>> ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as before.

{
pcl::ScopeTime t ("Compute normals after MLS");
filtered->is_dense = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <random>

#include <pcl/make_shared.h>

#include <pcl/apps/3d_rec_framework/pipeline/global_nn_recognizer_crh.h>
#include <pcl/recognition/crh_alignment.h>
#include <pcl/registration/icp.h>
Expand Down Expand Up @@ -47,7 +49,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>
CRHPointCloud::Ptr & hist)
{

hist.reset (new CRHPointCloud);
hist = pcl::make_shared<CRHPointCloud> ();
std::stringstream dir;
std::string path = source_->getModelDescriptorDir (model, training_dir_, descr_name_);
dir << path << "/crh_" << view_id << "_" << d_id << ".pcd";
Expand Down Expand Up @@ -377,7 +379,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>
boost::shared_ptr < std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > > transforms_temp;

models_temp.reset (new std::vector<ModelT>);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use std::make_shared here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is replacement of every reset with make_shared our goal? Personally, I see reset-based code as more maintainable in a sense that it does not need to know whether the pointer is std or boost.

transforms_temp.reset (new std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> >);
transforms_temp = pcl::make_shared<std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> >> ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, you can't use pcl::make_shared here. Notice this object has a custom allocator but won't have the necessary trait in order for dispatching to work properly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case the custom allocator is for contained objects, not the vector itself. Therefore, default allocator is suitable for the vector. However, I'd invoke the same comment as above here, in my opinion no need to replace reset with make_shared.


for (size_t i = 0; i < models_->size (); i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
*/

#include <flann/flann.hpp>

#include <pcl/make_shared.h>
#include <pcl/apps/3d_rec_framework/pipeline/global_nn_recognizer_cvfh.h>
#include <pcl/registration/icp.h>
#include <pcl/common/time.h>
#include <pcl/registration/icp.h>
#include <pcl/visualization/pcl_visualizer.h>

template<template<class > class Distance, typename PointInT, typename FeatureT>
Expand Down Expand Up @@ -598,7 +600,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>
boost::shared_ptr < std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > > transforms_temp;

models_temp.reset (new std::vector<ModelT>);
transforms_temp.reset (new std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> >);
transforms_temp = pcl::make_shared<std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> >> ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here for line 602 and 603.


for (size_t i = 0; i < models_->size (); i++)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <flann/flann.hpp>

#include <pcl/make_shared.h>

#include <pcl/apps/3d_rec_framework/pipeline/local_recognizer.h>
#include <pcl/apps/3d_rec_framework/utils/vtk_model_sampling.h>
#include <pcl/registration/correspondence_rejection_sample_consensus.h>
Expand Down Expand Up @@ -430,7 +432,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>
boost::shared_ptr < std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > > transforms_temp;

models_temp.reset (new std::vector<ModelT>);
transforms_temp.reset (new std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> >);
transforms_temp = pcl::make_shared<std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> >> ();

for (size_t i = 0; i < models_->size (); i++)
{
Expand Down
10 changes: 6 additions & 4 deletions apps/3d_rec_framework/src/tools/global_classification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <pcl/apps/dominant_plane_segmentation.h>
#include <pcl/console/parse.h>

#include <pcl/make_shared.h>

template<template<class > class DistT, typename PointT, typename FeatureT>
void
segmentAndClassify (typename pcl::rec_3d_framework::GlobalNNPipeline<DistT, PointT, FeatureT> & global)
Expand Down Expand Up @@ -164,7 +166,7 @@ main (int argc, char ** argv)
cast_source = boost::static_pointer_cast<pcl::rec_3d_framework::MeshSource<pcl::PointXYZ> > (mesh_source);

boost::shared_ptr<pcl::rec_3d_framework::PreProcessorAndNormalEstimator<pcl::PointXYZ, pcl::Normal> > normal_estimator;
normal_estimator.reset (new pcl::rec_3d_framework::PreProcessorAndNormalEstimator<pcl::PointXYZ, pcl::Normal>);
normal_estimator = pcl::make_shared<pcl::rec_3d_framework::PreProcessorAndNormalEstimator<pcl::PointXYZ, pcl::Normal>> ();
normal_estimator->setCMR (true);
normal_estimator->setDoVoxelGrid (true);
normal_estimator->setRemoveOutliers (true);
Expand All @@ -173,7 +175,7 @@ main (int argc, char ** argv)
if (desc_name == "vfh")
{
boost::shared_ptr<pcl::rec_3d_framework::VFHEstimation<pcl::PointXYZ, pcl::VFHSignature308> > vfh_estimator;
vfh_estimator.reset (new pcl::rec_3d_framework::VFHEstimation<pcl::PointXYZ, pcl::VFHSignature308>);
vfh_estimator = pcl::make_shared<pcl::rec_3d_framework::VFHEstimation<pcl::PointXYZ, pcl::VFHSignature308>> ();
vfh_estimator->setNormalEstimator (normal_estimator);

boost::shared_ptr<pcl::rec_3d_framework::GlobalEstimator<pcl::PointXYZ, pcl::VFHSignature308> > cast_estimator;
Expand All @@ -193,7 +195,7 @@ main (int argc, char ** argv)
if (desc_name == "cvfh")
{
boost::shared_ptr<pcl::rec_3d_framework::CVFHEstimation<pcl::PointXYZ, pcl::VFHSignature308> > vfh_estimator;
vfh_estimator.reset (new pcl::rec_3d_framework::CVFHEstimation<pcl::PointXYZ, pcl::VFHSignature308>);
vfh_estimator = pcl::make_shared<pcl::rec_3d_framework::CVFHEstimation<pcl::PointXYZ, pcl::VFHSignature308>> ();
vfh_estimator->setNormalEstimator (normal_estimator);

boost::shared_ptr<pcl::rec_3d_framework::GlobalEstimator<pcl::PointXYZ, pcl::VFHSignature308> > cast_estimator;
Expand All @@ -213,7 +215,7 @@ main (int argc, char ** argv)
if (desc_name == "esf")
{
boost::shared_ptr<pcl::rec_3d_framework::ESFEstimation<pcl::PointXYZ, pcl::ESFSignature640> > estimator;
estimator.reset (new pcl::rec_3d_framework::ESFEstimation<pcl::PointXYZ, pcl::ESFSignature640>);
estimator = pcl::make_shared<pcl::rec_3d_framework::ESFEstimation<pcl::PointXYZ, pcl::ESFSignature640>> ();

boost::shared_ptr<pcl::rec_3d_framework::GlobalEstimator<pcl::PointXYZ, pcl::ESFSignature640> > cast_estimator;
cast_estimator = boost::dynamic_pointer_cast<pcl::rec_3d_framework::ESFEstimation<pcl::PointXYZ, pcl::ESFSignature640> > (estimator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <pcl/recognition/hv/hv_go.h>
#include <pcl/recognition/hv/greedy_verification.h>

#include <pcl/make_shared.h>

void
getScenesInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector<std::string> & relative_paths)
{
Expand Down Expand Up @@ -364,7 +366,7 @@ main (int argc, char ** argv)

//configure normal estimator
boost::shared_ptr<pcl::rec_3d_framework::PreProcessorAndNormalEstimator<pcl::PointXYZ, pcl::Normal> > normal_estimator;
normal_estimator.reset (new pcl::rec_3d_framework::PreProcessorAndNormalEstimator<pcl::PointXYZ, pcl::Normal>);
normal_estimator = pcl::make_shared<pcl::rec_3d_framework::PreProcessorAndNormalEstimator<pcl::PointXYZ, pcl::Normal>> ();
normal_estimator->setCMR (false);
normal_estimator->setDoVoxelGrid (true);
normal_estimator->setRemoveOutliers (true);
Expand Down Expand Up @@ -434,7 +436,7 @@ main (int argc, char ** argv)
if (desc_name == "shot")
{
boost::shared_ptr<pcl::rec_3d_framework::SHOTLocalEstimation<pcl::PointXYZ, pcl::Histogram<352> > > estimator;
estimator.reset (new pcl::rec_3d_framework::SHOTLocalEstimation<pcl::PointXYZ, pcl::Histogram<352> >);
estimator = pcl::make_shared<pcl::rec_3d_framework::SHOTLocalEstimation<pcl::PointXYZ, pcl::Histogram<352> >> ();
estimator->setNormalEstimator (normal_estimator);
estimator->addKeypointExtractor (keypoint_extractor);
estimator->setSupportRadius (0.04f);
Expand Down Expand Up @@ -465,7 +467,7 @@ main (int argc, char ** argv)
{
desc_name = std::string ("shot");
boost::shared_ptr<pcl::rec_3d_framework::SHOTLocalEstimationOMP<pcl::PointXYZ, pcl::Histogram<352> > > estimator;
estimator.reset (new pcl::rec_3d_framework::SHOTLocalEstimationOMP<pcl::PointXYZ, pcl::Histogram<352> >);
estimator = pcl::make_shared<pcl::rec_3d_framework::SHOTLocalEstimationOMP<pcl::PointXYZ, pcl::Histogram<352> >> ();
estimator->setNormalEstimator (normal_estimator);
estimator->addKeypointExtractor (keypoint_extractor);
//estimator->setSupportRadius (0.04f);
Expand Down Expand Up @@ -498,7 +500,7 @@ main (int argc, char ** argv)
if (desc_name == "fpfh")
{
boost::shared_ptr<pcl::rec_3d_framework::FPFHLocalEstimation<pcl::PointXYZ, pcl::FPFHSignature33> > estimator;
estimator.reset (new pcl::rec_3d_framework::FPFHLocalEstimation<pcl::PointXYZ, pcl::FPFHSignature33>);
estimator = pcl::make_shared<pcl::rec_3d_framework::FPFHLocalEstimation<pcl::PointXYZ, pcl::FPFHSignature33>> ();
estimator->setNormalEstimator (normal_estimator);
estimator->addKeypointExtractor (keypoint_extractor);
estimator->setSupportRadius (0.04f);
Expand Down
6 changes: 4 additions & 2 deletions apps/cloud_composer/src/cloud_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

#include <QDebug>

#include <pcl/make_shared.h>

#include <QVTKWidget.h>

pcl::cloud_composer::CloudView::CloudView (QWidget* parent)
: QWidget (parent)
{
vis_.reset (new pcl::visualization::PCLVisualizer ("", false));
vis_ = pcl::make_shared<pcl::visualization::PCLVisualizer> ("", false);
vis_->getInteractorStyle ()->setKeyboardModifier (pcl::visualization::INTERACTOR_KB_MOD_SHIFT);
//Create the QVTKWidget
qvtk_ = new QVTKWidget (this);
Expand All @@ -28,7 +30,7 @@ pcl::cloud_composer::CloudView::CloudView (ProjectModel* model, QWidget* parent)
: QWidget (parent)
{
model_ = model;
vis_.reset (new pcl::visualization::PCLVisualizer ("", false));
vis_ = pcl::make_shared<pcl::visualization::PCLVisualizer> ("", false);
// vis_->getInteractorStyle ()->setKeyboardModifier (pcl::visualization::INTERACTOR_KB_MOD_SHIFT);
//Create the QVTKWidget
qvtk_ = new QVTKWidget (this);
Expand Down
6 changes: 4 additions & 2 deletions apps/cloud_composer/src/items/cloud_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <QMessageBox>

#include <pcl/make_shared.h>

pcl::cloud_composer::CloudItem::CloudItem (QString name,
pcl::PCLPointCloud2::Ptr cloud_ptr,
const Eigen::Vector4f& origin,
Expand All @@ -31,9 +33,9 @@ pcl::cloud_composer::CloudItem::CloudItem (QString name,
this->setData (QVariant::fromValue (orientation_), ItemDataRole::ORIENTATION);

//Create a color and geometry handler for this cloud
color_handler_.reset (new pcl::visualization::PointCloudColorHandlerRGBField<pcl::PCLPointCloud2> (cloud_ptr));
color_handler_ = pcl::make_shared<pcl::visualization::PointCloudColorHandlerRGBField<pcl::PCLPointCloud2>> (cloud_ptr);
this->setData (QVariant::fromValue (color_handler_), ItemDataRole::COLOR_HANDLER);
geometry_handler_.reset (new pcl::visualization::PointCloudGeometryHandlerXYZ<pcl::PCLPointCloud2> (cloud_ptr));
geometry_handler_ = pcl::make_shared<pcl::visualization::PointCloudGeometryHandlerXYZ<pcl::PCLPointCloud2>> (cloud_ptr);
this->setData (QVariant::fromValue (geometry_handler_), ItemDataRole::GEOMETRY_HANDLER);

properties_->addCategory ("Core Properties");
Expand Down
4 changes: 3 additions & 1 deletion apps/cloud_composer/src/items/fpfh_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <QGridLayout>

#include <pcl/make_shared.h>

#include <QVTKWidget.h>

pcl::cloud_composer::FPFHItem::FPFHItem (QString name, pcl::PointCloud<pcl::FPFHSignature33>::Ptr fpfh_ptr, double radius)
Expand Down Expand Up @@ -39,7 +41,7 @@ pcl::cloud_composer::FPFHItem::getInspectorTabs ()
//Create the plotter and QVTKWidget if it doesn't exist
if (!plot_)
{
plot_.reset (new pcl::visualization::PCLPlotter);
plot_ = pcl::make_shared<pcl::visualization::PCLPlotter> ();
qvtk_ = new QVTKWidget ();
hist_page_ = new QWidget ();
QGridLayout *mainLayout = new QGridLayout (hist_page_);
Expand Down
10 changes: 6 additions & 4 deletions apps/in_hand_scanner/src/in_hand_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
#include <QPainter>
#include <QtConcurrent>

#include <pcl/make_shared.h>

#include <pcl/exceptions.h>
#include <pcl/common/time.h>
#include <pcl/common/transforms.h>
Expand Down Expand Up @@ -292,7 +294,7 @@ pcl::ihs::InHandScanner::newDataCallback (const CloudXYZRGBAConstPtr& cloud_in)
CloudXYZRGBNormalPtr cloud_discarded;
if (running_mode_ == RM_SHOW_MODEL)
{
cloud_data = CloudXYZRGBNormalPtr (new CloudXYZRGBNormal ());
cloud_data = pcl::make_shared<CloudXYZRGBNormal>();
}
else if (running_mode_ == RM_UNPROCESSED)
{
Expand Down Expand Up @@ -325,7 +327,7 @@ pcl::ihs::InHandScanner::newDataCallback (const CloudXYZRGBAConstPtr& cloud_in)
<< " - time reconstruct mesh : "
<< std::setw (8) << std::right << sw.getTime () << " ms\n";

cloud_data = CloudXYZRGBNormalPtr (new CloudXYZRGBNormal ());
cloud_data = pcl::make_shared<CloudXYZRGBNormal>();
++iteration_;
}
else
Expand Down Expand Up @@ -357,7 +359,7 @@ pcl::ihs::InHandScanner::newDataCallback (const CloudXYZRGBAConstPtr& cloud_in)
std::cerr << " - time mesh processing : "
<< std::setw (8) << std::right << sw.getTime () << " ms\n";

cloud_data = CloudXYZRGBNormalPtr (new CloudXYZRGBNormal ());
cloud_data = pcl::make_shared<CloudXYZRGBNormal>();
++iteration_;
}
}
Expand Down Expand Up @@ -470,7 +472,7 @@ pcl::ihs::InHandScanner::startGrabberImpl ()

try
{
grabber_ = GrabberPtr (new Grabber ());
grabber_ = pcl::make_shared<Grabber>();
}
catch (const pcl::PCLException& e)
{
Expand Down
8 changes: 5 additions & 3 deletions apps/in_hand_scanner/src/input_data_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include <pcl/features/integral_image_normal.h>
#include <pcl/apps/in_hand_scanner/boost.h>

#include <pcl/make_shared.h>

////////////////////////////////////////////////////////////////////////////////

pcl::ihs::InputDataProcessing::InputDataProcessing ()
Expand Down Expand Up @@ -93,8 +95,8 @@ pcl::ihs::InputDataProcessing::segment (const CloudXYZRGBAConstPtr& cloud_in,
return (false);
}

if (!cloud_out) cloud_out = CloudXYZRGBNormalPtr (new CloudXYZRGBNormal ());
if (!cloud_discarded) cloud_discarded = CloudXYZRGBNormalPtr (new CloudXYZRGBNormal ());
if (!cloud_out) cloud_out = pcl::make_shared<CloudXYZRGBNormal>();
if (!cloud_discarded) cloud_discarded = pcl::make_shared<CloudXYZRGBNormal>();

const unsigned int width = cloud_in->width;
const unsigned int height = cloud_in->height;
Expand Down Expand Up @@ -221,7 +223,7 @@ pcl::ihs::InputDataProcessing::calculateNormals (const CloudXYZRGBAConstPtr& clo
}

if (!cloud_out)
cloud_out = CloudXYZRGBNormalPtr (new CloudXYZRGBNormal ());
cloud_out = pcl::make_shared<CloudXYZRGBNormal>();

// Calculate the normals
CloudNormalsPtr cloud_normals (new CloudNormals ());
Expand Down
4 changes: 3 additions & 1 deletion apps/in_hand_scanner/src/integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include <vector>
#include <limits>

#include <pcl/make_shared.h>

#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/apps/in_hand_scanner/boost.h>
#include <pcl/apps/in_hand_scanner/visibility_confidence.h>
Expand Down Expand Up @@ -80,7 +82,7 @@ pcl::ihs::Integration::reconstructMesh (const CloudXYZRGBNormalConstPtr& cloud_d
const int width = static_cast <int> (cloud_data->width);
const int height = static_cast <int> (cloud_data->height);

if (!mesh_model) mesh_model = MeshPtr (new Mesh ());
if (!mesh_model) mesh_model = pcl::make_shared<Mesh>();

mesh_model->clear ();
mesh_model->reserveVertices (cloud_data->size ());
Expand Down
4 changes: 3 additions & 1 deletion apps/in_hand_scanner/src/offline_integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#include <QKeyEvent>
#include <QtConcurrent>

#include <pcl/make_shared.h>

#include <pcl/io/pcd_io.h>
#include <pcl/common/transforms.h>
#include <pcl/features/integral_image_normal.h>
Expand Down Expand Up @@ -256,7 +258,7 @@ pcl::ihs::OfflineIntegration::load (const std::string& filename,
{
if (!cloud)
{
cloud = CloudXYZRGBNormalPtr (new CloudXYZRGBNormal ());
cloud = pcl::make_shared<CloudXYZRGBNormal>();
}

// Load the cloud.
Expand Down
Loading