Skip to content

Commit

Permalink
Part F of transition to support modernize-use-default-member-init (#5815
Browse files Browse the repository at this point in the history
)

* Part F of transition to support modernize-use-default-member-init

* Fixed clang-tidy complaint

* Made changes per inspection

* Fixed CI formatting complaints

* Fixed yet more CI formatting complaints

* Reverted 3rdparty files per review

* Reverted formatting per review

* Addressed review comments

* Reran clang-tidy after rebase

* Addressed further review comments

* Addressed latest issues flagged in review

* Fixed clang-format complaint

* Fixed omitted review item
  • Loading branch information
gnawme authored Oct 21, 2023
1 parent 54a5b4a commit 669652b
Show file tree
Hide file tree
Showing 67 changed files with 373 additions and 622 deletions.
30 changes: 13 additions & 17 deletions recognition/include/pcl/recognition/cg/geometric_consistency.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2012, Willow Garage, Inc.
*
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -44,7 +44,7 @@

namespace pcl
{

/** \brief Class implementing a 3D correspondence grouping enforcing geometric consistency among feature correspondences
*
* \author Federico Tombari, Tommaso Cavallari, Aitor Aldoma
Expand All @@ -61,14 +61,10 @@ namespace pcl
using SceneCloudConstPtr = typename pcl::CorrespondenceGrouping<PointModelT, PointSceneT>::SceneCloudConstPtr;

/** \brief Constructor */
GeometricConsistencyGrouping ()
: gc_threshold_ (3)
, gc_size_ (1.0)
{}
GeometricConsistencyGrouping () = default;


/** \brief Sets the minimum cluster size
* \param[in] threshold the minimum cluster size
* \param[in] threshold the minimum cluster size
*/
inline void
setGCThreshold (int threshold)
Expand All @@ -77,7 +73,7 @@ namespace pcl
}

/** \brief Gets the minimum cluster size.
*
*
* \return the minimum cluster size used by GC.
*/
inline int
Expand All @@ -87,7 +83,7 @@ namespace pcl
}

/** \brief Sets the consensus set resolution. This should be in metric units.
*
*
* \param[in] gc_size consensus set resolution.
*/
inline void
Expand All @@ -97,7 +93,7 @@ namespace pcl
}

/** \brief Gets the consensus set resolution.
*
*
* \return the consensus set resolution.
*/
inline double
Expand All @@ -107,7 +103,7 @@ namespace pcl
}

/** \brief The main function, recognizes instances of the model into the scene set by the user.
*
*
* \param[out] transformations a vector containing one transformation matrix for each instance of the model recognized into the scene.
*
* \return true if the recognition had been successful or false if errors have occurred.
Expand All @@ -116,7 +112,7 @@ namespace pcl
recognize (std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > &transformations);

/** \brief The main function, recognizes instances of the model into the scene set by the user.
*
*
* \param[out] transformations a vector containing one transformation matrix for each instance of the model recognized into the scene.
* \param[out] clustered_corrs a vector containing the correspondences for each instance of the model found within the input data (the same output of clusterCorrespondences).
*
Expand All @@ -131,19 +127,19 @@ namespace pcl
using CorrespondenceGrouping<PointModelT, PointSceneT>::model_scene_corrs_;

/** \brief Minimum cluster size. It shouldn't be less than 3, since at least 3 correspondences are needed to compute the 6DOF pose */
int gc_threshold_;
int gc_threshold_{3};

/** \brief Resolution of the consensus set used to cluster correspondences together*/
double gc_size_;
double gc_size_{1.0};

/** \brief Transformations found by clusterCorrespondences method. */
std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > found_transformations_;

/** \brief Cluster the input correspondences in order to distinguish between different instances of the model into the scene.
*
*
* \param[out] model_instances a vector containing the clustered correspondences for each model found on the scene.
* \return true if the clustering had been successful or false if errors have occurred.
*/
*/
void
clusterCorrespondences (std::vector<Correspondences> &model_instances) override;
};
Expand Down
28 changes: 10 additions & 18 deletions recognition/include/pcl/recognition/cg/hough_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ namespace pcl
Eigen::Vector3i bin_count_;

/** \brief Used to access hough_space_ as if it was a matrix. */
int partial_bin_products_[4];
int partial_bin_products_[4]{};

/** \brief Total number of bins in the Hough Space. */
int total_bins_count_;
int total_bins_count_{0};

