Skip to content

Commit

Permalink
Use Ptr type aliases instead of explicit boost::shared_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
taketwo committed Jun 10, 2019
1 parent b8cebaf commit 45128e1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion test/kdtree/test_kdtree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ TEST (PCL, KdTreeFLANN_setPointRepresentation)
}

// Find k nearest neighbors with a different point representation
boost::shared_ptr<MyPointRepresentationXY> ptrep (new MyPointRepresentationXY);
KdTreeFLANN<MyPoint>::PointRepresentationConstPtr ptrep (new MyPointRepresentationXY);
kdtree.setPointRepresentation (ptrep);
kdtree.nearestKSearch (p, k, k_indices, k_distances);
for (int i = 0; i < k; ++i)
Expand Down
2 changes: 1 addition & 1 deletion test/outofcore/test_outofcore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ TEST_F (OutofcoreTest, PointCloud2_Constructors)
test_cloud->points.push_back (tmp);
}

boost::shared_ptr<pcl::PCLPointCloud2> point_cloud (new pcl::PCLPointCloud2 ());
pcl::PCLPointCloud2::Ptr point_cloud (new pcl::PCLPointCloud2);

pcl::toPCLPointCloud2 (*test_cloud, *point_cloud);

Expand Down
2 changes: 1 addition & 1 deletion test/registration/test_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ TEST (PCL, IterativeClosestPoint_PointToPlane)

IterativeClosestPoint<PointT, PointT> reg;
using PointToPlane = registration::TransformationEstimationPointToPlane<PointT, PointT>;
boost::shared_ptr<PointToPlane> point_to_plane (new PointToPlane);
PointToPlane::Ptr point_to_plane (new PointToPlane);
reg.setTransformationEstimation (point_to_plane);
reg.setInputSource (src);
reg.setInputTarget (tgt);
Expand Down
32 changes: 16 additions & 16 deletions test/registration/test_registration_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ TEST (PCL, CorrespondenceEstimation)
CloudXYZConstPtr source (new CloudXYZ (cloud_source));
CloudXYZConstPtr target (new CloudXYZ (cloud_target));

boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences (new pcl::Correspondences);
pcl::registration::CorrespondenceEstimation<PointXYZ, PointXYZ> corr_est;
corr_est.setInputSource (source);
corr_est.setInputTarget (target);
Expand All @@ -104,7 +104,7 @@ TEST (PCL, CorrespondenceEstimationReciprocal)
CloudXYZConstPtr source (new CloudXYZ (cloud_source));
CloudXYZConstPtr target (new CloudXYZ (cloud_target));

boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences (new pcl::Correspondences);
pcl::registration::CorrespondenceEstimation<PointXYZ, PointXYZ> corr_est;
corr_est.setInputSource (source);
corr_est.setInputTarget (target);
Expand All @@ -129,13 +129,13 @@ TEST (PCL, CorrespondenceRejectorDistance)
CloudXYZConstPtr target (new CloudXYZ (cloud_target));

// re-do correspondence estimation
boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences (new pcl::Correspondences);
pcl::registration::CorrespondenceEstimation<PointXYZ, PointXYZ> corr_est;
corr_est.setInputSource (source);
corr_est.setInputTarget (target);
corr_est.determineCorrespondences (*correspondences);

