Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Import .mesh to c3t3 object

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Import .mesh to c3t3 object


Chronological Thread 
  • From: thiago <>
  • To:
  • Subject: Re: [cgal-discuss] Import .mesh to c3t3 object
  • Date: Sun, 18 Jan 2015 01:00:43 -0800 (PST)

Hi everyone,

This is a snippet of what I need:


#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Mesh_3/Robust_intersection_traits_3.h>
#include <CGAL/Mesh_triangulation_3.h>
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Polyhedral_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/refine_mesh_3.h>
#include <CGAL/IO/io.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include 
#include "Config.h"
#include "IteraFormatos.h"


typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Mesh_3::Robust_intersection_traits_3 Geom_traits;
typedef CGAL::Polyhedron_3 Polyhedron;
typedef CGAL::Polyhedral_mesh_domain_3<Polyhedron, Geom_traits> Mesh_domain;
#ifdef CGAL_CONCURRENT_MESH_3
    typedef CGAL::Mesh_triangulation_3<
    Mesh_domain,
    CGAL::Kernel_traits::Kernel, // Same as sequential
    CGAL::Parallel_tag // Tag to activate parallelism
    >::type Tr;
    #else
    typedef CGAL::Mesh_triangulation_3::type Tr;
#endif
typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3;
typedef CGAL::Mesh_criteria_3 Mesh_criteria;

using namespace CGAL::parameters;    
using namespace std;



int main() {
    //information about the mesh
    Config objConfig;
    IteraFormatos objIteraFormatos(objConfig); 

    Polyhedron polyhedron;
    ifstream input(objConfig.get_surf_mesh_path().c_str());
    input >> polyhedron;

    Mesh_domain domain(polyhedron);

    Mesh_criteria criteria(facet_angle = 5, facet_size = 0.90, facet_distance = 0.03, cell_radius_edge_ratio = 2);

    C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude());  

    ofstream c3t3_save("test.c3t3"); 
    c3t3_save<<c3t3.triangulation(); 
    c3t3_save.close(); 
    C3t3 new_c3t3;
    ifstream c3t3_load("test.c3t3");
    c3t3_load >> new_c3t3.triangulation();    
    return 0;
}

but I get dozens of errors, starting with these:

In file included from /usr/include/CGAL/Mesh_triangulation_3.h:35:0,
                 from main.cpp:4:
/usr/include/CGAL/Compact_mesh_cell_base_3.h: In instantiation of ‘std::ostream& CGAL::operator<<(std::ostream&, const CGAL::Compact_mesh_cell_base_3<GT, MT, Cb>&) [with GT = CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >; MT = CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> >, CGAL::Mesh_3::Robust_intersection_traits_3 >; Cb = CGAL::Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> >, CGAL::Mesh_3::Robust_intersection_traits_3 >, CGAL::Triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >, CGAL::Triangulation_ds_vertex_base_3 > >, CGAL::Compact_mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> >, CGAL::Mesh_3::Robust_intersection_traits_3 >, void>, CGAL::Sequential_tag>; std::ostream = std::basic_ostream]’:
/usr/include/CGAL/Triangulation_3.h:2210:12:   required from ‘std::ostream& CGAL::operator<<(std::ostream&, const CGAL::Triangulation_3<GT, Tds, Lds>&) [with GT = CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >; Tds = CGAL::Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> >, CGAL::Mesh_3::Robust_intersection_traits_3 >, CGAL::Triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >, CGAL::Triangulation_ds_vertex_base_3 > >, CGAL::Compact_mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> >, CGAL::Mesh_3::Robust_intersection_traits_3 >, void>, CGAL::Sequential_tag>; Lds = CGAL::Default; std::ostream = std::basic_ostream]’
main.cpp:54:35:   required from here
/usr/include/CGAL/Compact_mesh_cell_base_3.h:690:17: error: no match for ‘operator<<’ (operand types are ‘std::basic_ostream’ and ‘CGAL::Compact_mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> >, CGAL::Mesh_3::Robust_intersection_traits_3 >, CGAL::Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> >, CGAL::Mesh_3::Robust_intersection_traits_3 >, CGAL::Triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >, CGAL::Triangulation_ds_vertex_base_3 > >, CGAL::Compact_mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3_new<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> > >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> >, CGAL::Mesh_3::Robust_intersection_traits_3 >, void>, CGAL::Sequential_tag> >::Surface_patch_index {aka std::pair<int, int>}’)
       os << ' ' << c.surface_patch_index(i);
                 ^
/usr/include/CGAL/Compact_mesh_cell_base_3.h:690:17: note: candidates are:
In file included from /usr/include/c++/4.8/iostream:39:0,
                 from /usr/include/CGAL/basic.h:31,
                 from /usr/include/CGAL/Cartesian/Cartesian_base.h:28,
                 from /usr/include/CGAL/Simple_cartesian.h:28,
                 from /usr/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:28,
                 from main.cpp:2:
/usr/include/c++/4.8/ostream:108:7: note: std::basic_ostream::__ostream_type& std::basic_ostream::operator<<(std::basic_ostream::__ostream_type& (*)(std::basic_ostream::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits; std::basic_ostream::__ostream_type = std::basic_ostream]
       operator<<(__ostream_type& (*__pf)(__ostream_type&))
       ^

Thanks!

1 Thiago_de_Sousa_Goveia
2 {
3    //The mind that opens to a new idea never returns to its original size - Albert Einstein
4    Graduating in Computer Engineering;
5    CEFET_MG, Brazil;
6    /* PHONES:
7     +55 (31) 8749-1459 - OI
8     +55 (31) 7511-6439 - TIM
9   */
10 };


View this message in context: Re: Import .mesh to c3t3 object
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page