36 #ifndef PCL_SURFACE_IMPL_MARCHING_CUBES_HOPPE_H_
37 #define PCL_SURFACE_IMPL_MARCHING_CUBES_HOPPE_H_
39 #include <pcl/surface/marching_cubes_hoppe.h>
40 #include <pcl/common/common.h>
41 #include <pcl/common/vector_average.h>
42 #include <pcl/Vertices.h>
43 #include <pcl/kdtree/kdtree_flann.h>
46 template <
typename Po
intNT>
53 template <
typename Po
intNT>
60 template <
typename Po
intNT>
void
63 for (
int x = 0; x < res_x_; ++x)
64 for (
int y = 0; y < res_y_; ++y)
65 for (
int z = 0; z < res_z_; ++z)
67 std::vector<int> nn_indices;
68 std::vector<float> nn_sqr_dists;
70 Eigen::Vector3f point;
71 point[0] = min_p_[0] + (max_p_[0] - min_p_[0]) *
float (x) / float (res_x_);
72 point[1] = min_p_[1] + (max_p_[1] - min_p_[1]) *
float (y) / float (res_y_);
73 point[2] = min_p_[2] + (max_p_[2] - min_p_[2]) *
float (z) / float (res_z_);
76 p.getVector3fMap () = point;
78 tree_->nearestKSearch (p, 1, nn_indices, nn_sqr_dists);
80 grid_[x * res_y_*res_z_ + y * res_z_ + z] = input_->points[nn_indices[0]].getNormalVector3fMap ().dot (
81 point - input_->points[nn_indices[0]].getVector3fMap ());
87 #define PCL_INSTANTIATE_MarchingCubesHoppe(T) template class PCL_EXPORTS pcl::MarchingCubesHoppe<T>;
89 #endif // PCL_SURFACE_IMPL_MARCHING_CUBES_HOPPE_H_
void voxelizeData()
Convert the point cloud into voxel data.
~MarchingCubesHoppe()
Destructor.
The marching cubes surface reconstruction algorithm.
MarchingCubesHoppe()
Constructor.