Skip to content

Commit

Permalink
Merge pull request #3122 from SunBlack/modernize-use-using_kdtree_key…
Browse files Browse the repository at this point in the history
…points_octree

Use using instead of typedef [kdtree, keypoints, octree]
  • Loading branch information
taketwo authored Jun 13, 2019
2 parents 4e7244b + 249b5b8 commit 308138a
Show file tree
Hide file tree
Showing 29 changed files with 230 additions and 230 deletions.
20 changes: 10 additions & 10 deletions kdtree/include/pcl/kdtree/kdtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ namespace pcl
class KdTree
{
public:
typedef boost::shared_ptr <std::vector<int> > IndicesPtr;
typedef boost::shared_ptr <const std::vector<int> > IndicesConstPtr;
using IndicesPtr = boost::shared_ptr<std::vector<int> >;
using IndicesConstPtr = boost::shared_ptr<const std::vector<int> >;

typedef pcl::PointCloud<PointT> PointCloud;
typedef boost::shared_ptr<PointCloud> PointCloudPtr;
typedef boost::shared_ptr<const PointCloud> PointCloudConstPtr;
using PointCloud = pcl::PointCloud<PointT>;
using PointCloudPtr = boost::shared_ptr<PointCloud>;
using PointCloudConstPtr = boost::shared_ptr<const PointCloud>;

typedef pcl::PointRepresentation<PointT> PointRepresentation;
//typedef boost::shared_ptr<PointRepresentation> PointRepresentationPtr;
typedef boost::shared_ptr<const PointRepresentation> PointRepresentationConstPtr;
using PointRepresentation = pcl::PointRepresentation<PointT>;
//using PointRepresentationPtr = boost::shared_ptr<PointRepresentation>;
using PointRepresentationConstPtr = boost::shared_ptr<const PointRepresentation>;

// Boost shared pointers
typedef boost::shared_ptr<KdTree<PointT> > Ptr;
typedef boost::shared_ptr<const KdTree<PointT> > ConstPtr;
using Ptr = boost::shared_ptr<KdTree<PointT> >;
using ConstPtr = boost::shared_ptr<const KdTree<PointT> >;

/** \brief Empty constructor for KdTree. Sets some internal values to their defaults.
* \param[in] sorted set to true if the application that the tree will be used for requires sorted nearest neighbor indices (default). False otherwise.
Expand Down
14 changes: 7 additions & 7 deletions kdtree/include/pcl/kdtree/kdtree_flann.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ namespace pcl
using KdTree<PointT>::nearestKSearch;
using KdTree<PointT>::radiusSearch;

typedef typename KdTree<PointT>::PointCloud PointCloud;
typedef typename KdTree<PointT>::PointCloudConstPtr PointCloudConstPtr;
using PointCloud = typename KdTree<PointT>::PointCloud;
using PointCloudConstPtr = typename KdTree<PointT>::PointCloudConstPtr;

typedef boost::shared_ptr<std::vector<int> > IndicesPtr;
typedef boost::shared_ptr<const std::vector<int> > IndicesConstPtr;
using IndicesPtr = boost::shared_ptr<std::vector<int> >;
using IndicesConstPtr = boost::shared_ptr<const std::vector<int> >;

typedef ::flann::Index<Dist> FLANNIndex;
using FLANNIndex = ::flann::Index<Dist>;

// Boost shared pointers
typedef boost::shared_ptr<KdTreeFLANN<PointT, Dist> > Ptr;
typedef boost::shared_ptr<const KdTreeFLANN<PointT, Dist> > ConstPtr;
using Ptr = boost::shared_ptr<KdTreeFLANN<PointT, Dist> >;
using ConstPtr = boost::shared_ptr<const KdTreeFLANN<PointT, Dist> >;

/** \brief Default Constructor for KdTreeFLANN.
* \param[in] sorted set to true if the application that the tree will be used for requires sorted nearest neighbor indices (default). False otherwise.
Expand Down
28 changes: 14 additions & 14 deletions keypoints/include/pcl/keypoints/agast_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ namespace pcl
class PCL_EXPORTS AbstractAgastDetector
{
public:
typedef boost::shared_ptr<AbstractAgastDetector> Ptr;
typedef boost::shared_ptr<const AbstractAgastDetector> ConstPtr;
using Ptr = boost::shared_ptr<AbstractAgastDetector>;
using ConstPtr = boost::shared_ptr<const AbstractAgastDetector>;

/** \brief Constructor.
* \param[in] width the width of the image to process
Expand Down Expand Up @@ -265,8 +265,8 @@ namespace pcl
class PCL_EXPORTS AgastDetector7_12s : public AbstractAgastDetector
{
public:
typedef boost::shared_ptr<AgastDetector7_12s> Ptr;
typedef boost::shared_ptr<const AgastDetector7_12s> ConstPtr;
using Ptr = boost::shared_ptr<AgastDetector7_12s>;
using ConstPtr = boost::shared_ptr<const AgastDetector7_12s>;

/** \brief Constructor.
* \param[in] width the width of the image to process
Expand Down Expand Up @@ -336,8 +336,8 @@ namespace pcl
class PCL_EXPORTS AgastDetector5_8 : public AbstractAgastDetector
{
public:
typedef boost::shared_ptr<AgastDetector5_8> Ptr;
typedef boost::shared_ptr<const AgastDetector5_8> ConstPtr;
using Ptr = boost::shared_ptr<AgastDetector5_8>;
using ConstPtr = boost::shared_ptr<const AgastDetector5_8>;

/** \brief Constructor.
* \param[in] width the width of the image to process
Expand Down Expand Up @@ -407,8 +407,8 @@ namespace pcl
class PCL_EXPORTS OastDetector9_16 : public AbstractAgastDetector
{
public:
typedef boost::shared_ptr<OastDetector9_16> Ptr;
typedef boost::shared_ptr<const OastDetector9_16> ConstPtr;
using Ptr = boost::shared_ptr<OastDetector9_16>;
using ConstPtr = boost::shared_ptr<const OastDetector9_16>;

/** \brief Constructor.
* \param[in] width the width of the image to process
Expand Down Expand Up @@ -555,12 +555,12 @@ namespace pcl
class AgastKeypoint2DBase : public Keypoint<PointInT, PointOutT>
{
public:
typedef typename Keypoint<PointInT, PointOutT>::PointCloudIn PointCloudIn;
typedef typename Keypoint<PointInT, PointOutT>::PointCloudOut PointCloudOut;
typedef typename Keypoint<PointInT, PointOutT>::KdTree KdTree;
typedef typename PointCloudIn::ConstPtr PointCloudInConstPtr;
using PointCloudIn = typename Keypoint<PointInT, PointOutT>::PointCloudIn;
using PointCloudOut = typename Keypoint<PointInT, PointOutT>::PointCloudOut;
using KdTree = typename Keypoint<PointInT, PointOutT>::KdTree;
using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;

typedef pcl::keypoints::agast::AbstractAgastDetector::Ptr AgastDetectorPtr;
using AgastDetectorPtr = pcl::keypoints::agast::AbstractAgastDetector::Ptr;

using Keypoint<PointInT, PointOutT>::name_;
using Keypoint<PointInT, PointOutT>::input_;
Expand Down Expand Up @@ -718,7 +718,7 @@ namespace pcl
class AgastKeypoint2D : public AgastKeypoint2DBase<PointInT, PointOutT, pcl::common::IntensityFieldAccessor<PointInT> >
{
public:
typedef typename Keypoint<PointInT, PointOutT>::PointCloudOut PointCloudOut;
using PointCloudOut = typename Keypoint<PointInT, PointOutT>::PointCloudOut;

using Keypoint<PointInT, PointOutT>::name_;
using Keypoint<PointInT, PointOutT>::input_;
Expand Down
12 changes: 6 additions & 6 deletions keypoints/include/pcl/keypoints/brisk_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ namespace pcl
class BriskKeypoint2D: public Keypoint<PointInT, PointOutT>
{
public:
typedef boost::shared_ptr<BriskKeypoint2D<PointInT, PointOutT, IntensityT> > Ptr;
typedef boost::shared_ptr<const BriskKeypoint2D<PointInT, PointOutT, IntensityT> > ConstPtr;
using Ptr = boost::shared_ptr<BriskKeypoint2D<PointInT, PointOutT, IntensityT> >;
using ConstPtr = boost::shared_ptr<const BriskKeypoint2D<PointInT, PointOutT, IntensityT> >;

typedef typename Keypoint<PointInT, PointOutT>::PointCloudIn PointCloudIn;
typedef typename Keypoint<PointInT, PointOutT>::PointCloudOut PointCloudOut;
typedef typename Keypoint<PointInT, PointOutT>::KdTree KdTree;
typedef typename PointCloudIn::ConstPtr PointCloudInConstPtr;
using PointCloudIn = typename Keypoint<PointInT, PointOutT>::PointCloudIn;
using PointCloudOut = typename Keypoint<PointInT, PointOutT>::PointCloudOut;
using KdTree = typename Keypoint<PointInT, PointOutT>::KdTree;
using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;

using Keypoint<PointInT, PointOutT>::name_;
using Keypoint<PointInT, PointOutT>::input_;
Expand Down
14 changes: 7 additions & 7 deletions keypoints/include/pcl/keypoints/harris_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ namespace pcl
class HarrisKeypoint2D : public Keypoint<PointInT, PointOutT>
{
public:
typedef boost::shared_ptr<HarrisKeypoint2D<PointInT, PointOutT, IntensityT> > Ptr;
typedef boost::shared_ptr<const HarrisKeypoint2D<PointInT, PointOutT, IntensityT> > ConstPtr;
using Ptr = boost::shared_ptr<HarrisKeypoint2D<PointInT, PointOutT, IntensityT> >;
using ConstPtr = boost::shared_ptr<const HarrisKeypoint2D<PointInT, PointOutT, IntensityT> >;

typedef typename Keypoint<PointInT, PointOutT>::PointCloudIn PointCloudIn;
typedef typename Keypoint<PointInT, PointOutT>::PointCloudOut PointCloudOut;
typedef typename Keypoint<PointInT, PointOutT>::KdTree KdTree;
typedef typename PointCloudIn::ConstPtr PointCloudInConstPtr;
using PointCloudIn = typename Keypoint<PointInT, PointOutT>::PointCloudIn;
using PointCloudOut = typename Keypoint<PointInT, PointOutT>::PointCloudOut;
using KdTree = typename Keypoint<PointInT, PointOutT>::KdTree;
using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;

using Keypoint<PointInT, PointOutT>::name_;
using Keypoint<PointInT, PointOutT>::input_;
using Keypoint<PointInT, PointOutT>::indices_;
using Keypoint<PointInT, PointOutT>::keypoints_indices_;

typedef enum {HARRIS = 1, NOBLE, LOWE, TOMASI} ResponseMethod;
enum ResponseMethod {HARRIS = 1, NOBLE, LOWE, TOMASI};

/** \brief Constructor
* \param[in] method the method to be used to determine the corner responses
Expand Down
20 changes: 10 additions & 10 deletions keypoints/include/pcl/keypoints/harris_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ namespace pcl
class HarrisKeypoint3D : public Keypoint<PointInT, PointOutT>
{
public:
typedef boost::shared_ptr<HarrisKeypoint3D<PointInT, PointOutT, NormalT> > Ptr;
typedef boost::shared_ptr<const HarrisKeypoint3D<PointInT, PointOutT, NormalT> > ConstPtr;
using Ptr = boost::shared_ptr<HarrisKeypoint3D<PointInT, PointOutT, NormalT> >;
using ConstPtr = boost::shared_ptr<const HarrisKeypoint3D<PointInT, PointOutT, NormalT> >;

typedef typename Keypoint<PointInT, PointOutT>::PointCloudIn PointCloudIn;
typedef typename Keypoint<PointInT, PointOutT>::PointCloudOut PointCloudOut;
typedef typename Keypoint<PointInT, PointOutT>::KdTree KdTree;
typedef typename PointCloudIn::ConstPtr PointCloudInConstPtr;
using PointCloudIn = typename Keypoint<PointInT, PointOutT>::PointCloudIn;
using PointCloudOut = typename Keypoint<PointInT, PointOutT>::PointCloudOut;
using KdTree = typename Keypoint<PointInT, PointOutT>::KdTree;
using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;

typedef pcl::PointCloud<NormalT> PointCloudN;
typedef typename PointCloudN::Ptr PointCloudNPtr;
typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
using PointCloudN = pcl::PointCloud<NormalT>;
using PointCloudNPtr = typename PointCloudN::Ptr;
using PointCloudNConstPtr = typename PointCloudN::ConstPtr;

using Keypoint<PointInT, PointOutT>::name_;
using Keypoint<PointInT, PointOutT>::input_;
Expand All @@ -75,7 +75,7 @@ namespace pcl
using Keypoint<PointInT, PointOutT>::initCompute;
using PCLBase<PointInT>::setInputCloud;

typedef enum {HARRIS = 1, NOBLE, LOWE, TOMASI, CURVATURE} ResponseMethod;
enum ResponseMethod {HARRIS = 1, NOBLE, LOWE, TOMASI, CURVATURE};

/** \brief Constructor
* \param[in] method the method to be used to determine the corner responses
Expand Down
12 changes: 6 additions & 6 deletions keypoints/include/pcl/keypoints/harris_6d.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ namespace pcl
class HarrisKeypoint6D : public Keypoint<PointInT, PointOutT>
{
public:
typedef boost::shared_ptr<HarrisKeypoint6D<PointInT, PointOutT, NormalT> > Ptr;
typedef boost::shared_ptr<const HarrisKeypoint6D<PointInT, PointOutT, NormalT> > ConstPtr;
using Ptr = boost::shared_ptr<HarrisKeypoint6D<PointInT, PointOutT, NormalT> >;
using ConstPtr = boost::shared_ptr<const HarrisKeypoint6D<PointInT, PointOutT, NormalT> >;

typedef typename Keypoint<PointInT, PointOutT>::PointCloudIn PointCloudIn;
typedef typename Keypoint<PointInT, PointOutT>::PointCloudOut PointCloudOut;
typedef typename Keypoint<PointInT, PointOutT>::KdTree KdTree;
typedef typename PointCloudIn::ConstPtr PointCloudInConstPtr;
using PointCloudIn = typename Keypoint<PointInT, PointOutT>::PointCloudIn;
using PointCloudOut = typename Keypoint<PointInT, PointOutT>::PointCloudOut;
using KdTree = typename Keypoint<PointInT, PointOutT>::KdTree;
using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;

using Keypoint<PointInT, PointOutT>::name_;
using Keypoint<PointInT, PointOutT>::input_;
Expand Down
18 changes: 9 additions & 9 deletions keypoints/include/pcl/keypoints/iss_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ namespace pcl
class ISSKeypoint3D : public Keypoint<PointInT, PointOutT>
{
public:
typedef boost::shared_ptr<ISSKeypoint3D<PointInT, PointOutT, NormalT> > Ptr;
typedef boost::shared_ptr<const ISSKeypoint3D<PointInT, PointOutT, NormalT> > ConstPtr;
using Ptr = boost::shared_ptr<ISSKeypoint3D<PointInT, PointOutT, NormalT> >;
using ConstPtr = boost::shared_ptr<const ISSKeypoint3D<PointInT, PointOutT, NormalT> >;

typedef typename Keypoint<PointInT, PointOutT>::PointCloudIn PointCloudIn;
typedef typename Keypoint<PointInT, PointOutT>::PointCloudOut PointCloudOut;
using PointCloudIn = typename Keypoint<PointInT, PointOutT>::PointCloudIn;
using PointCloudOut = typename Keypoint<PointInT, PointOutT>::PointCloudOut;

typedef pcl::PointCloud<NormalT> PointCloudN;
typedef typename PointCloudN::Ptr PointCloudNPtr;
typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
using PointCloudN = pcl::PointCloud<NormalT>;
using PointCloudNPtr = typename PointCloudN::Ptr;
using PointCloudNConstPtr = typename PointCloudN::ConstPtr;

typedef pcl::octree::OctreePointCloudSearch<PointInT> OctreeSearchIn;
typedef typename OctreeSearchIn::Ptr OctreeSearchInPtr;
using OctreeSearchIn = pcl::octree::OctreePointCloudSearch<PointInT>;
using OctreeSearchInPtr = typename OctreeSearchIn::Ptr;

using Keypoint<PointInT, PointOutT>::name_;
using Keypoint<PointInT, PointOutT>::input_;
Expand Down
22 changes: 11 additions & 11 deletions keypoints/include/pcl/keypoints/keypoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@ namespace pcl
class Keypoint : public PCLBase<PointInT>
{
public:
typedef boost::shared_ptr<Keypoint<PointInT, PointOutT> > Ptr;
typedef boost::shared_ptr<const Keypoint<PointInT, PointOutT> > ConstPtr;
using Ptr = boost::shared_ptr<Keypoint<PointInT, PointOutT> >;
using ConstPtr = boost::shared_ptr<const Keypoint<PointInT, PointOutT> >;

using PCLBase<PointInT>::indices_;
using PCLBase<PointInT>::input_;

typedef PCLBase<PointInT> BaseClass;
typedef pcl::search::Search<PointInT> KdTree;
typedef typename KdTree::Ptr KdTreePtr;
typedef pcl::PointCloud<PointInT> PointCloudIn;
typedef typename PointCloudIn::Ptr PointCloudInPtr;
typedef typename PointCloudIn::ConstPtr PointCloudInConstPtr;
typedef pcl::PointCloud<PointOutT> PointCloudOut;
typedef std::function<int (int, double, std::vector<int> &, std::vector<float> &)> SearchMethod;
typedef std::function<int (const PointCloudIn &cloud, int index, double, std::vector<int> &, std::vector<float> &)> SearchMethodSurface;
using BaseClass = PCLBase<PointInT>;
using KdTree = pcl::search::Search<PointInT>;
using KdTreePtr = typename KdTree::Ptr;
using PointCloudIn = pcl::PointCloud<PointInT>;
using PointCloudInPtr = typename PointCloudIn::Ptr;
using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;
using PointCloudOut = pcl::PointCloud<PointOutT>;
using SearchMethod = std::function<int (int, double, std::vector<int> &, std::vector<float> &)>;
using SearchMethodSurface = std::function<int (const PointCloudIn &cloud, int index, double, std::vector<int> &, std::vector<float> &)>;

public:
/** \brief Empty constructor. */
Expand Down
8 changes: 4 additions & 4 deletions keypoints/include/pcl/keypoints/narf_keypoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ class RangeImageBorderExtractor;
class PCL_EXPORTS NarfKeypoint : public Keypoint<PointWithRange, int>
{
public:
typedef boost::shared_ptr<NarfKeypoint> Ptr;
typedef boost::shared_ptr<const NarfKeypoint> ConstPtr;
using Ptr = boost::shared_ptr<NarfKeypoint>;
using ConstPtr = boost::shared_ptr<const NarfKeypoint>;

// =====TYPEDEFS=====
typedef Keypoint<PointWithRange, int> BaseClass;
using BaseClass = Keypoint<PointWithRange, int>;

typedef Keypoint<PointWithRange, int>::PointCloudOut PointCloudOut;
using PointCloudOut = Keypoint<PointWithRange, int>::PointCloudOut;

// =====PUBLIC STRUCTS=====
//! Parameters used in this class
Expand Down
10 changes: 5 additions & 5 deletions keypoints/include/pcl/keypoints/sift_keypoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ namespace pcl
class SIFTKeypoint : public Keypoint<PointInT, PointOutT>
{
public:
typedef boost::shared_ptr<SIFTKeypoint<PointInT, PointOutT> > Ptr;
typedef boost::shared_ptr<const SIFTKeypoint<PointInT, PointOutT> > ConstPtr;
using Ptr = boost::shared_ptr<SIFTKeypoint<PointInT, PointOutT> >;
using ConstPtr = boost::shared_ptr<const SIFTKeypoint<PointInT, PointOutT> >;

typedef typename Keypoint<PointInT, PointOutT>::PointCloudIn PointCloudIn;
typedef typename Keypoint<PointInT, PointOutT>::PointCloudOut PointCloudOut;
typedef typename Keypoint<PointInT, PointOutT>::KdTree KdTree;
using PointCloudIn = typename Keypoint<PointInT, PointOutT>::PointCloudIn;
using PointCloudOut = typename Keypoint<PointInT, PointOutT>::PointCloudOut;
using KdTree = typename Keypoint<PointInT, PointOutT>::KdTree;

using Keypoint<PointInT, PointOutT>::name_;
using Keypoint<PointInT, PointOutT>::input_;
Expand Down
16 changes: 8 additions & 8 deletions keypoints/include/pcl/keypoints/smoothed_surfaces_keypoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@ namespace pcl
class SmoothedSurfacesKeypoint : public Keypoint <PointT, PointT>
{
public:
typedef boost::shared_ptr<SmoothedSurfacesKeypoint<PointT, PointNT> > Ptr;
typedef boost::shared_ptr<const SmoothedSurfacesKeypoint<PointT, PointNT> > ConstPtr;
using Ptr = boost::shared_ptr<SmoothedSurfacesKeypoint<PointT, PointNT> >;
using ConstPtr = boost::shared_ptr<const SmoothedSurfacesKeypoint<PointT, PointNT> >;

using PCLBase<PointT>::input_;
using Keypoint<PointT, PointT>::name_;
using Keypoint<PointT, PointT>::tree_;
using Keypoint<PointT, PointT>::keypoints_indices_;
using Keypoint<PointT, PointT>::initCompute;

typedef pcl::PointCloud<PointT> PointCloudT;
typedef typename PointCloudT::ConstPtr PointCloudTConstPtr;
typedef pcl::PointCloud<PointNT> PointCloudNT;
typedef typename PointCloudNT::ConstPtr PointCloudNTConstPtr;
typedef typename PointCloudT::Ptr PointCloudTPtr;
typedef typename Keypoint<PointT, PointT>::KdTreePtr KdTreePtr;
using PointCloudT = pcl::PointCloud<PointT>;
using PointCloudTConstPtr = typename PointCloudT::ConstPtr;
using PointCloudNT = pcl::PointCloud<PointNT>;
using PointCloudNTConstPtr = typename PointCloudNT::ConstPtr;
using PointCloudTPtr = typename PointCloudT::Ptr;
using KdTreePtr = typename Keypoint<PointT, PointT>::KdTreePtr;

SmoothedSurfacesKeypoint ()
: Keypoint<PointT, PointT> (),
Expand Down
Loading

0 comments on commit 308138a

Please sign in to comment.