Skip to content

Commit

Permalink
Part E of transition to support modernize-use-default-member-init (Po…
Browse files Browse the repository at this point in the history
…intCloudLibrary#5782)

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

* Added default constructor to IteratorState

* Fixed formatting flagged by CI

* Fixed further CI escapes in format, tidy

* Fixed more clang-tidy, clang-format issues from CI

* Fixed two more CI escapes

* Addressed code review comments

* Fixed yet more clang-format issues

* Addressed further review comments
  • Loading branch information
gnawme committed Aug 31, 2023
1 parent 14b7b72 commit 969d5d3
Show file tree
Hide file tree
Showing 44 changed files with 170 additions and 252 deletions.
32 changes: 16 additions & 16 deletions features/include/pcl/features/brisk_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ namespace pcl
const float max_x, const float max_y, const KeypointT& key_pt);

/** \brief Specifies whether rotation invariance is enabled. */
bool rotation_invariance_enabled_;
bool rotation_invariance_enabled_{true};

/** \brief Specifies whether scale invariance is enabled. */
bool scale_invariance_enabled_;
bool scale_invariance_enabled_{true};

/** \brief Specifies the scale of the pattern. */
const float pattern_scale_;
const float pattern_scale_{1.0f};

/** \brief the input cloud. */
PointCloudInTConstPtr input_cloud_;
Expand All @@ -176,7 +176,7 @@ namespace pcl
KeypointPointCloudTPtr keypoints_;

// TODO: set
float scale_range_;
float scale_range_{0.0f};

// Some helper structures for the Brisk pattern representation
struct BriskPatternPoint
Expand Down Expand Up @@ -214,41 +214,41 @@ namespace pcl
BriskPatternPoint* pattern_points_;

/** Total number of collocation points. */
unsigned int points_;
unsigned int points_{0u};

/** Discretization of the rotation look-up. */
const unsigned int n_rot_;
const unsigned int n_rot_{1024};

/** Lists the scaling per scale index [scale]. */
float* scale_list_;
float* scale_list_{nullptr};

/** Lists the total pattern size per scale index [scale]. */
unsigned int* size_list_;
unsigned int* size_list_{nullptr};

/** Scales discretization. */
const unsigned int scales_;
const unsigned int scales_{64};

/** Span of sizes 40->4 Octaves - else, this needs to be adjusted... */
const float scalerange_;
const float scalerange_{30};

// general
const float basic_size_;
const float basic_size_{12.0};

// pairs
/** Number of uchars the descriptor consists of. */
int strings_;
int strings_{0};
/** Short pair maximum distance. */
float d_max_;
float d_max_{0.0f};
/** Long pair maximum distance. */
float d_min_;
float d_min_{0.0f};
/** d<_d_max. */
BriskShortPair* short_pairs_;
/** d>_d_min. */
BriskLongPair* long_pairs_;
/** Number of short pairs. */
unsigned int no_short_pairs_;
unsigned int no_short_pairs_{0};
/** Number of long pairs. */
unsigned int no_long_pairs_;
unsigned int no_long_pairs_{0};

/** \brief Intensity field accessor. */
IntensityT intensity_;
Expand Down
15 changes: 4 additions & 11 deletions features/include/pcl/features/impl/brisk_2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,10 @@ namespace pcl