/** \brief The Hough Space. */
std::vector<double> hough_space_;
Expand Down Expand Up @@ -166,14 +166,6 @@ namespace pcl
Hough3DGrouping ()
: input_rf_ ()
, scene_rf_ ()
, needs_training_ (true)
,hough_threshold_ (-1)
, hough_bin_size_ (1.0)
, use_interpolation_ (true)
, use_distance_weight_ (false)
, local_rf_normals_search_radius_ (0.0f)
, local_rf_search_radius_ (0.0f)
, hough_space_initialized_ (false)
{}

/** \brief Provide a pointer to the input dataset.
Expand Down Expand Up @@ -445,28 +437,28 @@ namespace pcl
SceneRfCloudConstPtr scene_rf_;

/** \brief If the training of the Hough space is needed; set on change of either the input cloud or the input_rf. */
bool needs_training_;
bool needs_training_{true};

/** \brief The result of the training. The vector between each model point and the centroid of the model adjusted by its local reference frame.*/
std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > model_votes_;

/** \brief The minimum number of votes in the Hough space needed to infer the presence of a model instance into the scene cloud. */
double hough_threshold_;
double hough_threshold_{-1.0};

/** \brief The size of each bin of the hough space. */
double hough_bin_size_;
double hough_bin_size_{1.0};

/** \brief Use the interpolation between neighboring Hough bins when casting votes. */
bool use_interpolation_;
bool use_interpolation_{true};

/** \brief Use the weighted correspondence distance when casting votes. */
bool use_distance_weight_;
bool use_distance_weight_{false};

/** \brief Normals search radius for the potential Rf calculation. */
float local_rf_normals_search_radius_;
float local_rf_normals_search_radius_{0.0f};

/** \brief Search radius for the potential Rf calculation. */
float local_rf_search_radius_;
float local_rf_search_radius_{0.0f};

/** \brief The Hough space. */
pcl::recognition::HoughSpace3D::Ptr hough_space_;
Expand All @@ -477,7 +469,7 @@ namespace pcl
/** \brief Whether the Hough space already contains the correct votes for the current input parameters and so the cluster and recognize calls don't need to recompute each value.
* Reset on the change of any parameter except the hough_threshold.
*/
bool hough_space_initialized_;
bool hough_space_initialized_{false};

/** \brief Cluster the input correspondences in order to distinguish between different instances of the model into the scene.
*
Expand Down
14 changes: 5 additions & 9 deletions recognition/include/pcl/recognition/color_gradient_modality.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ namespace pcl
private:

/** \brief Determines whether variable numbers of features are extracted or not. */
bool variable_feature_nr_;
bool variable_feature_nr_{false};

/** \brief Stores a smoothed version of the input cloud. */
pcl::PointCloud<pcl::RGB>::Ptr smoothed_input_;
Expand All @@ -249,15 +249,15 @@ namespace pcl
FeatureSelectionMethod feature_selection_method_;

/** \brief The threshold applied on the gradient magnitudes (for quantization). */
float gradient_magnitude_threshold_;
float gradient_magnitude_threshold_{10.0f};
/** \brief The threshold applied on the gradient magnitudes for feature extraction. */
float gradient_magnitude_threshold_feature_extraction_;
float gradient_magnitude_threshold_feature_extraction_{55.0f};

/** \brief The point cloud which holds the max-RGB gradients. */
pcl::PointCloud<pcl::GradientXY> color_gradients_;

/** \brief The spreading size. */
std::size_t spreading_size_;
std::size_t spreading_size_{8};

/** \brief The map which holds the quantized max-RGB gradients. */
pcl::QuantizedMap quantized_color_gradients_;
Expand All @@ -274,12 +274,8 @@ namespace pcl
template <typename PointInT>
pcl::ColorGradientModality<PointInT>::
ColorGradientModality ()
: variable_feature_nr_ (false)
, smoothed_input_ (new pcl::PointCloud<pcl::RGB> ())
: smoothed_input_ (new pcl::PointCloud<pcl::RGB> ())
, feature_selection_method_ (DISTANCE_MAGNITUDE_SCORE)
, gradient_magnitude_threshold_ (10.0f)
, gradient_magnitude_threshold_feature_extraction_ (55.0f)
, spreading_size_ (8)
{
}