boost::shared_ptr<pcl::Correspondences> correspondences_result_rej_dist (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences_result_rej_dist (new pcl::Correspondences);
pcl::registration::CorrespondenceRejectorDistance corr_rej_dist;
corr_rej_dist.setInputCorrespondences (correspondences);
corr_rej_dist.setMaximumDistance (rej_dist_max_dist);
Expand All @@ -160,13 +160,13 @@ TEST (PCL, CorrespondenceRejectorMedianDistance)
CloudXYZConstPtr target (new CloudXYZ (cloud_target));

// re-do correspondence estimation
boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences (new pcl::Correspondences);
pcl::registration::CorrespondenceEstimation<PointXYZ, PointXYZ> corr_est;
corr_est.setInputSource (source);
corr_est.setInputTarget (target);
corr_est.determineCorrespondences (*correspondences);

boost::shared_ptr<pcl::Correspondences> correspondences_result_rej_median_dist (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences_result_rej_median_dist (new pcl::Correspondences);
pcl::registration::CorrespondenceRejectorMedianDistance corr_rej_median_dist;
corr_rej_median_dist.setInputCorrespondences(correspondences);
corr_rej_median_dist.setMedianFactor (rej_median_factor);
Expand All @@ -193,13 +193,13 @@ TEST (PCL, CorrespondenceRejectorOneToOne)
CloudXYZConstPtr target (new CloudXYZ (cloud_target));

// re-do correspondence estimation
boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences (new pcl::Correspondences);
pcl::registration::CorrespondenceEstimation<PointXYZ, PointXYZ> corr_est;
corr_est.setInputSource (source);
corr_est.setInputTarget (target);
corr_est.determineCorrespondences (*correspondences);

boost::shared_ptr<pcl::Correspondences> correspondences_result_rej_one_to_one (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences_result_rej_one_to_one (new pcl::Correspondences);
pcl::registration::CorrespondenceRejectorOneToOne corr_rej_one_to_one;
corr_rej_one_to_one.setInputCorrespondences(correspondences);
corr_rej_one_to_one.getCorrespondences(*correspondences_result_rej_one_to_one);
Expand All @@ -223,14 +223,14 @@ TEST (PCL, CorrespondenceRejectorSampleConsensus)
CloudXYZConstPtr target (new CloudXYZ (cloud_target));

// re-do correspondence estimation
boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences (new pcl::Correspondences);
pcl::registration::CorrespondenceEstimation<PointXYZ, PointXYZ> corr_est;
corr_est.setInputSource (source);
corr_est.setInputTarget (target);
corr_est.determineCorrespondences (*correspondences);
EXPECT_EQ (int (correspondences->size ()), nr_original_correspondences);

boost::shared_ptr<pcl::Correspondences> correspondences_result_rej_sac (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences_result_rej_sac (new pcl::Correspondences);
pcl::registration::CorrespondenceRejectorSampleConsensus<PointXYZ> corr_rej_sac;
corr_rej_sac.setInputSource (source);
corr_rej_sac.setInputTarget (target);
Expand Down Expand Up @@ -264,7 +264,7 @@ TEST (PCL, CorrespondenceRejectorSurfaceNormal)
CloudXYZConstPtr target (new CloudXYZ (cloud_target));

// re-do correspondence estimation
boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences (new pcl::Correspondences);
pcl::registration::CorrespondenceEstimation<PointXYZ, PointXYZ> corr_est;
corr_est.setInputSource (source);
corr_est.setInputTarget (target);
Expand Down Expand Up @@ -295,7 +295,7 @@ TEST (PCL, CorrespondenceRejectorSurfaceNormal)
corr_rej_surf_norm.setInputNormals <PointXYZ, PointNormal> (source_normals);
corr_rej_surf_norm.setTargetNormals <PointXYZ, PointNormal> (target_normals);

boost::shared_ptr<pcl::Correspondences> correspondences_result_rej_surf_norm (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences_result_rej_surf_norm (new pcl::Correspondences);
corr_rej_surf_norm.setInputCorrespondences (correspondences);
corr_rej_surf_norm.setThreshold (0.5);

Expand All @@ -318,13 +318,13 @@ TEST (PCL, CorrespondenceRejectorTrimmed)
CloudXYZConstPtr target (new CloudXYZ (cloud_target));

// re-do correspondence estimation
boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences (new pcl::Correspondences);
pcl::registration::CorrespondenceEstimation<PointXYZ, PointXYZ> corr_est;
corr_est.setInputSource (source);
corr_est.setInputTarget (target);
corr_est.determineCorrespondences (*correspondences);

boost::shared_ptr<pcl::Correspondences> correspondences_result_rej_trimmed (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences_result_rej_trimmed (new pcl::Correspondences);
pcl::registration::CorrespondenceRejectorTrimmed corr_rej_trimmed;
corr_rej_trimmed.setOverlapRatio(rej_trimmed_overlap);
corr_rej_trimmed.setInputCorrespondences(correspondences);
Expand All @@ -349,13 +349,13 @@ TEST (PCL, CorrespondenceRejectorVarTrimmed)
CloudXYZConstPtr target (new CloudXYZ (cloud_target));

// re-do correspondence estimation
boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences (new pcl::Correspondences);
pcl::registration::CorrespondenceEstimation<PointXYZ, PointXYZ> corr_est;
corr_est.setInputSource (source);
corr_est.setInputTarget (target);
corr_est.determineCorrespondences (*correspondences);

boost::shared_ptr<pcl::Correspondences> correspondences_result_rej_var_trimmed_dist (new pcl::Correspondences);
pcl::CorrespondencesPtr correspondences_result_rej_var_trimmed_dist (new pcl::Correspondences);
pcl::registration::CorrespondenceRejectorVarTrimmed corr_rej_var_trimmed_dist;
corr_rej_var_trimmed_dist.setInputSource<PointXYZ> (source);
corr_rej_var_trimmed_dist.setInputTarget<PointXYZ> (target);
Expand Down

0 comments on commit 45128e1

Please sign in to comment.