Update examples (tabs vs spaces)

This commit is contained in:
Ílker Yaz 2012-08-22 15:54:56 +00:00
parent fcfc79dfc7
commit f08b0bd1fb
4 changed files with 31 additions and 27 deletions

View File

@ -33,8 +33,9 @@ int main(int argc, char **argv)
boost::associative_property_map<Facet_int_map> segment_property_map(internal_segment_map); boost::associative_property_map<Facet_int_map> segment_property_map(internal_segment_map);
// calculate SDF values and segment the mesh using default parameters. // calculate SDF values and segment the mesh using default parameters.
CGAL::surface_mesh_segmentation(mesh, segment_property_map); int number_of_segments = CGAL::surface_mesh_segmentation(mesh, segment_property_map);
std::cout << "Number of segments: " << number_of_segments << std::endl;
// print segment-ids // print segment-ids
for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin();
facet_it != mesh.facets_end(); ++facet_it) facet_it != mesh.facets_end(); ++facet_it)

View File

@ -50,13 +50,15 @@ int main(int argc, char **argv)
std::cerr << argv[1] << " is not a valid off file.\n"; std::cerr << argv[1] << " is not a valid off file.\n";
return 1; return 1;
} }
// assign id field for each facet // assign id field for each facet
int facet_id = 0; int facet_id = 0;
for(Polyhedron::Facet_iterator facet_it = mesh.facets_begin(); facet_it != mesh.facets_end(); for(Polyhedron::Facet_iterator facet_it = mesh.facets_begin();
++facet_it, ++facet_id) facet_it != mesh.facets_end(); ++facet_it, ++facet_id)
{ {
facet_it->id() = facet_id; facet_it->id() = facet_id;
} }
// create a property-map for sdf values // create a property-map for sdf values
std::vector<double> sdf_values(mesh.size_of_facets()); std::vector<double> sdf_values(mesh.size_of_facets());
Polyhedron_with_id_to_vector_property_map<Polyhedron, double> sdf_property_map(&sdf_values); Polyhedron_with_id_to_vector_property_map<Polyhedron, double> sdf_property_map(&sdf_values);
@ -68,6 +70,7 @@ int main(int argc, char **argv)
{ {
std::cout << (sdf_property_map[facet_it] == sdf_values[facet_it->id()]) << std::endl; std::cout << (sdf_property_map[facet_it] == sdf_values[facet_it->id()]) << std::endl;
} }
// create a property-map for segment-ids // create a property-map for segment-ids
std::vector<double> segment_ids(mesh.size_of_facets()); std::vector<double> segment_ids(mesh.size_of_facets());
Polyhedron_with_id_to_vector_property_map<Polyhedron, double> segment_property_map(&segment_ids); Polyhedron_with_id_to_vector_property_map<Polyhedron, double> segment_property_map(&segment_ids);