Я пытаюсь использовать метод isotropic_remeshing в CGAL с Многогранником_3. Но я получаю ошибки компилятора, которые я не понимаю. Это минимальный пример:
#include <iostream>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polygon_mesh_processing/remesh.h>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point_3;
typedef CGAL::Polyhedron_3<Kernel> Meshtype;
typedef Meshtype::Halfedge_handle Halfedge_handle;
int main()
{
Meshtype* plane = new Meshtype;
Halfedge_handle h = plane->make_triangle(Point_3(0.0, 0.0, 0.0),
Point_3(1.0, 1.0, 0.0),
Point_3(0.0, 1.0, 0.0));
//split triangle at (p1, p3) edge and insert p2.
Halfedge_handle h_new = plane->split_edge(h->next());
h_new->vertex()->point() = Point_3(1.0, 0.0, 0.0);
CGAL::Polygon_mesh_processing::isotropic_remeshing (
faces(*plane),
0.3,
*plane);
std::cout << plane->size_of_vertices();
delete plane;
}
Это приводит к ошибке компилятора:
In file included from /usr/include/boost/graph/named_function_params.hpp:26:0,
from /home/tom/cgal-releases-CGAL-4.11/BGL/include/CGAL/boost/graph/named_function_params.h:58,
from /home/tom/cgal-releases-CGAL-4.11/HalfedgeDS/include/CGAL/boost/graph/graph_traits_HalfedgeDS.h:26,
from /home/tom/cgal-releases-CGAL-4.11/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h:26,
from /home/tom/cgal-releases-CGAL-4.11/Polyhedron/include/CGAL/Polyhedron_3.h:1543,
from /home/tom/dev/tmp/main.cpp:4:
/usr/include/boost/property_map/shared_array_property_map.hpp: In instantiation of ‘class boost::shared_array_property_map<boost::default_color_type, bool>’:
/usr/include/boost/graph/depth_first_search.hpp:325:80: required from ‘void boost::graph::detail::depth_first_search_impl<Graph>::operator()(const Graph&, const ArgPack&) const [with ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::detail::components_recorder<CGAL::internal::Dynamic_property_map<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > >, long unsigned int> > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const bool>, boost::parameter::aux::empty_arg_list> >; Graph = boost::filtered_graph<CGAL::Dual<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> > >, CGAL::Polygon_mesh_processing::internal::No_border<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >, CGAL::Polygon_mesh_processing::internal::Border_constraint_pmap<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >, CGAL::Iterator_range<CGAL::Prevent_deref<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > > > >, bool> >, boost::keep_all>]’
/usr/include/boost/graph/depth_first_search.hpp:330:5: required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type boost::graph::depth_first_search_with_named_params(const Param0&, const ArgPack&) [with Param0 = boost::filtered_graph<CGAL::Dual<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> > >, CGAL::Polygon_mesh_processing::internal::No_border<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >, CGAL::Polygon_mesh_processing::internal::Border_constraint_pmap<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >, CGAL::Iterator_range<CGAL::Prevent_deref<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > > > >, bool> >, boost::keep_all>; ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::detail::components_recorder<CGAL::internal::Dynamic_property_map<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > >, long unsigned int> > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const bool>, boost::parameter::aux::empty_arg_list> >; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type = void]’
/usr/include/boost/graph/depth_first_search.hpp:333:3: required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type boost::depth_first_search(const Param0&, const boost::bgl_named_params<T, Tag, Base>&) [with Param0 = boost::filtered_graph<CGAL::Dual<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> > >, CGAL::Polygon_mesh_processing::internal::No_border<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >, CGAL::Polygon_mesh_processing::internal::Border_constraint_pmap<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >, CGAL::Iterator_range<CGAL::Prevent_deref<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > > > >, bool> >, boost::keep_all>; P = boost::detail::components_recorder<CGAL::internal::Dynamic_property_map<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > >, long unsigned int> >; T = boost::graph_visitor_t; R = boost::bgl_named_params<bool, boost::vertex_index_t, boost::no_property>; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type = void]’
/usr/include/boost/graph/connected_components.hpp:76:23: required from ‘typename boost::property_traits<IndexMap>::value_type boost::connected_components(const Graph&, ComponentMap, const boost::bgl_named_params<P, T, R>&, typename boost::enable_if_c<(boost::is_base_and_derived<boost::vertex_list_graph_tag, typename boost::graph_traits<Graph>::traversal_category>::value), boost::graph::detail::no_parameter>::type) [with Graph = boost::filtered_graph<CGAL::Dual<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> > >, CGAL::Polygon_mesh_processing::internal::No_border<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >, CGAL::Polygon_mesh_processing::internal::Border_constraint_pmap<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >, CGAL::Iterator_range<CGAL::Prevent_deref<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > > > >, bool> >, boost::keep_all>; ComponentMap = CGAL::internal::Dynamic_property_map<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > >, long unsigned int>; P = bool; T = boost::vertex_index_t; R = boost::no_property; typename boost::property_traits<IndexMap>::value_type = long unsigned int; typename boost::enable_if_c<(boost::is_base_and_derived<boost::vertex_list_graph_tag, typename boost::graph_traits<Graph>::traversal_category>::value), boost::graph::detail::no_parameter>::type = boost::graph::detail::no_parameter]’
/home/tom/cgal-releases-CGAL-4.11/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h:238:37: required from ‘typename boost::property_traits<IndexMap>::value_type CGAL::Polygon_mesh_processing::connected_components(const PolygonMesh&, FaceComponentMap, const NamedParameters&) [with PolygonMesh = CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >; FaceComponentMap = CGAL::internal::Dynamic_property_map<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > >, long unsigned int>; NamedParameters = CGAL::pmp_bgl_named_params<bool, CGAL::internal_np::face_index_t, CGAL::pmp_bgl_named_params<CGAL::Polygon_mesh_processing::internal::Border_constraint_pmap<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >, CGAL::Iterator_range<CGAL::Prevent_deref<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > > > >, bool>, CGAL::internal_np::edge_is_constrained_t, boost::no_property> >; typename boost::property_traits<IndexMap>::value_type = long unsigned int]’
/home/tom/cgal-releases-CGAL-4.11/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h:193:38: required from ‘CGAL::Polygon_mesh_processing::internal::Connected_components_pmap<PM, EdgeIsConstrainedMap, FaceIndexMap>::Connected_components_pmap(PM&, EdgeIsConstrainedMap, CGAL::Polygon_mesh_processing::internal::Connected_components_pmap<PM, EdgeIsConstrainedMap, FaceIndexMap>::FIMap, bool) [with PM = CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >; EdgeIsConstrainedMap = CGAL::Polygon_mesh_processing::internal::Border_constraint_pmap<CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >, CGAL::Iterator_range<CGAL::Prevent_deref<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > > > >, bool>; FaceIndexMap = bool; CGAL::Polygon_mesh_processing::internal::Connected_components_pmap<PM, EdgeIsConstrainedMap, FaceIndexMap>::FIMap = bool]’
/home/tom/cgal-releases-CGAL-4.11/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h:181:29: required from ‘void CGAL::Polygon_mesh_processing::isotropic_remeshing(const FaceRange&, const double&, PolygonMesh&, const NamedParameters&) [with PolygonMesh = CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >; FaceRange = CGAL::Iterator_range<CGAL::Prevent_deref<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > > > >; NamedParameters = CGAL::pmp_bgl_named_params<bool, CGAL::internal_np::all_default_t>]’
/home/tom/cgal-releases-CGAL-4.11/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h:264:22: required from ‘void CGAL::Polygon_mesh_processing::isotropic_remeshing(const FaceRange&, const double&, PolygonMesh&) [with PolygonMesh = CGAL::Polyhedron_3<CGAL::Simple_cartesian<double> >; FaceRange = CGAL::Iterator_range<CGAL::Prevent_deref<CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > > > >]’
/home/tom/dev/tmp/main.cpp:31:19: required from here
/usr/include/boost/property_map/shared_array_property_map.hpp:23:56: error: no type named ‘key_type’ in ‘struct boost::property_traits<bool>’
typedef typename property_traits<IndexMap>::key_type key_type;
^
Я не уверен, что не так с моим вызовом isotropic_remeshing. В примерах, предоставленных CGAL, используется структура данных surface_mesh, но в моем случае необходим Polyhedron_3. Спасибо за любую помощь!