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>
42 template <
typename Po
intNT>
49 template <
typename Po
intNT>
void
52 const bool is_far_ignored = dist_ignore_ > 0.0f;
54 for (
int x = 0; x < res_x_; ++x)
56 const int y_start = x * res_y_ * res_z_;
58 for (
int y = 0; y < res_y_; ++y)
60 const int z_start = y_start + y * res_z_;
62 for (
int z = 0; z < res_z_; ++z)
65 std::vector<float> nn_sqr_dists (1, 0.0f);
66 const Eigen::Vector3f point = (lower_boundary_ + size_voxel_ * Eigen::Array3f (x, y, z)).matrix ();
69 p.getVector3fMap () = point;
71 tree_->nearestKSearch (p, 1, nn_indices, nn_sqr_dists);
73 if (!is_far_ignored || nn_sqr_dists[0] < dist_ignore_)
75 const Eigen::Vector3f normal = (*input_)[nn_indices[0]].getNormalVector3fMap ();
77 if (!std::isnan (normal (0)) && normal.norm () > 0.5f)
78 grid_[z_start + z] = normal.dot (
79 point - (*input_)[nn_indices[0]].getVector3fMap ());
88 #define PCL_INSTANTIATE_MarchingCubesHoppe(T) template class PCL_EXPORTS pcl::MarchingCubesHoppe<T>;
90 #endif // PCL_SURFACE_IMPL_MARCHING_CUBES_HOPPE_H_