c++ - Poisson Reconstruction Function not compiling -
i trying implement poisson reconstruction function in cgal , however, bombarded whole host of errors.
i know line causing errors line:
poisson_reconstruction_function function(points.begin(), points.end(),cgal::first_of_pair_property_map<pointvectorpair>(),cgal::second_of_pair_property_map<pointvectorpair>());
this not on documentation, have this:
poisson_reconstruction_function function(points.begin(), points.end(), cgal::make_normal_of_point_with_normal_pmap(pointlist::value_type()) );
but line comes whole host of errors.
any appreciated, , please let me know if need more information!
thanks!
here full code:
(header file)
#ifndef __tutorials__cgaldelaunaytriangulation__ #define __tutorials__cgaldelaunaytriangulation__ #include <stdio.h> #include <cgal/exact_predicates_inexact_constructions_kernel.h> #include <cgal/exact_predicates_exact_constructions_kernel.h> #include <cgal/triangulation_3.h> #include <cgal/delaunay_triangulation_3.h> #include <cgal/polyhedron_3.h> #include <cgal/convex_hull_3_to_polyhedron_3.h> #include <iostream> #include <fstream> #include <cassert> #include <list> #include <vector> #include "bufferactions.h" #include <ros/console.h> #include "ros/ros.h" #include <eigen/dense> #include <cgal/trace.h> #include <cgal/io/polyhedron_iostream.h> #include <cgal/surface_mesh_default_triangulation_3.h> #include <cgal/make_surface_mesh.h> #include <cgal/implicit_surface_3.h> #include <cgal/io/output_surface_facets_to_polyhedron.h> #include <cgal/poisson_reconstruction_function.h> #include <cgal/point_with_normal_3.h> #include <cgal/property_map.h> #include <cgal/io/read_xyz_points.h> #include <cgal/compute_average_spacing.h> #include <cgal/pca_estimate_normals.h> #include <cgal/mst_orient_normals.h> #include <cgal/property_map.h> #include <utility> #include <cgal/cartesian.h> #include <algorithm> using namespace std; typedef cgal::exact_predicates_inexact_constructions_kernel kernel; typedef cgal::delaunay_triangulation_3<kernel> triangulation; typedef cgal::polyhedron_3<kernel> polyhedron_3; typedef triangulation::cell_handle cell_handle; typedef triangulation::vertex_handle vertex_handle; typedef triangulation::locate_type locate_type; typedef polyhedron_3::vertex_iterator vertex_iterator; typedef polyhedron_3::halfedge_around_facet_circulator hf_circulator; //typedef triangulation::point point; typedef cgal::triangulation_3<cgal::epick, cgal::default> triangulation_3; typedef kernel::ft ft; typedef kernel::point_3 point; typedef kernel::vector_3 vector; typedef cgal::point_with_normal_3<kernel> point_with_normal; typedef kernel::sphere_3 sphere; typedef cgal::poisson_reconstruction_function<kernel> poisson_reconstruction_function; typedef cgal::surface_mesh_default_triangulation_3 str; typedef cgal::surface_mesh_complex_2_in_triangulation_3<str> c2t3; typedef cgal::implicit_surface_3<kernel, poisson_reconstruction_function> surface_3; typedef pair<point, vector> pointvectorpair; typedef std::vector<point_with_normal> pointlist; class cgaldelaunay { public: static void triangulateusingcgal(vector<vector<float> > * pointstobeinserted, triangulation * t, vector<float> *bufferpointer, int*totalvertices); static point transform_vector_to_point(vector<float> tempvec); }; #endif
and cpp file:
#include "mesh_map/cgaldelaunaytriangulation.h" using eigen::matrixxd; // cgaldelaunay::triangulateusingcgal(vector<vertex_handle> * delaunaytriangulationvertices, vector<vector<float> > * pointstobeinserted, triangulation * t, vector<float> *bufferpointer, vector<float> *colorpointer, int*totalvertices); void cgaldelaunay::triangulateusingcgal(vector<vector<float> > * pointstobeinserted, triangulation * t, vector<float> *bufferpointer, int*totalvertices) { ft sm_angle = 20.0; // min triangle angle in degrees. ft sm_radius = 30; // max triangle size w.r.t. point set average spacing. ft sm_distance = 0.375; // surface approximation error w.r.t. point set average spacing. std::list<pointvectorpair> points; // estimates normals direction. // note: pca_estimate_normals() requires iterator on points // property maps access each point's position , normal. for(int = 0; i<pointstobeinserted->size();i++) { vector<float> tempvec = pointstobeinserted->at(i); points.push_back(make_pair(point(tempvec.at(0),tempvec.at(1),tempvec.at(2)), vector(0.0,0.0,0.0))); } ros_info("before estimating normal"); const int nb_neighbors = 12; // k-nearest neighbors = 3 rings cgal::pca_estimate_normals(points.begin(), points.end(), cgal::first_of_pair_property_map<pointvectorpair>(), cgal::second_of_pair_property_map<pointvectorpair>(), nb_neighbors); ros_info("after estimating normal"); // orients normals. // note: mst_orient_normals() requires iterator on points // property maps access each point's position , normal. ros_info("before orienting normals"); std::list<pointvectorpair>::iterator unoriented_points_begin = cgal::mst_orient_normals(points.begin(), points.end(), cgal::first_of_pair_property_map<pointvectorpair>(), cgal::second_of_pair_property_map<pointvectorpair>(), nb_neighbors); ros_info("after orienting normals"); poisson_reconstruction_function function(points.begin(), points.end(),cgal::first_of_pair_property_map<pointvectorpair>(),cgal::second_of_pair_property_map<pointvectorpair>()); }
and full error message:
in file included /usr/include/cgal/io/output_surface_facets_to_polyhedron.h:25:0, /home/mrsl_student/git/catkin_ws/src/mesh_map/include/mesh_map/cgaldelaunaytriangulation.h:28, /home/mrsl_student/git/catkin_ws/src/mesh_map/src/cgaldelaunaytriangulation.cpp:3: /usr/include/cgal/value_type_traits.h: in instantiation of ‘struct cgal::value_type_traits<cgal::point_with_normal_3<cgal::epick> >’: /usr/include/cgal/point_with_normal_3.h:165:1: required substitution of ‘template<class iter> cgal::normal_of_point_with_normal_pmap<typename cgal::kernel_traits<typename cgal::value_type_traits<t>::type>::kernel> cgal::make_normal_of_point_with_normal_pmap(iter) [with iter = cgal::point_with_normal_3<cgal::epick>]’ /home/mrsl_student/git/catkin_ws/src/mesh_map/src/cgaldelaunaytriangulation.cpp:47:140: required here /usr/include/cgal/value_type_traits.h:40:56: error: no type named ‘value_type’ in ‘struct std::iterator_traits<cgal::point_with_normal_3<cgal::epick> >’ typedef typename std::iterator_traits<t>::value_type type; ^ /home/mrsl_student/git/catkin_ws/src/mesh_map/src/cgaldelaunaytriangulation.cpp: in static member function ‘static void cgaldelaunay::triangulateusingcgal(std::vector<std::vector<float> >*, triangulation*, std::vector<float>*, int*)’: /home/mrsl_student/git/catkin_ws/src/mesh_map/src/cgaldelaunaytriangulation.cpp:47:140: error: no matching function call ‘make_normal_of_point_with_normal_pmap(std::vector<cgal::point_with_normal_3<cgal::epick> >::value_type)’ poisson_reconstruction_function function(points.begin(), points.end(), cgal::make_normal_of_point_with_normal_pmap(pointlist::value_type())); ^ /home/mrsl_student/git/catkin_ws/src/mesh_map/src/cgaldelaunaytriangulation.cpp:47:140: note: candidate is: in file included /usr/include/cgal/reconstruction_triangulation_3.h:25:0, /usr/include/cgal/poisson_reconstruction_function.h:35, /home/mrsl_student/git/catkin_ws/src/mesh_map/include/mesh_map/cgaldelaunaytriangulation.h:29, /home/mrsl_student/git/catkin_ws/src/mesh_map/src/cgaldelaunaytriangulation.cpp:3: /usr/include/cgal/point_with_normal_3.h:165:1: note: template<class iter> cgal::normal_of_point_with_normal_pmap<typename cgal::kernel_traits<typename cgal::value_type_traits<t>::type>::kernel> cgal::make_normal_of_point_with_normal_pmap(iter) make_normal_of_point_with_normal_pmap(iter)
Comments
Post a Comment