autorefine_and_remove_self_intersections: Error C2665 'CGAL::get': none of the 3 overloads could convert all the argument types

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

autorefine_and_remove_self_intersections: Error C2665 'CGAL::get': none of the 3 overloads could convert all the argument types

sergio
I have the following code:

bool repairOBJFile(std::string & fileName)
{
        clock_t begin = clock();

        std::cout << std::endl;
        std::cout << std::endl;

        std::cout << "..........................................................."
<< std::endl;
        std::cout << ".                        Reapairing                       ."
<< std::endl;
        std::cout << "..........................................................."
<< std::endl;

        std::ifstream input(fileName);
        if (!input)
        {
                std::cerr << "Cannot open file " << std::endl;
                return false;
        }

        std::vector<Kernel::Point_3> points;
        std::vector< std::vector<std::size_t> > polygons;
        if (!CGAL::read_OBJ(input, points, polygons))
        {
                std::cerr << "Error parsing the OFF file " << std::endl;
                return false;
        }
        //Mesh mesh;
        Polyhedron mesh;
        CGAL::Polygon_mesh_processing::orient_polygon_soup(points, polygons);
        CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points,
polygons, mesh);


        bool solved =
CGAL::Polygon_mesh_processing::experimental::autorefine_and_remove_self_intersections(mesh);
        if (!solved)
        {
                std::cout << "Some self-intersection could not be fixed" << std::endl;
                //return false;
        }

        addStringToFileName(fileName, "_fixed.obj");
        std::ofstream ofs(fileName);
        CGAL::print_polyhedron_wavefront(ofs, mesh);

        clock_t end = clock();
        double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;

        std::cout << std::endl;
        std::cout << std::endl;

        std::cout << "Repairing time:.................." << elapsed_secs << "
seconds."<<" = " << elapsed_secs/60<<"min"<< std::endl;

        return true;
}

the result of the compilation is the following messages:

Severity Code Description Project File Line Suppression State
Error C2665 'CGAL::get': none of the 3 overloads could convert all the
argument types cgal_vtk_test
C:\dev\CGAL-4.12\include\CGAL\Polygon_mesh_processing\internal\Corefinement\Output_builder_for_autorefinement.h
317

Severity Code Description Project File Line Suppression State
Error C2039 'key_type': is not a member of 'boost::property_traits<KeyMap>'
cgal_vtk_test C:\dev\CGAL-4.12\include\CGAL\property_map.h 111

Severity Code Description Project File Line Suppression State
Error C3646 'key_type': unknown override specifier cgal_vtk_test
C:\dev\CGAL-4.12\include\CGAL\property_map.h 111


Severity Code Description Project File Line Suppression State
Error C4430 missing type specifier - int assumed. Note: C++ does not support
default-int cgal_vtk_test C:\dev\CGAL-4.12\include\CGAL\property_map.h 111


Severity Code Description Project File Line Suppression State
Error C2665
'CGAL::Property_map_binder<FaceIdMap,boost::iterator_property_map&lt;T
*,boost::typed_identity_property_map&lt;T>,T,T &>>::get': none of the 5
overloads could convert all the argument types cgal_vtk_test
C:\dev\CGAL-4.12\include\CGAL\Polygon_mesh_processing\internal\Corefinement\Output_builder_for_autorefinement.h
415

whats wrong?

Thanks in adavance





--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: autorefine_and_remove_self_intersections: Error C2665 'CGAL::get': none of the 3 overloads could convert all the argument types

Sebastien Loriot (GeometryFactory)
Reminder: this is not an officially documented function but as indicated
in the inline documentation:

  *   \cgalParamBegin{face_index_map} a property map containing the
index of each face of `tm` \cgalParamEnd


So a face index map for your polyhedron type must be provided since
it does not have a default (while Surface_mesh does).

Look at dynamic property for example:
https://doc.cgal.org/latest/BGL/index.html#title25

Sebastien.


On 06/27/2018 01:25 PM, sergio wrote:

> I have the following code:
>
> bool repairOBJFile(std::string & fileName)
> {
> clock_t begin = clock();
>
> std::cout << std::endl;
> std::cout << std::endl;
>
> std::cout << "..........................................................."
> << std::endl;
> std::cout << ".                        Reapairing                       ."
> << std::endl;
> std::cout << "..........................................................."
> << std::endl;
>
> std::ifstream input(fileName);
> if (!input)
> {
> std::cerr << "Cannot open file " << std::endl;
> return false;
> }
>
> std::vector<Kernel::Point_3> points;
> std::vector< std::vector<std::size_t> > polygons;
> if (!CGAL::read_OBJ(input, points, polygons))
> {
> std::cerr << "Error parsing the OFF file " << std::endl;
> return false;
> }
> //Mesh mesh;
> Polyhedron mesh;
> CGAL::Polygon_mesh_processing::orient_polygon_soup(points, polygons);
> CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points,
> polygons, mesh);
>
>
> bool solved =
> CGAL::Polygon_mesh_processing::experimental::autorefine_and_remove_self_intersections(mesh);
> if (!solved)
> {
> std::cout << "Some self-intersection could not be fixed" << std::endl;
> //return false;
> }
>
> addStringToFileName(fileName, "_fixed.obj");
> std::ofstream ofs(fileName);
> CGAL::print_polyhedron_wavefront(ofs, mesh);
>
> clock_t end = clock();
> double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
>
> std::cout << std::endl;
> std::cout << std::endl;
>
> std::cout << "Repairing time:.................." << elapsed_secs << "
> seconds."<<" = " << elapsed_secs/60<<"min"<< std::endl;
>
> return true;
> }
>
> the result of the compilation is the following messages:
>
> Severity Code Description Project File Line Suppression State
> Error C2665 'CGAL::get': none of the 3 overloads could convert all the
> argument types cgal_vtk_test
> C:\dev\CGAL-4.12\include\CGAL\Polygon_mesh_processing\internal\Corefinement\Output_builder_for_autorefinement.h
> 317
>
> Severity Code Description Project File Line Suppression State
> Error C2039 'key_type': is not a member of 'boost::property_traits<KeyMap>'
> cgal_vtk_test C:\dev\CGAL-4.12\include\CGAL\property_map.h 111
>
> Severity Code Description Project File Line Suppression State
> Error C3646 'key_type': unknown override specifier cgal_vtk_test
> C:\dev\CGAL-4.12\include\CGAL\property_map.h 111
>
>
> Severity Code Description Project File Line Suppression State
> Error C4430 missing type specifier - int assumed. Note: C++ does not support
> default-int cgal_vtk_test C:\dev\CGAL-4.12\include\CGAL\property_map.h 111
>
>
> Severity Code Description Project File Line Suppression State
> Error C2665
> 'CGAL::Property_map_binder<FaceIdMap,boost::iterator_property_map&lt;T
> *,boost::typed_identity_property_map&lt;T>,T,T &>>::get': none of the 5
> overloads could convert all the argument types cgal_vtk_test
> C:\dev\CGAL-4.12\include\CGAL\Polygon_mesh_processing\internal\Corefinement\Output_builder_for_autorefinement.h
> 415
>
> whats wrong?
>
> Thanks in adavance
>
>
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss