how can I store collapsed edges using CGAL

classic Classic list List threaded Threaded
1 message Options
nm
Reply | Threaded
Open this post in threaded view
|

how can I store collapsed edges using CGAL

nm
'm creating an application on QT-creator and using CGAL to read .off file as
Linear_cell_complex_for_bgl_combinatorial_map_helper and simplify it using
edge_collapse method . I want to store the list of collapsed edges,incident
vertices, position of points , and other needed information to re-insert the
removed edges again .
, my code :

struct Stats
{
  Stats() :  collapsed(0) {}
  std::size_t collapsed ;
} ;

struct My_visitor : SMS::Edge_collapse_visitor_base<LCC>
{

My_visitor( Stats* s) : stats(s){}
void OnCollapsed( Profile const& , vertex_descriptor )
  {
    ++ stats->collapsed;

Profile::halfedge_descriptor();
  }

Stats* stats ;

void OnCollapsing(Profile const&  profile,boost::optional<Point> placement
)
{
  std::cout << "My_visitor::OnCollapsing()" << std::endl;
* std::cout <<( profile.v0()) << " will collapse into "<< profile.v1() <<
std::endl;*
}
};
void MainWindow ::simplify()
{
My_visitor vis(&stats) ;

 int r = SMS::edge_collapse
   (lcc
    ,stop
    ,CGAL::parameters::halfedge_index_map(get(CGAL::halfedge_index, lcc))
             .vertex_index_map(get(boost::vertex_index, lcc))
             .get_cost(SMS::Edge_length_cost<LCC>())
   .get_placement(SMS::Midpoint_placement<LCC>()).visitor(vis)
    );

 std::cout << "\nEdges collapsed: "  << stats.collapsed
            << std::endl;
}

it's shows the following error :
no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka
‘std::basic_ostream’} and ‘const vertex_descriptor’ in the bolded code line




--
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