Skip to content

Commit 969d5d3

Browse files
authored
Part E of transition to support modernize-use-default-member-init (#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
1 parent 14b7b72 commit 969d5d3

44 files changed

Lines changed: 170 additions & 252 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

features/include/pcl/features/brisk_2d.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ namespace pcl
161161
const float max_x, const float max_y, const KeypointT& key_pt);
162162

163163
/** \brief Specifies whether rotation invariance is enabled. */
164-
bool rotation_invariance_enabled_;
164+
bool rotation_invariance_enabled_{true};
165165

166166
/** \brief Specifies whether scale invariance is enabled. */
167-
bool scale_invariance_enabled_;
167+
bool scale_invariance_enabled_{true};
168168

169169
/** \brief Specifies the scale of the pattern. */
170-
const float pattern_scale_;
170+
const float pattern_scale_{1.0f};
171171

172172
/** \brief the input cloud. */
173173
PointCloudInTConstPtr input_cloud_;
@@ -176,7 +176,7 @@ namespace pcl
176176
KeypointPointCloudTPtr keypoints_;
177177

178178
// TODO: set
179-
float scale_range_;
179+
float scale_range_{0.0f};
180180

181181
// Some helper structures for the Brisk pattern representation
182182
struct BriskPatternPoint
@@ -214,41 +214,41 @@ namespace pcl
214214
BriskPatternPoint* pattern_points_;
215215

216216
/** Total number of collocation points. */
217-
unsigned int points_;
217+
unsigned int points_{0u};
218218

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

222222
/** Lists the scaling per scale index [scale]. */
223-
float* scale_list_;
223+
float* scale_list_{nullptr};
224224

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

228228
/** Scales discretization. */
229-
const unsigned int scales_;
229+
const unsigned int scales_{64};
230230

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

234234
// general
235-
const float basic_size_;
235+
const float basic_size_{12.0};
236236

237237
// pairs
238238
/** Number of uchars the descriptor consists of. */
239-
int strings_;
239+
int strings_{0};
240240
/** Short pair maximum distance. */
241-
float d_max_;
241+
float d_max_{0.0f};
242242
/** Long pair maximum distance. */
243-
float d_min_;
243+
float d_min_{0.0f};
244244
/** d<_d_max. */
245245
BriskShortPair* short_pairs_;
246246
/** d>_d_min. */
247247
BriskLongPair* long_pairs_;
248248
/** Number of short pairs. */
249-
unsigned int no_short_pairs_;
249+
unsigned int no_short_pairs_{0};
250250
/** Number of long pairs. */
251-
unsigned int no_long_pairs_;
251+
unsigned int no_long_pairs_{0};
252252

253253
/** \brief Intensity field accessor. */
254254
IntensityT intensity_;

features/include/pcl/features/impl/brisk_2d.hpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,10 @@ namespace pcl
4747

