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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Addressed review comments
  • Loading branch information
gnawme committed Nov 29, 2023
commit 3adea2814d340b9a51dc0e2e64023e882546e0d4
2 changes: 1 addition & 1 deletion segmentation/include/pcl/segmentation/extract_clusters.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ namespace pcl

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/** \brief Empty constructor. */
EuclideanClusterExtraction () : tree_ () {};
EuclideanClusterExtraction () = default;

/** \brief Provide a pointer to the search object.
* \param[in] tree a pointer to the spatial search object.
Expand Down
20 changes: 9 additions & 11 deletions segmentation/include/pcl/segmentation/grabcut_segmentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,8 @@ namespace pcl
class GaussianFitter
{
public:
GaussianFitter (float epsilon = 0.0001)
: sum_ (Eigen::Vector3f::Zero ())
, accumulator_ (Eigen::Matrix3f::Zero ())
, epsilon_ (epsilon)
GaussianFitter (float epsilon = 0.0001f)
: epsilon_ (epsilon)
{}

/// Add a color sample
Expand All @@ -280,13 +278,13 @@ namespace pcl

private:
/// sum of r,g, and b
Eigen::Vector3f sum_{};
Eigen::Vector3f sum_{Eigen::Vector3f::Zero ()};
/// matrix of products (i.e. r*r, r*g, r*b), some values are duplicated.
Eigen::Matrix3f accumulator_{};
Eigen::Matrix3f accumulator_{Eigen::Matrix3f::Zero ()};
/// count of color samples added to the gaussian
std::uint32_t count_{0};
/// small value to add to covariance matrix diagonal to avoid singular values
float epsilon_{0.0f};
float epsilon_{0.001f};
gnawme marked this conversation as resolved.
Show resolved Hide resolved
PCL_MAKE_ALIGNED_OPERATOR_NEW
};

Expand Down Expand Up @@ -394,12 +392,12 @@ namespace pcl
// Storage for N-link weights, each pixel stores links to nb_neighbours
struct NLinks
{
NLinks () : indices (0), dists (0), weights (0) {}
NLinks () = default;

int nb_links{0};
Indices indices;
std::vector<float> dists;
std::vector<float> weights;
Indices indices{};
std::vector<float> dists{};
std::vector<float> weights{};
};
bool
initCompute ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,7 @@

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointT>
pcl::MinCutSegmentation<PointT>::MinCutSegmentation () :
search_ (),
foreground_points_ (0),
background_points_ (0),
clusters_ (0),
vertices_ (0),
edge_marker_ (0)
///////////////////////////////////
{
}
pcl::MinCutSegmentation<PointT>::MinCutSegmentation () = default;

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointT>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,7 @@ namespace pcl
using PlaneRefinementComparatorConstPtr = typename PlaneRefinementComparator::ConstPtr;

/** \brief Constructor for OrganizedMultiPlaneSegmentation. */
OrganizedMultiPlaneSegmentation () :
normals_ (),

angular_threshold_ (pcl::deg2rad (3.0)),

compare_ (new PlaneComparator ()), refinement_compare_ (new PlaneRefinementComparator ())
{
}
OrganizedMultiPlaneSegmentation () = default;

/** \brief Destructor for OrganizedMultiPlaneSegmentation. */

Expand Down Expand Up @@ -277,13 +270,13 @@ namespace pcl
protected:

/** \brief A pointer to the input normals */
PointCloudNConstPtr normals_;
PointCloudNConstPtr normals_{nullptr};

/** \brief The minimum number of inliers required for each plane. */
unsigned min_inliers_{1000};

/** \brief The tolerance in radians for difference in normal direction between neighboring points, to be considered part of the same plane. */
double angular_threshold_;
double angular_threshold_{pcl::deg2rad (3.0)};

/** \brief The tolerance in meters for difference in perpendicular distance (d component of plane equation) to the plane between neighboring points, to be considered part of the same plane. */
double distance_threshold_{0.02};
Expand All @@ -295,10 +288,10 @@ namespace pcl
bool project_points_{false};

