Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part G of transition to support modernize-use-default-member-init #5860

Merged
Prev Previous commit
Next Next commit
Made changes per review
  • Loading branch information
gnawme committed Nov 1, 2023
commit 8ea136a0f9383b64396bb2daa459e9c7911b9991
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ namespace pcl
ConditionalEuclideanClustering (bool extract_removed_clusters = false) :
searcher_ (),
condition_function_ (),

max_cluster_size_ (std::numeric_limits<int>::max ()),
extract_removed_clusters_ (extract_removed_clusters),
small_clusters_ (new pcl::IndicesClusters),
large_clusters_ (new pcl::IndicesClusters)
Expand Down Expand Up @@ -248,10 +246,10 @@ namespace pcl
int min_cluster_size_{1};

/** \brief The maximum cluster size (default = unlimited) */
int max_cluster_size_{0};
int max_cluster_size_{std::numeric_limits<int>::max ()};

/** \brief Set to true if you want to be able to extract the clusters that are too large or too small (default = false) */
bool extract_removed_clusters_{false};
bool extract_removed_clusters_;

/** \brief The resultant clusters that contain less than min_cluster_size points */
pcl::IndicesClustersPtr small_clusters_{nullptr};
Expand Down
9 changes: 3 additions & 6 deletions segmentation/include/pcl/segmentation/extract_clusters.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,7 @@ namespace pcl

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/** \brief Empty constructor. */
EuclideanClusterExtraction () : tree_ (),

max_pts_per_cluster_ (std::numeric_limits<pcl::uindex_t>::max ())
{};
EuclideanClusterExtraction () : tree_ () {};
gnawme marked this conversation as resolved.
Show resolved Hide resolved

/** \brief Provide a pointer to the search object.
* \param[in] tree a pointer to the spatial search object.
Expand Down Expand Up @@ -422,7 +419,7 @@ namespace pcl
using BasePCLBase::deinitCompute;

/** \brief A pointer to the spatial search object. */
KdTreePtr tree_;
KdTreePtr tree_{nullptr};

/** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */
double cluster_tolerance_{0.0};
Expand All @@ -431,7 +428,7 @@ namespace pcl
pcl::uindex_t min_pts_per_cluster_{1};

/** \brief The maximum number of points that a cluster needs to contain in order to be considered valid (default = MAXINT). */
pcl::uindex_t max_pts_per_cluster_{0};
pcl::uindex_t max_pts_per_cluster_{std::numeric_limits<pcl::uindex_t>::max()};

/** \brief Class getName method. */
virtual std::string getClassName () const { return ("EuclideanClusterExtraction"); }
Expand Down
12 changes: 4 additions & 8 deletions segmentation/include/pcl/segmentation/extract_labeled_clusters.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ class LabeledEuclideanClusterExtraction : public PCLBase<PointT> {

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/** \brief Empty constructor. */
LabeledEuclideanClusterExtraction()
: tree_()
,
max_pts_per_cluster_(std::numeric_limits<int>::max())
, max_label_(std::numeric_limits<int>::max()){};
LabeledEuclideanClusterExtraction() = default;

/** \brief Provide a pointer to the search object.
* \param[in] tree a pointer to the spatial search object.
Expand Down Expand Up @@ -221,7 +217,7 @@ class LabeledEuclideanClusterExtraction : public PCLBase<PointT> {
using BasePCLBase::input_;

/** \brief A pointer to the spatial search object. */
KdTreePtr tree_;
KdTreePtr tree_{nullptr};

/** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */
double cluster_tolerance_{0};
Expand All @@ -232,11 +228,11 @@ class LabeledEuclideanClusterExtraction : public PCLBase<PointT> {

/** \brief The maximum number of points that a cluster needs to contain in order to be
* considered valid (default = MAXINT). */
int max_pts_per_cluster_;
int max_pts_per_cluster_{std::numeric_limits<int>::max()};

/** \brief The maximum number of labels we can find in this pointcloud (default =
* MAXINT)*/
unsigned int max_label_;
unsigned int max_label_{0};
gnawme marked this conversation as resolved.
Show resolved Hide resolved

/** \brief Class getName method. */
virtual std::string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ namespace pcl
using PointIndicesConstPtr = PointIndices::ConstPtr;

/** \brief Empty constructor. */
ExtractPolygonalPrismData () : planar_hull_ (),
height_limit_max_(std::numeric_limits<float>::max())
{};
ExtractPolygonalPrismData () = default;

/** \brief Provide a pointer to the input planar hull dataset.
* \note Please see the example in the class description for how to obtain this.
Expand Down Expand Up @@ -198,7 +196,7 @@ namespace pcl
/** \brief The maximum allowed height (distance to the model) a point
* will be considered from.
*/
double height_limit_max_{0.0};
double height_limit_max_{std::numeric_limits<float>::max()};

/** \brief Values describing the data acquisition viewpoint. Default: 0,0,0. */
float vpx_{0}, vpy_{0}, vpz_{0};
Expand Down
4 changes: 2 additions & 2 deletions segmentation/include/pcl/segmentation/region_growing.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ namespace pcl
pcl::uindex_t min_pts_per_cluster_{1};

/** \brief Stores the maximum number of points that a cluster needs to contain in order to be considered valid. */
pcl::uindex_t max_pts_per_cluster_{0};
pcl::uindex_t max_pts_per_cluster_{std::numeric_limits<pcl::uindex_t>::max()};

/** \brief Flag that signalizes if the smoothness constraint will be used. */
bool smooth_mode_flag_{true};
Expand All @@ -294,7 +294,7 @@ namespace pcl
bool residual_flag_{false};

/** \brief Threshold used for testing the smoothness between points. */
float theta_threshold_{0.0f};
float theta_threshold_{30.0f / 180.0f * static_cast<float>(M_PI)};

/** \brief Threshold used in residual test. */
float residual_threshold_{0.05f};
Expand Down
10 changes: 3 additions & 7 deletions segmentation/include/pcl/segmentation/sac_segmentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ namespace pcl
SACSegmentation(bool random = false)
: model_()
gnawme marked this conversation as resolved.
Show resolved Hide resolved
, sac_()
, radius_min_(-std::numeric_limits<double>::max())
, radius_max_(std::numeric_limits<double>::max())
, samples_radius_search_()
, axis_(Eigen::Vector3f::Zero())
, random_(random)
{}

Expand Down Expand Up @@ -272,7 +268,7 @@ namespace pcl
bool optimize_coefficients_{true};

/** \brief The minimum and maximum radius limits for the model. Applicable to all models that estimate a radius. */
double radius_min_{0.0}, radius_max_{0.0};
double radius_min_{-std::numeric_limits<double>::max()}, radius_max_{std::numeric_limits<double>::max()};

/** \brief The maximum distance of subsequent samples from the first (radius search) */
double samples_radius_{0.0};
Expand All @@ -284,7 +280,7 @@ namespace pcl
double eps_angle_{0.0};

/** \brief The axis along which we need to search for a model perpendicular to. */
Eigen::Vector3f axis_{};
Eigen::Vector3f axis_{Eigen::Vector3f::Zero()};

/** \brief Maximum number of iterations before giving up (user given parameter). */
int max_iterations_{50};
Expand All @@ -296,7 +292,7 @@ namespace pcl
double probability_{0.99};

/** \brief Set to true if we need a random seed. */
bool random_{false};
bool random_;

/** \brief Class get name method. */
virtual std::string
Expand Down