Then the for-loop iterating over every point in
|
for(size_t i = 0; i < pointCloudPCL.points.size(); ++i) |
|
{ |
|
pointCloudPCL.points[i].x = data(i).point.x; // NOLINT(cppcoreguidelines-pro-type-union-access) |
|
pointCloudPCL.points[i].y = data(i).point.y; // NOLINT(cppcoreguidelines-pro-type-union-access) |
|
pointCloudPCL.points[i].z = data(i).point.z; // NOLINT(cppcoreguidelines-pro-type-union-access) |
|
pointCloudPCL.points[i].r = data(i).color.r; // NOLINT(cppcoreguidelines-pro-type-union-access) |
|
pointCloudPCL.points[i].g = data(i).color.g; // NOLINT(cppcoreguidelines-pro-type-union-access) |
|
pointCloudPCL.points[i].b = data(i).color.b; // NOLINT(cppcoreguidelines-pro-type-union-access) |
|
} |
will become a one-liner running void copyData(DataFormat *destination) const.
This is already possible copying Zivid::PointXYZW into pcl::PointXYZ, but not for more complex pcl types.
This would require the Zivid SDK to support more composed data formats, matching some of the PCL data types.
Then the for-loop iterating over every point in
zivid-cpp-samples/source/Applications/Basic/Visualization/CaptureWritePCLVis3D/CaptureWritePCLVis3D.cpp
Lines 54 to 62 in cc2828d
will become a one-liner running
void copyData(DataFormat *destination) const.This is already possible copying
Zivid::PointXYZWintopcl::PointXYZ, but not for more complex pcl types.This would require the Zivid SDK to support more composed data formats, matching some of the PCL data types.