38 #ifndef PCL_SURFACE_GRID_PROJECTION_H_
39 #define PCL_SURFACE_GRID_PROJECTION_H_
41 #include <pcl/surface/boost.h>
42 #include <pcl/surface/reconstruction.h>
48 {0, 4}, {1, 5}, {2, 6}, {3, 7},
49 {0, 1}, {1, 2}, {2, 3}, {3, 0},
50 {4, 5}, {5, 6}, {6, 7}, {7, 4}
71 template <
typename Po
intNT>
75 typedef boost::shared_ptr<GridProjection<PointNT> >
Ptr;
76 typedef boost::shared_ptr<const GridProjection<PointNT> >
ConstPtr;
96 typedef boost::unordered_map<int, Leaf, boost::hash<int>, std::equal_to<int>, Eigen::aligned_allocator<int> >
HashMap;
115 leaf_size_ = resolution;
136 padding_size_ = padding_size;
141 return (padding_size_);
166 max_binary_search_level_ = max_binary_search_level;
171 return (max_binary_search_level_);
178 return (cell_hash_map_);
181 inline const std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> >&
184 return (vector_at_data_point_);
187 inline const std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >&
230 std::vector<pcl::Vertices> &polygons);
248 for (
int i = 0; i < 3; ++i)
249 index[i] = static_cast<int> ((p[i] - min_p_(i)) / leaf_size_);
260 for (
int i = 0; i < 3; ++i)
262 min_p_[i] + static_cast<float> (index[i]) *
263 static_cast<float> (leaf_size_) +
264 static_cast<float> (leaf_size_) / 2.0f;
273 std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> > &pts)
const;
283 return (index[0] * data_size_ * data_size_ +
284 index[1] * data_size_ + index[2]);
296 index_3d[0] = index_1d / (data_size_ * data_size_);
297 index_1d -= index_3d[0] * data_size_ * data_size_;
298 index_3d[1] = index_1d / data_size_;
299 index_1d -= index_3d[1] * data_size_;
300 index_3d[2] = index_1d;
308 fillPad (
const Eigen::Vector3i &index);
315 getDataPtsUnion (
const Eigen::Vector3i &index, std::vector <int> &pt_union_indices);
335 getProjection (
const Eigen::Vector4f &p, std::vector<int> &pt_union_indices, Eigen::Vector4f &projection);
346 std::vector<int> &pt_union_indices,
347 Eigen::Vector4f &projection);
357 std::vector <int> &pt_union_indices, Eigen::Vector3f &vo);
368 std::vector<int> &k_indices,
369 std::vector<float> &k_squared_distances,
370 Eigen::Vector3f &vo);
377 getMagAtPoint (
const Eigen::Vector4f &p,
const std::vector <int> &pt_union_indices);
385 getD1AtPoint (
const Eigen::Vector4f &p,
const Eigen::Vector3f &vec,
386 const std::vector <int> &pt_union_indices);
394 getD2AtPoint (
const Eigen::Vector4f &p,
const Eigen::Vector3f &vec,
395 const std::vector <int> &pt_union_indices);
406 isIntersected (
const std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> > &end_pts,
407 std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > &vect_at_end_pts,
408 std::vector <int> &pt_union_indices);
420 const std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> > &end_pts,
421 const std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > &vect_at_end_pts,
422 const Eigen::Vector4f &start_pt,
423 std::vector<int> &pt_union_indices,
424 Eigen::Vector4f &intersection);
442 std::vector<int> &pt_union_indices,
const Leaf &cell_data);
465 Eigen::Vector4f min_p_, max_p_;
471 double gaussian_scale_;
477 int max_binary_search_level_;
489 std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > vector_at_data_point_;
492 std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> > surface_;
495 boost::dynamic_bitset<> occupied_cell_list_;
498 std::string getClassName ()
const {
return (
"GridProjection"); }
501 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
505 #endif // PCL_SURFACE_GRID_PROJECTION_H_