diff --git a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp index cbd42788fcc..bbbdbdf2e93 100644 --- a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp +++ b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp @@ -20,6 +20,23 @@ int main(int argc, char* argv[]) return EXIT_FAILURE; } + // Internal color property maps are used if they exist and are called "v:color", "e:color" and "f:color". + auto vcm = sm.add_property_map("v:color").first; + auto ecm = sm.add_property_map("e:color").first; + auto fcm = sm.add_property_map("f:color", CGAL::IO::white() /*default*/).first; + + for(auto v : vertices(sm)) + { + if(v.idx()%2) + put(vcm, v, CGAL::IO::black()); + else + put(vcm, v, CGAL::IO::blue()); + } + + for(auto e : edges(sm)) + put(ecm, e, CGAL::IO::gray()); + + // Draw! CGAL::draw(sm); return EXIT_SUCCESS;