Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <CGAL/make_mesh_3.h>
#include <CGAL/Image_3.h>
#include <functional>
#include <CGAL/Real_timer.h>

typedef float Image_word_type;

Expand All @@ -28,6 +29,7 @@ using namespace CGAL::parameters;

int main(int argc, char*argv[])
{
CGAL::Real_timer timer; timer.start();
const char* fname = (argc>1)?argv[1]:"data/skull_2.9.inr";
// Load image
CGAL::Image_3 image;
Expand All @@ -51,5 +53,6 @@ int main(int argc, char*argv[])
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_3D_gray_image_multiple_values.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Real_timer.h>

#include <CGAL/Mesh_triangulation_3.h>
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
Expand Down Expand Up @@ -42,6 +43,7 @@ struct Image_to_multiple_iso_level_sets {

int main(int argc, char*argv[])
{
CGAL::Real_timer timer; timer.start();
const char* fname = (argc>1)?argv[1]:"data/skull_2.9.inr";
// Load image
CGAL::Image_3 image;
Expand Down Expand Up @@ -81,5 +83,6 @@ int main(int argc, char*argv[])
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
4 changes: 4 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <boost/lexical_cast.hpp>
#include <boost/functional.hpp>

#include <iostream>

typedef short Image_word_type;

// Domain
Expand All @@ -45,6 +47,7 @@ class Less {

int main(int argc, char* argv[])
{
CGAL::Real_timer timer; timer.start();
// Loads image
if(argc == 1){
std::cerr << "Usage: " << argv[0] << " <directory with dicom data> iso_level=1 facet_size=1 facet_distance=0.1 cell_size=1\n";
Expand Down Expand Up @@ -99,5 +102,6 @@ int main(int argc, char* argv[])
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
4 changes: 3 additions & 1 deletion Mesh_3/examples/Mesh_3/mesh_3D_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/Image_3.h>

#include <CGAL/Real_timer.h>
// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Labeled_mesh_domain_3<K> Mesh_domain;
Expand All @@ -31,6 +31,7 @@ using namespace CGAL::parameters;

int main(int argc, char* argv[])
{
CGAL::Real_timer timer; timer.start();
/// [Loads image]
const char* fname = (argc>1)?argv[1]:"data/liver.inr.gz";
CGAL::Image_3 image;
Expand All @@ -56,5 +57,6 @@ int main(int argc, char* argv[])
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
4 changes: 3 additions & 1 deletion Mesh_3/examples/Mesh_3/mesh_3D_image_variable_size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/Image_3.h>

#include <CGAL/Real_timer.h>
// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Labeled_mesh_domain_3<K> Mesh_domain;
Expand All @@ -36,6 +36,7 @@ using namespace CGAL::parameters;

int main(int argc, char* argv[])
{
CGAL::Real_timer timer; timer.start();
const char* fname = (argc>1)?argv[1]:"data/liver.inr.gz";
// Loads image
CGAL::Image_3 image;
Expand Down Expand Up @@ -65,5 +66,6 @@ int main(int argc, char* argv[])
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <CGAL/Image_3.h>

#include <CGAL/Mesh_3/Dump_c3t3.h>

#include <CGAL/Real_timer.h>
// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Labeled_mesh_domain_3<K> Mesh_domain;
Expand All @@ -36,6 +36,7 @@ using namespace CGAL::parameters;

int main()
{
CGAL::Real_timer timer; timer.start();
/// [Create the image]
CGAL::Image_3 image = random_labeled_image();
/// [Create the image]
Expand All @@ -60,5 +61,6 @@ int main()
// Output
CGAL::dump_c3t3(c3t3, "out");

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_3D_image_with_features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Mesh_domain_with_polyline_features_3.h>
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/Real_timer.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Labeled_mesh_domain_3<K> Image_domain;
Expand Down Expand Up @@ -72,6 +73,7 @@ bool add_1D_features(const CGAL::Image_3& image,

int main(int argc, char* argv[])
{
CGAL::Real_timer timer; timer.start();
const char* fname = (argc>1)?argv[1]:"data/420.inr";
// Loads image
CGAL::Image_3 image;
Expand Down Expand Up @@ -104,5 +106,6 @@ int main(int argc, char* argv[])
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <CGAL/Implicit_to_labeling_function_wrapper.h>
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/Real_timer.h>

// IO
#include <CGAL/IO/File_medit.h>
Expand Down Expand Up @@ -61,6 +62,7 @@ double cube_function_2 (const Point& p)

int main()
{
CGAL::Real_timer timer; timer.start();
// Define functions
Function f1 = cube_function_1;
Function f2 = cube_function_2;
Expand Down Expand Up @@ -93,5 +95,6 @@ int main()
std::ofstream medit_file("out_cubes_intersection.mesh");
CGAL::output_to_medit(medit_file, c3t3);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/Mesh_domain_with_polyline_features_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/Real_timer.h>

// IO
#include <CGAL/IO/File_medit.h>
Expand Down Expand Up @@ -145,6 +146,7 @@ void create_polylines (Polylines& polylines)

int main()
{
CGAL::Real_timer timer; timer.start();
// Define functions
Function f1 = cube_function_1;
Function f2 = cube_function_2;
Expand Down Expand Up @@ -180,5 +182,6 @@ int main()
std::ofstream medit_file("out_cubes_intersection_with_features.mesh");
CGAL::output_to_medit(medit_file, c3t3);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <CGAL/Mesh_domain_with_polyline_features_3.h>
#include <CGAL/make_mesh_3.h>

#include <CGAL/Real_timer.h>
// Ouput
#include <CGAL/Mesh_3/Dump_c3t3.h>

Expand Down Expand Up @@ -195,6 +196,7 @@ using namespace CGAL::parameters;

int main()
{
CGAL::Real_timer timer; timer.start();
const char* fname = "data/cube.off";
// Create input polyhedron
Polyhedron polyhedron;
Expand Down Expand Up @@ -245,5 +247,6 @@ int main()
// Output
dump_c3t3(c3t3, "out");

std::cout << timer.time() << "sec" << std::endl;
return EXIT_SUCCESS;
}
3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include "implicit_functions.h"
#include <CGAL/Real_timer.h>

// IO
#include <CGAL/IO/File_medit.h>
Expand All @@ -34,6 +35,7 @@ typedef Mesh_criteria::Cell_criteria Cell_criteria;

int main()
{
CGAL::Real_timer timer; timer.start();
// Define functions
Function f1(&torus_function);
Function f2(&sphere_function<3>);
Expand Down Expand Up @@ -63,5 +65,6 @@ int main()
std::ofstream medit_file("out.mesh");
CGAL::output_to_medit(medit_file, c3t3);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include "implicit_functions.h"
#include <CGAL/Real_timer.h>

// IO
#include <CGAL/IO/File_medit.h>
Expand All @@ -34,6 +35,7 @@ typedef Mesh_criteria::Cell_criteria Cell_criteria;

int main()
{
CGAL::Real_timer timer; timer.start();
// Define functions
Function f1(&torus_function);
Function f2(&sphere_function<3>);
Expand Down Expand Up @@ -71,5 +73,6 @@ int main()
std::ofstream medit_file("out.mesh");
CGAL::output_to_medit(medit_file, c3t3);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <CGAL/make_mesh_3.h>
#include <CGAL/perturb_mesh_3.h>
#include <CGAL/exude_mesh_3.h>
#include <CGAL/Real_timer.h>

// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
Expand Down Expand Up @@ -40,6 +41,7 @@ using namespace CGAL::parameters;

int main()
{
CGAL::Real_timer timer; timer.start();
// Domain (Warning: Sphere_3 constructor uses square radius !)
Mesh_domain domain =
Mesh_domain::create_implicit_mesh_domain(ellipsoid_function,
Expand Down Expand Up @@ -68,6 +70,7 @@ int main()
medit_file.open("out_optimized.mesh");
c3t3.output_to_medit(medit_file);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}

3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/Real_timer.h>

// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
Expand Down Expand Up @@ -37,6 +38,7 @@ FT sphere_function (const Point& p)

int main()
{
CGAL::Real_timer timer; timer.start();
/// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !)
Mesh_domain domain =
Mesh_domain::create_implicit_mesh_domain(sphere_function,
Expand All @@ -54,6 +56,7 @@ int main()
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}

3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>

#include <CGAL/Real_timer.h>
// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::FT FT;
Expand Down Expand Up @@ -51,6 +52,7 @@ FT sphere_function (const Point& p)

int main()
{
CGAL::Real_timer timer; timer.start();
/// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !)
namespace p = CGAL::parameters;
Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain
Expand All @@ -71,6 +73,7 @@ int main()
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}

3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/Image_3.h>
#include <CGAL/Real_timer.h>

// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
Expand All @@ -31,6 +32,7 @@ using namespace CGAL::parameters;

int main(int argc, char* argv[])
{
CGAL::Real_timer timer; timer.start();
const char* fname = (argc>1)?argv[1]:"data/liver.inr.gz";
// Domain
CGAL::Image_3 image;
Expand Down Expand Up @@ -64,5 +66,6 @@ int main(int argc, char* argv[])
std::ofstream medit_file_bis("out_bis.mesh");
c3t3_bis.output_to_medit(medit_file_bis);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
3 changes: 3 additions & 0 deletions Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/Image_3.h>
#include <CGAL/Real_timer.h>

// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
Expand All @@ -31,6 +32,7 @@ using namespace CGAL::parameters;

int main(int argc, char*argv[])
{
CGAL::Real_timer timer; timer.start();
const char* fname = (argc>1)?argv[1]:"data/liver.inr.gz";
// Domain
CGAL::Image_3 image;
Expand Down Expand Up @@ -64,5 +66,6 @@ int main(int argc, char*argv[])
std::ofstream medit_file_bis("out_bis.mesh");
c3t3_bis.output_to_medit(medit_file_bis);

std::cout << timer.time() << "sec" << std::endl;
return 0;
}
Loading