template <typename PointInT, typename PointOutT, typename KeypointT, typename IntensityT>
BRISK2DEstimation<PointInT, PointOutT, KeypointT, IntensityT>::BRISK2DEstimation ()
: rotation_invariance_enabled_ (true)
, scale_invariance_enabled_ (true)
, pattern_scale_ (1.0f)
, input_cloud_ (), keypoints_ (), scale_range_ (), pattern_points_ (), points_ ()
, n_rot_ (1024), scale_list_ (nullptr), size_list_ (nullptr)
, scales_ (64)
, scalerange_ (30)
, basic_size_ (12.0)
, strings_ (0), d_max_ (0.0f), d_min_ (0.0f), short_pairs_ (), long_pairs_ ()
, no_short_pairs_ (0), no_long_pairs_ (0)
, intensity_ ()
:
input_cloud_ (), keypoints_ (), pattern_points_ (),
short_pairs_ (), long_pairs_ ()
, intensity_ ()
, name_ ("BRISK2Destimation")
{
// Since we do not assume pattern_scale_ should be changed by the user, we
Expand Down
6 changes: 2 additions & 4 deletions geometry/include/pcl/geometry/organized_index_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,15 @@ class OrganizedIndexIterator {
unsigned width_;

/** \brief the index of the current pixel/point*/
unsigned index_;
unsigned index_{0};
};

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

////////////////////////////////////////////////////////////////////////////////
inline OrganizedIndexIterator::OrganizedIndexIterator(unsigned width)
: width_(width), index_(0)
{}
inline OrganizedIndexIterator::OrganizedIndexIterator(unsigned width) : width_(width) {}

////////////////////////////////////////////////////////////////////////////////
inline OrganizedIndexIterator::~OrganizedIndexIterator() = default;
Expand Down
9 changes: 0 additions & 9 deletions io/include/pcl/io/ply_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,6 @@ namespace pcl
PLYReader (const PLYReader &p)
: origin_ (Eigen::Vector4f::Zero ())
, orientation_ (Eigen::Matrix3f::Identity ())
, cloud_ ()
, vertex_count_ (0)
, vertex_offset_before_ (0)
, range_grid_ (nullptr)
, rgb_offset_before_ (0)
, do_resize_ (false)
, polygons_ (nullptr)
, r_(0), g_(0), b_(0)
, a_(0), rgba_(0)
{
*this = p;
}
Expand Down
12 changes: 5 additions & 7 deletions keypoints/include/pcl/keypoints/agast_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,8 @@ namespace pcl

/** \brief Constructor */
AgastKeypoint2DBase ()
: threshold_ (10)
, apply_non_max_suppression_ (true)
, bmax_ (255)
, nr_max_keypoints_ (std::numeric_limits<unsigned int>::max ())
:
nr_max_keypoints_ (std::numeric_limits<unsigned int>::max ())
{
k_ = 1;
}
Expand Down Expand Up @@ -673,13 +671,13 @@ namespace pcl
IntensityT intensity_;

/** \brief Threshold for corner detection. */
double threshold_;
double threshold_{10};

/** \brief Determines whether non-max-suppression is activated. */
bool apply_non_max_suppression_;
bool apply_non_max_suppression_{true};

/** \brief Max image value. */
double bmax_;
double bmax_{255};

/** \brief The Agast detector to use. */
AgastDetectorPtr detector_;
Expand Down
7 changes: 3 additions & 4 deletions keypoints/include/pcl/keypoints/brisk_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ namespace pcl
BriskKeypoint2D (int octaves = 4, int threshold = 60)
: threshold_ (threshold)
, octaves_ (octaves)
, remove_invalid_3D_keypoints_ (false)
{
k_ = 1;
name_ = "BriskKeypoint2D";
Expand Down Expand Up @@ -232,7 +231,7 @@ namespace pcl
/** \brief Specify whether the keypoints that do not have a valid 3D position are
* kept (false) or removed (true).
*/
bool remove_invalid_3D_keypoints_;
bool remove_invalid_3D_keypoints_{false};
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -473,8 +472,8 @@ namespace pcl
std::uint8_t safe_threshold_;

// some constant parameters
float safety_factor_;
float basic_size_;
float safety_factor_{1.0};
float basic_size_{12.0};
};
} // namespace brisk
} // namespace keypoints
Expand Down
9 changes: 3 additions & 6 deletions keypoints/include/pcl/keypoints/harris_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ namespace pcl
*/
HarrisKeypoint3D (ResponseMethod method = HARRIS, float radius = 0.01f, float threshold = 0.0f)
: threshold_ (threshold)
, refine_ (true)
, nonmax_ (true)
, method_ (method)
, threads_ (0)
{
name_ = "HarrisKeypoint3D";
search_radius_ = radius;
Expand Down Expand Up @@ -171,11 +168,11 @@ namespace pcl
void calculateNormalCovar (const pcl::Indices& neighbors, float* coefficients) const;
private:
float threshold_;
bool refine_;
bool nonmax_;
bool refine_{true};
bool nonmax_{true};
ResponseMethod method_;
PointCloudNConstPtr normals_;
unsigned int threads_;
unsigned int threads_{0};
};
}

