40#include <pcl/point_cloud.h>
41#include <pcl/visualization/point_cloud_handlers.h>
45 namespace visualization
47 template <
typename Po
intT>
73 scalars->SetNumberOfComponents (3);
80 if (nr_points !=
static_cast<vtkIdType>(rgb_->size ()))
81 std::fill(colors, colors + nr_points * 3, (
unsigned char)0xFF);
83 for (
vtkIdType cp = 0; cp < nr_points; ++cp)
86 colors[idx + 0] = (*rgb_)[cp].r;
87 colors[idx + 1] = (*rgb_)[cp].g;
88 colors[idx + 2] = (*rgb_)[cp].b;
94 std::string getFieldName ()
const override {
return (
"rgb"); }
95 inline std::string getName ()
const override {
return (
"PointCloudColorHandlerRGBHack"); }
96 RgbCloudConstPtr rgb_;
Iterator class for point clouds with or without given indices.
shared_ptr< const PointCloud< PointT > > ConstPtr
Base Handler class for PointCloud colors.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
PointCloudConstPtr cloud_
A pointer to the input dataset.
vtkSmartPointer< vtkDataArray > getColor() const override
Obtain the actual color for the input dataset as a VTK data array.
PointCloudColorHandlerRGBHack(const PointCloudConstPtr &cloud, const RgbCloudConstPtr &colors)
Defines all the PCL implemented PointT point type structures.
A point structure representing Euclidean xyz coordinates, and the RGB color.