40 #ifndef PCL_POINT_CLOUD_GEOMETRY_HANDLERS_IMPL_HPP_
41 #define PCL_POINT_CLOUD_GEOMETRY_HANDLERS_IMPL_HPP_
49 namespace visualization
52 template <
typename Po
intT>
69 template <
typename Po
intT>
void
77 points->SetDataTypeToFloat ();
80 data->SetNumberOfComponents (3);
81 vtkIdType nr_points = cloud_->size ();
85 float* pts =
static_cast<float*
> (malloc (nr_points * 3 *
sizeof (
float)));
90 for (vtkIdType i = 0; i < nr_points; ++i)
92 pts[i * 3 + 0] = (*cloud_)[i].x;
93 pts[i * 3 + 1] = (*cloud_)[i].y;
94 pts[i * 3 + 2] = (*cloud_)[i].z;
96 data->SetArray (&pts[0], nr_points * 3, 0);
97 points->SetData (data);
102 for (vtkIdType i = 0; i < nr_points; ++i)
105 if (!std::isfinite ((*cloud_)[i].x) || !std::isfinite ((*cloud_)[i].y) || !std::isfinite ((*cloud_)[i].z))
108 pts[j * 3 + 0] = (*cloud_)[i].x;
109 pts[j * 3 + 1] = (*cloud_)[i].y;
110 pts[j * 3 + 2] = (*cloud_)[i].z;
114 data->SetArray (&pts[0], j * 3, 0);
115 points->SetData (data);
120 template <
typename Po
intT>
137 template <
typename Po
intT>
void
145 points->SetDataTypeToFloat ();
146 points->SetNumberOfPoints (cloud_->size ());
150 for (vtkIdType i = 0; i < static_cast<vtkIdType> (cloud_->size ()); ++i)
152 p[0] = (*cloud_)[i].normal[0];
153 p[1] = (*cloud_)[i].normal[1];
154 p[2] = (*cloud_)[i].normal[2];
156 points->SetPoint (i, p);
163 #define PCL_INSTANTIATE_PointCloudGeometryHandlerXYZ(T) template class PCL_EXPORTS pcl::visualization::PointCloudGeometryHandlerXYZ<T>;
164 #define PCL_INSTANTIATE_PointCloudGeometryHandlerSurfaceNormal(T) template class PCL_EXPORTS pcl::visualization::PointCloudGeometryHandlerSurfaceNormal<T>;
166 #endif // PCL_POINT_CLOUD_GEOMETRY_HANDLERS_IMPL_HPP_