Expand Down
34 changes: 17 additions & 17 deletions recognition/include/pcl/recognition/distance_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2011, Willow Garage, Inc.
*
* All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -40,43 +40,43 @@
namespace pcl
{

/** \brief Represents a distance map obtained from a distance transformation.
/** \brief Represents a distance map obtained from a distance transformation.
* \author Stefan Holzer
*/
class DistanceMap
{
public:
/** \brief Constructor. */
DistanceMap () : data_ (0), width_ (0), height_ (0) {}
DistanceMap () : data_ (0) {}
/** \brief Destructor. */
virtual ~DistanceMap () = default;

/** \brief Returns the width of the map. */
inline std::size_t
inline std::size_t
getWidth () const
{
return (width_);
return (width_);
}

/** \brief Returns the height of the map. */
inline std::size_t
inline std::size_t
getHeight () const
{
return (height_);
{
return (height_);
}

/** \brief Returns a pointer to the beginning of map. */
inline float *
getData ()
{
inline float *
getData ()
{
return (data_.data());
}

/** \brief Resizes the map to the specified size.
* \param[in] width the new width of the map.
* \param[in] height the new height of the map.
*/
void
void
resize (const std::size_t width, const std::size_t height)
{
data_.resize (width*height);
Expand All @@ -88,7 +88,7 @@ namespace pcl
* \param[in] col_index the column index of the element to access.
* \param[in] row_index the row index of the element to access.
*/
inline float &
inline float &
operator() (const std::size_t col_index, const std::size_t row_index)
{
return (data_[row_index*width_ + col_index]);
Expand All @@ -98,7 +98,7 @@ namespace pcl
* \param[in] col_index the column index of the element to access.
* \param[in] row_index the row index of the element to access.
*/
inline const float &
inline const float &
operator() (const std::size_t col_index, const std::size_t row_index) const
{
return (data_[row_index*width_ + col_index]);
Expand All @@ -108,9 +108,9 @@ namespace pcl
/** \brief The storage for the distance map data. */
std::vector<float> data_;
/** \brief The width of the map. */
std::size_t width_;
std::size_t width_{0};
/** \brief The height of the map. */
std::size_t height_;
std::size_t height_{0};
};

}
35 changes: 3 additions & 32 deletions recognition/include/pcl/recognition/impl/implicit_shape_model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,7 @@

//////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointT>
pcl::features::ISMVoteList<PointT>::ISMVoteList () :
votes_ (new pcl::PointCloud<pcl::InterestPoint> ()),
tree_is_valid_ (false),
votes_origins_ (new pcl::PointCloud<PointT> ()),
votes_class_ (0),
k_ind_ (0),
k_sqr_dist_ (0)
{
}
pcl::features::ISMVoteList<PointT>::ISMVoteList() = default;

//////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointT>
Expand Down Expand Up @@ -297,18 +289,7 @@ pcl::features::ISMVoteList<PointT>::getNumberOfVotes ()
}

//////////////////////////////////////////////////////////////////////////////////////////////
pcl::features::ISMModel::ISMModel () :
statistical_weights_ (0),
learned_weights_ (0),
classes_ (0),
sigmas_ (0),
clusters_ (0),
number_of_classes_ (0),
number_of_visual_words_ (0),
number_of_clusters_ (0),
descriptors_dimension_ (0)
{
}
pcl::features::ISMModel::ISMModel () = default;

//////////////////////////////////////////////////////////////////////////////////////////////
pcl::features::ISMModel::ISMModel (ISMModel const & copy)
Expand Down Expand Up @@ -546,17 +527,7 @@ pcl::features::ISMModel::operator = (const pcl::features::ISMModel& other)

//////////////////////////////////////////////////////////////////////////////////////////////
template <int FeatureSize, typename PointT, typename NormalT>
pcl::ism::ImplicitShapeModelEstimation<FeatureSize, PointT, NormalT>::ImplicitShapeModelEstimation () :
training_clouds_ (0),
training_classes_ (0),
training_normals_ (0),
training_sigmas_ (0),
sampling_size_ (0.1f),
feature_estimator_ (),
number_of_clusters_ (184),
n_vot_ON_ (true)
{
}
pcl::ism::ImplicitShapeModelEstimation<FeatureSize, PointT, NormalT>::ImplicitShapeModelEstimation () = default;

//////////////////////////////////////////////////////////////////////////////////////////////
template <int FeatureSize, typename PointT, typename NormalT>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,7 @@ SimpleOctree<NodeData, NodeDataCreator, Scalar>::Node::makeNeighbors (Node* node


template<typename NodeData, typename NodeDataCreator, typename Scalar> inline
SimpleOctree<NodeData, NodeDataCreator, Scalar>::SimpleOctree ()
: tree_levels_ (0),
root_ (nullptr)
{
}
SimpleOctree<NodeData, NodeDataCreator, Scalar>::SimpleOctree () = default;


template<typename NodeData, typename NodeDataCreator, typename Scalar> inline
Expand Down
Loading

0 comments on commit 669652b

Please sign in to comment.