4848
template <typename PointInT, typename PointOutT, typename KeypointT, typename IntensityT>
4949
BRISK2DEstimation<PointInT, PointOutT, KeypointT, IntensityT>::BRISK2DEstimation ()
50-
: rotation_invariance_enabled_ (true)
51-
, scale_invariance_enabled_ (true)
52-
, pattern_scale_ (1.0f)
53-
, input_cloud_ (), keypoints_ (), scale_range_ (), pattern_points_ (), points_ ()
54-
, n_rot_ (1024), scale_list_ (nullptr), size_list_ (nullptr)
55-
, scales_ (64)
56-
, scalerange_ (30)
57-
, basic_size_ (12.0)
58-
, strings_ (0), d_max_ (0.0f), d_min_ (0.0f), short_pairs_ (), long_pairs_ ()
59-
, no_short_pairs_ (0), no_long_pairs_ (0)
60-
, intensity_ ()
50+
:
51+
input_cloud_ (), keypoints_ (), pattern_points_ (),
52+
short_pairs_ (), long_pairs_ ()
53+
, intensity_ ()
6154
, name_ ("BRISK2Destimation")
6255
{
6356
// Since we do not assume pattern_scale_ should be changed by the user, we

geometry/include/pcl/geometry/organized_index_iterator.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,15 @@ class OrganizedIndexIterator {
101101
unsigned width_;
102102

103103
/** \brief the index of the current pixel/point*/
104-
unsigned index_;
104+
unsigned index_{0};
105105
};
106106

107107
////////////////////////////////////////////////////////////////////////////////
108108
////////////////////////////////////////////////////////////////////////////////
109109
////////////////////////////////////////////////////////////////////////////////
110110

111111
////////////////////////////////////////////////////////////////////////////////
112-
inline OrganizedIndexIterator::OrganizedIndexIterator(unsigned width)
113-
: width_(width), index_(0)
114-
{}
112+
inline OrganizedIndexIterator::OrganizedIndexIterator(unsigned width) : width_(width) {}
115113

116114
////////////////////////////////////////////////////////////////////////////////
117115
inline OrganizedIndexIterator::~OrganizedIndexIterator() = default;

io/include/pcl/io/ply_io.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,6 @@ namespace pcl
9494
PLYReader (const PLYReader &p)
9595
: origin_ (Eigen::Vector4f::Zero ())
9696
, orientation_ (Eigen::Matrix3f::Identity ())
97-
, cloud_ ()
98-
, vertex_count_ (0)
99-
, vertex_offset_before_ (0)
100-
, range_grid_ (nullptr)
101-
, rgb_offset_before_ (0)
102-
, do_resize_ (false)
103-
, polygons_ (nullptr)
104-
, r_(0), g_(0), b_(0)
105-
, a_(0), rgba_(0)
10697
{
10798
*this = p;
10899
}

keypoints/include/pcl/keypoints/agast_2d.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,8 @@ namespace pcl
570570

571571
/** \brief Constructor */
572572
AgastKeypoint2DBase ()
573-
: threshold_ (10)
574-
, apply_non_max_suppression_ (true)
575-
, bmax_ (255)
576-
, nr_max_keypoints_ (std::numeric_limits<unsigned int>::max ())
573+
:
574+
nr_max_keypoints_ (std::numeric_limits<unsigned int>::max ())
577575
{
578576
k_ = 1;
579577
}
@@ -673,13 +671,13 @@ namespace pcl
673671
IntensityT intensity_;
674672

675673
/** \brief Threshold for corner detection. */
676-
double threshold_;
674+
double threshold_{10};
677675

678676
/** \brief Determines whether non-max-suppression is activated. */
679-
bool apply_non_max_suppression_;
677+
bool apply_non_max_suppression_{true};
680678

681679
/** \brief Max image value. */
682-
double bmax_;
680+
double bmax_{255};
683681

684682
/** \brief The Agast detector to use. */
685683
AgastDetectorPtr detector_;

keypoints/include/pcl/keypoints/brisk_2d.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ namespace pcl
9090
BriskKeypoint2D (int octaves = 4, int threshold = 60)
9191
: threshold_ (threshold)
9292
, octaves_ (octaves)
93-
, remove_invalid_3D_keypoints_ (false)
9493
{
9594
k_ = 1;
9695
name_ = "BriskKeypoint2D";
@@ -232,7 +231,7 @@ namespace pcl
232231
/** \brief Specify whether the keypoints that do not have a valid 3D position are
233232
* kept (false) or removed (true).
234233
*/
235-
bool remove_invalid_3D_keypoints_;
234+
bool remove_invalid_3D_keypoints_{false};
236235
};
237236

238237
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -473,8 +472,8 @@ namespace pcl
473472
std::uint8_t safe_threshold_;
474473

475474
// some constant parameters
476-
float safety_factor_;
477-
float basic_size_;
475+
float safety_factor_{1.0};
476+
float basic_size_{12.0};
478477
};
479478
} // namespace brisk
480479
} // namespace keypoints

keypoints/include/pcl/keypoints/harris_3d.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ namespace pcl
8484
*/
8585
HarrisKeypoint3D (ResponseMethod method = HARRIS, float radius = 0.01f, float threshold = 0.0f)
8686
: threshold_ (threshold)
87-
, refine_ (true)
88-
, nonmax_ (true)
8987
, method_ (method)
90-
, threads_ (0)
9188
{
9289
name_ = "HarrisKeypoint3D";
9390
search_radius_ = radius;
@@ -171,11 +168,11 @@ namespace pcl
171168
void calculateNormalCovar (const pcl::Indices& neighbors, float* coefficients) const;
172169
private:
173170
float threshold_;
174-
bool refine_;
175-
bool nonmax_;
171+
bool refine_{true};
172+
bool nonmax_{true};
176173
ResponseMethod method_;
177174
PointCloudNConstPtr normals_;
178-
unsigned int threads_;
175+
unsigned int threads_{0};
179176
};
180177
}
181178

