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

Replace '.points.' with just '.' #4217

Merged
merged 12 commits into from
Sep 7, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class CVFHEstimation : public GlobalEstimator<PointInT, FeatureT> {

for (std::size_t i = 0; i < cvfh_signatures.size(); i++) {
pcl::PointCloud<FeatureT> vfh_signature;
vfh_signature.points.resize(1);
vfh_signature.resize(1);
vfh_signature.width = vfh_signature.height = 1;
for (int d = 0; d < 308; ++d)
vfh_signature[0].histogram[d] = cvfh_signatures[i].histogram[d];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class OURCVFHEstimator : public GlobalEstimator<PointInT, FeatureT> {

for (const auto& point : cvfh_signatures.points) {
pcl::PointCloud<FeatureT> vfh_signature;
vfh_signature.points.resize(1);
vfh_signature.resize(1);
vfh_signature.width = vfh_signature.height = 1;
for (int d = 0; d < 308; ++d)
vfh_signature[0].histogram[d] = point.histogram[d];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class UniformSamplingExtractor : public KeypointExtractor<PointInT> {
neighborhood_dist_.reset(new std::vector<std::vector<float>>);
neighborhood_dist_->resize(keypoints_cloud->size());

filtered_keypoints.points.resize(keypoints_cloud->size());
filtered_keypoints.resize(keypoints_cloud->size());
int good = 0;

for (std::size_t i = 0; i < keypoints_cloud->size(); i++) {
Expand Down
8 changes: 4 additions & 4 deletions apps/src/manual_registration/manual_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void
ManualRegistration::confirmSrcPointPressed()
{
if (src_point_selected_) {
src_pc_.points.push_back(src_point_);
src_pc_.push_back(src_point_);
PCL_INFO("Selected %zu source points\n",
static_cast<std::size_t>(src_pc_.size()));
src_point_selected_ = false;
Expand All @@ -170,7 +170,7 @@ void
ManualRegistration::confirmDstPointPressed()
{
if (dst_point_selected_) {
dst_pc_.points.push_back(dst_point_);
dst_pc_.push_back(dst_point_);
PCL_INFO("Selected %zu destination points\n",
static_cast<std::size_t>(dst_pc_.size()));
dst_point_selected_ = false;
Expand Down Expand Up @@ -198,8 +198,8 @@ ManualRegistration::clearPressed()
{
dst_point_selected_ = false;
src_point_selected_ = false;
src_pc_.points.clear();
dst_pc_.points.clear();
src_pc_.clear();
dst_pc_.clear();
src_pc_.height = 1;
src_pc_.width = 0;
dst_pc_.height = 1;
Expand Down
6 changes: 3 additions & 3 deletions apps/src/openni_shift_to_depth_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ class SimpleOpenNIViewer {
std::size_t cloud_size = width_arg * height_arg;

// Reset point cloud
cloud_arg.points.clear();
cloud_arg.points.reserve(cloud_size);
cloud_arg.clear();
cloud_arg.reserve(cloud_size);

// Define point cloud parameters
cloud_arg.width = static_cast<std::uint32_t>(width_arg);
Expand Down Expand Up @@ -198,7 +198,7 @@ class SimpleOpenNIViewer {
}

// Add point to cloud
cloud_arg.points.push_back(newPoint);
cloud_arg.push_back(newPoint);
// Increment point iterator
++i;
}
Expand Down
6 changes: 3 additions & 3 deletions apps/src/openni_tracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ class OpenNISegmentTracking {
point.y = (*cloud)[i].y;
point.z = (*cloud)[i].z;
point.rgba = (*cloud)[i].rgba;
result.points.push_back(point);
result.push_back(point);
}
}

Expand Down Expand Up @@ -476,7 +476,7 @@ class OpenNISegmentTracking {
if (!(std::abs(point.x) < 0.01 && std::abs(point.y) < 0.01 &&
std::abs(point.z) < 0.01) &&
!std::isnan(point.x) && !std::isnan(point.y) && !std::isnan(point.z))
result.points.push_back(point);
result.push_back(point);
}

result.width = result.size();
Expand All @@ -493,7 +493,7 @@ class OpenNISegmentTracking {
pcl::PointIndices segmented_indices = cluster_indices[segment_index];
for (const int& index : segmented_indices.indices) {
PointType point = (*cloud)[index];
result.points.push_back(point);
result.push_back(point);
}
result.width = result.size();
result.height = 1;
Expand Down
4 changes: 2 additions & 2 deletions common/include/pcl/common/impl/gaussian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ GaussianKernel::convolveRows(const pcl::PointCloud<PointT> &input,
{
output.width = input.width;
output.height = input.height;
output.points.resize (input.height * input.width);
output.resize (input.height * input.width);
}

int i;
Expand Down Expand Up @@ -91,7 +91,7 @@ GaussianKernel::convolveCols(const pcl::PointCloud<PointT> &input,
{
output.width = input.width;
output.height = input.height;
output.points.resize (input.height * input.width);
output.resize (input.height * input.width);
}

int j;
Expand Down
16 changes: 8 additions & 8 deletions common/include/pcl/common/impl/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
cloud_out.is_dense = cloud_in.is_dense;
cloud_out.sensor_orientation_ = cloud_in.sensor_orientation_;
cloud_out.sensor_origin_ = cloud_in.sensor_origin_;
cloud_out.points.resize (cloud_in.size ());
cloud_out.resize (cloud_in.size ());

if (cloud_in.points.empty ())
if (cloud_in.empty ())
return;

if (isSamePointType<PointInT, PointOutT> ())
Expand All @@ -156,7 +156,7 @@ copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
}

// Allocate enough space and copy the basics
cloud_out.points.resize (indices.size ());
cloud_out.resize (indices.size ());
cloud_out.header = cloud_in.header;
cloud_out.width = indices.size ();
cloud_out.height = 1;
Expand All @@ -176,7 +176,7 @@ copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
pcl::PointCloud<PointOutT> &cloud_out)
{
// Allocate enough space and copy the basics
cloud_out.points.resize (indices.size ());
cloud_out.resize (indices.size ());
cloud_out.header = cloud_in.header;
cloud_out.width = indices.size ();
cloud_out.height = 1;
Expand All @@ -203,7 +203,7 @@ copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
}

// Allocate enough space and copy the basics
cloud_out.points.resize (indices.indices.size ());
cloud_out.resize (indices.indices.size ());
cloud_out.header = cloud_in.header;
cloud_out.width = indices.indices.size ();
cloud_out.height = 1;
Expand Down Expand Up @@ -243,7 +243,7 @@ copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
}

// Allocate enough space and copy the basics
cloud_out.points.resize (nr_p);
cloud_out.resize (nr_p);
cloud_out.header = cloud_in.header;
cloud_out.width = nr_p;
cloud_out.height = 1;
Expand Down Expand Up @@ -282,7 +282,7 @@ copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
}

// Allocate enough space and copy the basics
cloud_out.points.resize (nr_p);
cloud_out.resize (nr_p);
cloud_out.header = cloud_in.header;
cloud_out.width = nr_p;
cloud_out.height = 1;
Expand Down Expand Up @@ -319,7 +319,7 @@ concatenateFields (const pcl::PointCloud<PointIn1T> &cloud1_in,
}

// Resize the output dataset
cloud_out.points.resize (cloud1_in.size ());
cloud_out.resize (cloud1_in.size ());
cloud_out.header = cloud1_in.header;
cloud_out.width = cloud1_in.width;
cloud_out.height = cloud1_in.height;
Expand Down
16 changes: 8 additions & 8 deletions common/include/pcl/common/impl/transforms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ transformPointCloud (const pcl::PointCloud<PointT> &cloud_in,
cloud_out.is_dense = cloud_in.is_dense;
cloud_out.width = cloud_in.width;
cloud_out.height = cloud_in.height;
cloud_out.points.reserve (cloud_in.size ());
cloud_out.reserve (cloud_in.size ());
if (copy_all_fields)
cloud_out.points.assign (cloud_in.points.begin (), cloud_in.points.end ());
cloud_out.assign (cloud_in.begin (), cloud_in.end ());
else
cloud_out.points.resize (cloud_in.size ());
cloud_out.resize (cloud_in.size ());
cloud_out.sensor_orientation_ = cloud_in.sensor_orientation_;
cloud_out.sensor_origin_ = cloud_in.sensor_origin_;
}
Expand Down Expand Up @@ -274,7 +274,7 @@ transformPointCloud (const pcl::PointCloud<PointT> &cloud_in,
cloud_out.header = cloud_in.header;
cloud_out.width = static_cast<int> (npts);
cloud_out.height = 1;
cloud_out.points.resize (npts);
cloud_out.resize (npts);
cloud_out.sensor_orientation_ = cloud_in.sensor_orientation_;
cloud_out.sensor_origin_ = cloud_in.sensor_origin_;

Expand Down Expand Up @@ -321,11 +321,11 @@ transformPointCloudWithNormals (const pcl::PointCloud<PointT> &cloud_in,
cloud_out.width = cloud_in.width;
cloud_out.height = cloud_in.height;
cloud_out.is_dense = cloud_in.is_dense;
cloud_out.points.reserve (cloud_out.size ());
cloud_out.reserve (cloud_out.size ());
if (copy_all_fields)
cloud_out.points.assign (cloud_in.points.begin (), cloud_in.points.end ());
cloud_out.assign (cloud_in.begin (), cloud_in.end ());
else
cloud_out.points.resize (cloud_in.size ());
cloud_out.resize (cloud_in.size ());
cloud_out.sensor_orientation_ = cloud_in.sensor_orientation_;
cloud_out.sensor_origin_ = cloud_in.sensor_origin_;
}
Expand Down Expand Up @@ -369,7 +369,7 @@ transformPointCloudWithNormals (const pcl::PointCloud<PointT> &cloud_in,
cloud_out.header = cloud_in.header;
cloud_out.width = static_cast<int> (npts);
cloud_out.height = 1;
cloud_out.points.resize (npts);
cloud_out.resize (npts);
cloud_out.sensor_orientation_ = cloud_in.sensor_orientation_;
cloud_out.sensor_origin_ = cloud_in.sensor_origin_;

Expand Down
2 changes: 1 addition & 1 deletion common/include/pcl/conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ namespace pcl

// Copy point data
std::uint32_t num_points = msg.width * msg.height;
cloud.points.resize (num_points);
cloud.resize (num_points);
std::uint8_t* cloud_data = reinterpret_cast<std::uint8_t*>(&cloud[0]);

// Check if we can copy adjacent points in a single memcpy. We can do so if there
Expand Down
2 changes: 1 addition & 1 deletion common/include/pcl/point_cloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ namespace pcl

// libstdc++ (GCC) on calling reserve allocates new memory, copies and deallocates old vector
// This causes a drastic performance hit. Prefer not to use reserve with libstdc++ (default on clang)
cloud1.points.insert (cloud1.points.end (), cloud2.points.begin (), cloud2.points.end ());
cloud1.insert (cloud1.end (), cloud2.begin (), cloud2.end ());

cloud1.width = cloud1.size ();
cloud1.height = 1;
Expand Down
14 changes: 7 additions & 7 deletions common/include/pcl/point_types_conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ namespace pcl
{
Intensity p;
PointRGBtoI (point, p);
out.points.push_back (p);
out.push_back (p);
}
}

Expand All @@ -272,7 +272,7 @@ namespace pcl
{
Intensity8u p;
PointRGBtoI (point, p);
out.points.push_back (p);
out.push_back (p);
}
}

Expand All @@ -290,7 +290,7 @@ namespace pcl
{
Intensity32u p;
PointRGBtoI (point, p);
out.points.push_back (p);
out.push_back (p);
}
}

Expand All @@ -308,7 +308,7 @@ namespace pcl
{
PointXYZHSV p;
PointXYZRGBtoXYZHSV (point, p);
out.points.push_back (p);
out.push_back (p);
}
}

Expand All @@ -326,7 +326,7 @@ namespace pcl
{
PointXYZHSV p;
PointXYZRGBAtoXYZHSV (point, p);
out.points.push_back (p);
out.push_back (p);
}
}

Expand All @@ -344,7 +344,7 @@ namespace pcl
{
PointXYZI p;
PointXYZRGBtoXYZI (point, p);
out.points.push_back (p);
out.push_back (p);
}
}

Expand Down Expand Up @@ -386,7 +386,7 @@ namespace pcl
pt.g = image.at (u, v).g;
pt.b = image.at (u, v).b;

out.points.push_back (pt);
out.push_back (pt);
}
}
out.width = width_;
Expand Down
4 changes: 2 additions & 2 deletions common/src/gaussian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ pcl::GaussianKernel::convolveRows (const pcl::PointCloud<float>& input,
{
output.width = input.width;
output.height = input.height;
output.points.resize (input.height * input.width);
output.resize (input.height * input.width);
}
unaliased_input = &input;
}
Expand Down Expand Up @@ -190,7 +190,7 @@ pcl::GaussianKernel::convolveCols (const pcl::PointCloud<float>& input,
{
output.width = input.width;
output.height = input.height;
output.points.resize (input.height * input.width);
output.resize (input.height * input.width);
}
unaliased_input = &input;
}
Expand Down
10 changes: 5 additions & 5 deletions common/src/range_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ RangeImage::getHalfImage (RangeImage& half_image) const
half_image.width = width/2;
half_image.height = height/2;
half_image.is_dense = is_dense;
half_image.points.clear ();
half_image.points.resize (half_image.width*half_image.height);
half_image.clear ();
half_image.resize (half_image.width*half_image.height);

int src_start_x = 2*half_image.image_offset_x_ - image_offset_x_,
src_start_y = 2*half_image.image_offset_y_ - image_offset_y_;
Expand Down Expand Up @@ -395,8 +395,8 @@ RangeImage::getSubImage (int sub_image_image_offset_x, int sub_image_image_offse
sub_image.width = sub_image_width;
sub_image.height = sub_image_height;
sub_image.is_dense = is_dense;
sub_image.points.clear ();
sub_image.points.resize (sub_image.width*sub_image.height);
sub_image.clear ();
sub_image.resize (sub_image.width*sub_image.height);

int src_start_x = combine_pixels*sub_image.image_offset_x_ - image_offset_x_,
src_start_y = combine_pixels*sub_image.image_offset_y_ - image_offset_y_;
Expand Down Expand Up @@ -850,7 +850,7 @@ RangeImage::extractFarRanges (const pcl::PCLPointCloud2& point_cloud_data,
PointWithViewpoint point;
point.x=distance; point.y=y; point.z=z;
point.vp_x=vp_x; point.vp_y=vp_y; point.vp_z=vp_z;
far_ranges.points.push_back (point);
far_ranges.push_back (point);
}
}
far_ranges.width= far_ranges.size (); far_ranges.height = 1;
Expand Down
2 changes: 1 addition & 1 deletion cuda/apps/src/kinect_normals_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class NormalEstimation
{
pcl::PointCloud<pcl::PointXYZRGB>::Ptr output (new pcl::PointCloud<pcl::PointXYZRGB>);
PointCloudAOS<Host> data_host;
data_host.points.resize (cloud->points.size());
data_host.resize (cloud->points.size());
for (std::size_t i = 0; i < cloud->points.size (); ++i)
{
PointXYZRGB pt;
Expand Down
2 changes: 1 addition & 1 deletion cuda/apps/src/kinect_ransac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SimpleKinectTool
pcl::ScopeTime ttt ("all");
pcl::PointCloud<pcl::PointXYZRGB>::Ptr output (new pcl::PointCloud<pcl::PointXYZRGB>);
PointCloudAOS<Host> data_host;
data_host.points.resize (cloud->points.size());
data_host.resize (cloud->points.size());
for (std::size_t i = 0; i < cloud->points.size (); ++i)
{
PointXYZRGB pt;
Expand Down
2 changes: 1 addition & 1 deletion cuda/apps/src/kinect_segmentation_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Segmentation
{
pcl::PointCloud<pcl::PointXYZRGB>::Ptr output (new pcl::PointCloud<pcl::PointXYZRGB>);
PointCloudAOS<Host> data_host;
data_host.points.resize (cloud->points.size());
data_host.resize (cloud->points.size());
for (std::size_t i = 0; i < cloud->points.size (); ++i)
{
PointXYZRGB pt;
Expand Down
Loading