#include "mesher_tester.h" #include #include /* DOMAIN */ typedef CGAL::Image_3 Image; typedef CGAL::Labeled_image_mesh_domain_3 Image_domain; /* TRIANGULATION */ typedef CGAL::Mesh_triangulation_3::type Tr_image; typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3_image; /* MESHING CRITERIA */ typedef CGAL::Mesh_criteria_3 Mesh_criteria_image; /** Builds the image domain from the image name */ template <> class Domain_builder { typedef Image_domain Domain; public: Domain_builder(const std::string& str) : domain_(NULL) { image_.read(str.c_str()); domain_ = new Domain(image_, 1e-6); } ~Domain_builder() { delete domain_; } Domain& domain() { return *domain_; } std::vector::iterator points_begin() { CGAL_error_msg("No input point in 3D image (wrong --off_vertices option?)"); } std::vector::iterator points_end() { CGAL_error_msg("No input point in 3D image (wrong --off_vertices option?)"); } C3t3_image::Index points_index() { return C3t3_image::Index(); } private: Domain* domain_; Image image_; }; int main(int argc, char** argv) { int nb_threads; std::string outdir; // options po::options_description generic("Options"); generic.add_options() ("help", "Produce help message") ("threads", po::value(&nb_threads)->default_value(2), "Run threads") ("outdir", po::value(&outdir)->default_value("tester_output"), "Output directory. is location"); po::options_description cmdline_options("Usage", 1); cmdline_options.add(generic); po::variables_map vm; po::store(po::parse_command_line(argc, argv, cmdline_options), vm); po::notify(vm); if(vm.count("help")) { std::cout << cmdline_options << std::endl; std::cout << "* Images: .inr.gz files should be in data/3D_images\n"; std::cout << " Note: for each file toto.domain, add a toto.txt file with meshing parameters\n\n"; return 1; } // iterate on data files std::string data_img("data/3D_images/"); // or a user defined path... mesh(data_img,outdir,nb_threads); return 0; }