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> 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;
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_ The marching cubes surface reconstruction algorithm.
MarchingCubesHoppe()
Constructor.
Eigen::Vector4f min_p_
Min and max data points.
void voxelizeData()
Convert the point cloud into voxel data.
Define standard C methods and C++ classes that are common to all methods.
~MarchingCubesHoppe()
Destructor.
int res_x_
The grid resolution.
std::vector< float > grid_
The data structure storing the 3D grid.
PointCloudConstPtr input_
The input point cloud dataset.
KdTreePtr tree_
A pointer to the spatial search object.