keypoints/include/pcl/keypoints/harris_6d.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ namespace pcl
7474
*/
7575
HarrisKeypoint6D (float radius = 0.01, float threshold = 0.0)
7676
: threshold_ (threshold)
77-
, refine_ (true)
78-
, nonmax_ (true)
79-
, threads_ (0)
80-
, normals_ (new pcl::PointCloud<NormalT>)
77+
,
78+
normals_ (new pcl::PointCloud<NormalT>)
8179
, intensity_gradients_ (new pcl::PointCloud<pcl::IntensityGradient>)
8280
{
8381
name_ = "HarrisKeypoint6D";
@@ -129,9 +127,9 @@ namespace pcl
129127
void calculateCombinedCovar (const pcl::Indices& neighbors, float* coefficients) const;
130128
private:
131129
float threshold_;
132-
bool refine_;
133-
bool nonmax_;
134-
unsigned int threads_;
130+
bool refine_{true};
131+
bool nonmax_{true};
132+
unsigned int threads_{0};
135133
typename pcl::PointCloud<NormalT>::Ptr normals_;
136134
pcl::PointCloud<pcl::IntensityGradient>::Ptr intensity_gradients_;
137135
} ;

keypoints/include/pcl/keypoints/iss_3d.h

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,8 @@ namespace pcl
111111
*/
112112
ISSKeypoint3D (double salient_radius = 0.0001)
113113
: salient_radius_ (salient_radius)
114-
, non_max_radius_ (0.0)
115-
, normal_radius_ (0.0)
116-
, border_radius_ (0.0)
117-
, gamma_21_ (0.975)
118-
, gamma_32_ (0.975)
119-
, third_eigen_value_ (nullptr)
120-
, edge_points_ (nullptr)
121-
, min_neighbors_ (5)
122114
, normals_ (new pcl::PointCloud<NormalT>)
123115
, angle_threshold_ (static_cast<float> (M_PI) / 2.0f)
124-
, threads_ (0)
125116
{
126117
name_ = "ISSKeypoint3D";
127118
search_radius_ = salient_radius_;
@@ -236,28 +227,28 @@ namespace pcl
236227
double salient_radius_;
237228

238229
/** \brief The non maxima suppression radius. */
239-
double non_max_radius_;
230+
double non_max_radius_{0.0};
240231

241232
/** \brief The radius used to compute the normals of the input cloud. */
242-
double normal_radius_;
233+
double normal_radius_{0.0};
243234

244235
/** \brief The radius used to compute the boundary points of the input cloud. */
245-
double border_radius_;
236+
double border_radius_{0.0};
246237

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

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

253244
/** \brief Store the third eigen value associated to each point in the input cloud. */
254-
double *third_eigen_value_;
245+
double *third_eigen_value_{nullptr};
255246

256247
/** \brief Store the information about the boundary points of the input cloud. */
257-
bool *edge_points_;
248+
bool *edge_points_{nullptr};
258249

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

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

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

271262
};
272263

keypoints/include/pcl/keypoints/keypoint.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ namespace pcl
7676
BaseClass (),
7777
search_method_surface_ (),
7878
surface_ (),
79-
tree_ (),
80-
search_parameter_ (0),
81-
search_radius_ (0),
82-
k_ (0)
79+
tree_ ()
80+
8381
{};
8482

8583
/** \brief Empty destructor */
@@ -181,13 +179,13 @@ namespace pcl
181179
KdTreePtr tree_;
182180

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

186184
/** \brief The nearest neighbors search radius for each point. */
187-
double search_radius_;
185+
double search_radius_{0};
188186

189187
/** \brief The number of K nearest neighbors to use for each point. */
190-
int k_;
188+
int k_{0};
191189

192190
/** \brief Indices of the keypoints in the input cloud. */
193191
pcl::PointIndicesPtr keypoints_indices_;

0 commit comments

Comments
 (0)