/** \brief A comparator for comparing neighboring pixels' plane equations. */
PlaneComparatorPtr compare_;
PlaneComparatorPtr compare_{new PlaneComparator};

/** \brief A comparator for use on the refinement step. Compares points to regions segmented in the first pass. */
PlaneRefinementComparatorPtr refinement_compare_;
PlaneRefinementComparatorPtr refinement_compare_{new PlaneRefinementComparatorPtr};

/** \brief Class getName method. */
virtual std::string
Expand Down
8 changes: 2 additions & 6 deletions segmentation/include/pcl/segmentation/sac_segmentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ namespace pcl
* \param[in] random if true set the random seed to the current time, else set to 12345 (default: false)
*/
SACSegmentation(bool random = false)
: model_()
, sac_()
, random_(random)
: random_(random)
{}

/** \brief Empty destructor. */
Expand Down Expand Up @@ -335,8 +333,6 @@ namespace pcl
*/
SACSegmentationFromNormals (bool random = false)
: SACSegmentation<PointT> (random)
, normals_ ()

{};

/** \brief Provide a pointer to the input dataset that contains the point normals of
Expand Down Expand Up @@ -393,7 +389,7 @@ namespace pcl

protected:
/** \brief A pointer to the input dataset that contains the point normals of the XYZ dataset. */
PointCloudNConstPtr normals_;
PointCloudNConstPtr normals_{nullptr};

/** \brief The relative weight (between 0 and 1) to give to the angular
* distance (0 to pi/2) between point normals and the plane normal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,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};
Expand Down
10 changes: 4 additions & 6 deletions segmentation/include/pcl/segmentation/segment_differences.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ namespace pcl
using PointIndicesConstPtr = PointIndices::ConstPtr;

/** \brief Empty constructor. */
SegmentDifferences () :
tree_ (), target_ ()
{};
SegmentDifferences () = default;

/** \brief Provide a pointer to the target dataset against which we
* compare the input cloud given in setInputCloud
Expand Down Expand Up @@ -139,15 +137,15 @@ namespace pcl
using BasePCLBase::deinitCompute;

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

/** \brief The input target point cloud dataset. */
PointCloudConstPtr target_;
PointCloudConstPtr target_{nullptr};

/** \brief The distance tolerance (squared) as a measure in the L2
* Euclidean space between corresponding points.
*/
double distance_threshold_{0};
double distance_threshold_{0.0};

/** \brief Class getName method. */
virtual std::string
Expand Down
6 changes: 3 additions & 3 deletions segmentation/include/pcl/segmentation/unary_classifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,18 @@ namespace pcl


/** \brief Contains the input cloud */
typename pcl::PointCloud<PointT>::Ptr input_cloud_;
typename pcl::PointCloud<PointT>::Ptr input_cloud_{nullptr};

bool label_field_{false};

unsigned int cluster_size_;
unsigned int cluster_size_{0};

float normal_radius_search_{0.01f};
float fpfh_radius_search_{0.05f};
float feature_threshold_{5.0};


std::vector<pcl::PointCloud<pcl::FPFHSignature33>::Ptr> trained_features_;
std::vector<pcl::PointCloud<pcl::FPFHSignature33>::Ptr> trained_features_{};

/** \brief Contains normals of the points that will be segmented. */
//typename pcl::PointCloud<pcl::Normal>::Ptr normals_;
Expand Down
2 changes: 1 addition & 1 deletion tools/ply2ply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class ply_to_ply_converter

format_type format_;
pcl::io::ply::format_type input_format_{}, output_format_{};
bool bol_{};
bool bol_{false};
std::ostream* ostream_{};
};

Expand Down
6 changes: 1 addition & 5 deletions tools/ply2raw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ class ply_to_raw_converter
public:
ply_to_raw_converter() = default;

ply_to_raw_converter (const ply_to_raw_converter &f) :
ostream_ (), vertex_x_ (0), vertex_y_ (0), vertex_z_ (0),
face_vertex_indices_element_index_ (),
face_vertex_indices_first_element_ (),
face_vertex_indices_previous_element_ ()
ply_to_raw_converter (const ply_to_raw_converter &f)
{
*this = f;
}
Expand Down
Loading