Expand Down
12 changes: 5 additions & 7 deletions keypoints/include/pcl/keypoints/harris_6d.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ namespace pcl
*/
HarrisKeypoint6D (float radius = 0.01, float threshold = 0.0)
: threshold_ (threshold)
, refine_ (true)
, nonmax_ (true)
, threads_ (0)
, normals_ (new pcl::PointCloud<NormalT>)
,
normals_ (new pcl::PointCloud<NormalT>)
, intensity_gradients_ (new pcl::PointCloud<pcl::IntensityGradient>)
{
name_ = "HarrisKeypoint6D";
Expand Down Expand Up @@ -129,9 +127,9 @@ namespace pcl
void calculateCombinedCovar (const pcl::Indices& neighbors, float* coefficients) const;
private:
float threshold_;
bool refine_;
bool nonmax_;
unsigned int threads_;
bool refine_{true};
bool nonmax_{true};
unsigned int threads_{0};
typename pcl::PointCloud<NormalT>::Ptr normals_;
pcl::PointCloud<pcl::IntensityGradient>::Ptr intensity_gradients_;
} ;
Expand Down
27 changes: 9 additions & 18 deletions keypoints/include/pcl/keypoints/iss_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,8 @@ namespace pcl
*/
ISSKeypoint3D (double salient_radius = 0.0001)
: salient_radius_ (salient_radius)
, non_max_radius_ (0.0)
, normal_radius_ (0.0)
, border_radius_ (0.0)
, gamma_21_ (0.975)
, gamma_32_ (0.975)
, third_eigen_value_ (nullptr)
, edge_points_ (nullptr)
, min_neighbors_ (5)
, normals_ (new pcl::PointCloud<NormalT>)
, angle_threshold_ (static_cast<float> (M_PI) / 2.0f)
, threads_ (0)
{
name_ = "ISSKeypoint3D";
search_radius_ = salient_radius_;
Expand Down Expand Up @@ -236,28 +227,28 @@ namespace pcl
double salient_radius_;

/** \brief The non maxima suppression radius. */
double non_max_radius_;
double non_max_radius_{0.0};

/** \brief The radius used to compute the normals of the input cloud. */
double normal_radius_;
double normal_radius_{0.0};

/** \brief The radius used to compute the boundary points of the input cloud. */
double border_radius_;
double border_radius_{0.0};

/** \brief The upper bound on the ratio between the second and the first eigenvalue returned by the EVD. */
double gamma_21_;
double gamma_21_{0.975};

/** \brief The upper bound on the ratio between the third and the second eigenvalue returned by the EVD. */
double gamma_32_;
double gamma_32_{0.975};

/** \brief Store the third eigen value associated to each point in the input cloud. */
double *third_eigen_value_;
double *third_eigen_value_{nullptr};

/** \brief Store the information about the boundary points of the input cloud. */
bool *edge_points_;
bool *edge_points_{nullptr};

/** \brief Minimum number of neighbors that has to be found while applying the non maxima suppression algorithm. */
int min_neighbors_;
int min_neighbors_{5};

/** \brief The cloud of normals related to the input surface. */
PointCloudNConstPtr normals_;
Expand All @@ -266,7 +257,7 @@ namespace pcl
float angle_threshold_;

/** \brief The number of threads that has to be used by the scheduler. */
unsigned int threads_;
unsigned int threads_{0};

};

Expand Down
12 changes: 5 additions & 7 deletions keypoints/include/pcl/keypoints/keypoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ namespace pcl
BaseClass (),
search_method_surface_ (),
surface_ (),
tree_ (),
search_parameter_ (0),
search_radius_ (0),
k_ (0)
tree_ ()

{};

/** \brief Empty destructor */
Expand Down Expand Up @@ -181,13 +179,13 @@ namespace pcl
KdTreePtr tree_;

/** \brief The actual search parameter (casted from either \a search_radius_ or \a k_). */
double search_parameter_;
double search_parameter_{0};

/** \brief The nearest neighbors search radius for each point. */
double search_radius_;
double search_radius_{0};

/** \brief The number of K nearest neighbors to use for each point. */
int k_;
int k_{0};

/** \brief Indices of the keypoints in the input cloud. */
pcl::PointIndicesPtr keypoints_indices_;
Expand Down
Loading

0 comments on commit 969d5d3

Please sign in to comment.