73 scalars->SetNumberOfComponents (3);
75 vtkIdType nr_points =
static_cast<vtkIdType
>(
cloud_->size ());
76 reinterpret_cast<vtkUnsignedCharArray*
>(&(*scalars))->SetNumberOfTuples (nr_points);
77 unsigned char* colors =
reinterpret_cast<vtkUnsignedCharArray*
>(&(*scalars))->GetPointer (0);
80 if (nr_points !=
static_cast<vtkIdType
>(rgb_->size ()))
81 std::fill_n(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;