Skip to content

Commit

Permalink
Triangulation_2: Make IO save by changing file names
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Jan 2, 2024
1 parent 29c90e5 commit a2e3f9b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,52 +222,52 @@ _test_cls_constrained_triangulation(const Triang &)
/******** I/O *******/
std::cout << "output to a file" << std::endl;

std::ofstream of0_1("T01.triangulation", std::ios::out);
std::ofstream of0_1("T01ct.triangulation", std::ios::out);
CGAL::IO::set_ascii_mode(of0_1);
of0_1 << T0_1; of0_1.close();

std::ofstream of0_2("T02.triangulation");
std::ofstream of0_2("T02ct.triangulation");
CGAL::IO::set_ascii_mode(of0_2);
of0_2 << T0_2; of0_2.close();

std::ofstream of1_1("T11.triangulation");
std::ofstream of1_1("T11ct.triangulation");
CGAL::IO::set_ascii_mode(of1_1);
of1_1 << T1_1; of1_1.close();

std::ofstream of1_2("T12.triangulation");
std::ofstream of1_2("T12ct.triangulation");
CGAL::IO::set_ascii_mode(of1_2);
of1_2 << T1_2; of1_2.close();

std::ofstream of2_1("T21.triangulation");
std::ofstream of2_1("T21ct.triangulation");
CGAL::IO::set_ascii_mode(of2_1);
of2_1 << T2_1; of2_1.close();

std::ofstream of2_2("T22.triangulation");
std::ofstream of2_2("T22ct.triangulation");
CGAL::IO::set_ascii_mode(of2_2);
of2_2 << T2_2; of2_2.close();

std::cout << "input from a file" << std::endl;
std::ifstream if0_1("T01.triangulation"); CGAL::IO::set_ascii_mode(if0_1);
std::ifstream if0_1("T01ct.triangulation"); CGAL::IO::set_ascii_mode(if0_1);
Triang T0_1_copy; if0_1 >> T0_1_copy;

std::ifstream if0_2("T02.triangulation"); CGAL::IO::set_ascii_mode(if0_2);
std::ifstream if0_2("T02ct.triangulation"); CGAL::IO::set_ascii_mode(if0_2);
Triang T0_2_copy; if0_2 >> T0_2_copy;

std::ifstream if1_1("T11.triangulation"); CGAL::IO::set_ascii_mode(if1_1);
std::ifstream if1_1("T11ct.triangulation"); CGAL::IO::set_ascii_mode(if1_1);
Triang T1_1_copy; if1_1 >> T1_1_copy;

std::ifstream if1_2("T12.triangulation"); CGAL::IO::set_ascii_mode(if1_2);
std::ifstream if1_2("T12ct.triangulation"); CGAL::IO::set_ascii_mode(if1_2);
Triang T1_2_copy; if1_2 >> T1_2_copy;

std::ifstream if2_1("T21.triangulation"); CGAL::IO::set_ascii_mode(if2_1);
std::ifstream if2_1("T21ct.triangulation"); CGAL::IO::set_ascii_mode(if2_1);
Triang T2_1_copy; if2_1 >> T2_1_copy;

std::ifstream if2_2("T22.triangulation"); CGAL::IO::set_ascii_mode(if2_2);
std::ifstream if2_2("T22ct.triangulation"); CGAL::IO::set_ascii_mode(if2_2);
Triang T2_2_copy; if2_2 >> T2_2_copy;

// test copy of constrained Triangulation
Triang T2_4(T2_2);
std::ofstream of2_2_bis("T22.triangulation");
std::ofstream of2_2_bis("T22ct.triangulation");
CGAL::IO::set_ascii_mode(of2_2_bis);
of2_2_bis << T2_4; of2_2_bis.close();
All_faces_iterator fit2 = T2_2.all_faces_begin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,23 +749,23 @@ _test_cls_regular_triangulation_2( const Triangulation & )
// input output have not yet been overload
// so they do not input output hidden vertices
std::cout << " output to a file" << std::endl;
std::ofstream of1_5("T15.triangulation");
std::ofstream of1_5("T15rt.triangulation");
CGAL::IO::set_ascii_mode(of1_5);
of1_5 << T1_5; of1_5.close();
std::ofstream of2_3("T23.triangulation");
std::ofstream of2_3("T23rt.triangulation");
CGAL::IO::set_ascii_mode(of2_3);
of2_3 << T2_3; of2_3.close();


// std::cout << " input from a file" << std::endl;

// std::ifstream if1_5("T15.triangulation"); CGAL::IO::set_ascii_mode(if1_5);
// std::ifstream if1_5("T15rt.triangulation"); CGAL::IO::set_ascii_mode(if1_5);
// Cls T1_5_copy; if1_5 >> T1_5_copy;
// assert( T1_5_copy.is_valid(verbose) &&
// T1_5_copy.number_of_vertices() ==
// T1_5.number_of_vertices() - T1_5.number_of_hidden_vertices());

// std::ifstream if2_3("T23.triangulation"); CGAL::IO::set_ascii_mode(if2_3);
// std::ifstream if2_3("T23rt.triangulation"); CGAL::IO::set_ascii_mode(if2_3);
// Cls T2_3_copy; if2_3 >> T2_3_copy;
// assert( T2_3_copy.is_valid(verbose) &&
// T2_3_copy.number_of_vertices() ==
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,22 +476,22 @@ _test_cls_triangulation_short_2( const Triangul &)
/********************/
/******** I/O *******/
std::cout << " output to a file" << std::endl;
std::ofstream of1_5("T15.triangulation");
std::ofstream of1_5("T15short.triangulation");
CGAL::IO::set_ascii_mode(of1_5);
of1_5 << T1_5; of1_5.close();
std::ofstream of2_3("T23.triangulation");
std::ofstream of2_3("T23short.triangulation");
CGAL::IO::set_ascii_mode(of2_3);
of2_3 << T2_3; of2_3.close();


std::cout << " input from a file" << std::endl;

std::ifstream if1_5("T15.triangulation"); CGAL::IO::set_ascii_mode(if1_5);
std::ifstream if1_5("T15short.triangulation"); CGAL::IO::set_ascii_mode(if1_5);
Triangul T1_5_copy; if1_5 >> T1_5_copy;
assert( T1_5_copy.is_valid() &&
T1_5_copy.number_of_vertices() == T1_5.number_of_vertices() );

std::ifstream if2_3("T23.triangulation"); CGAL::IO::set_ascii_mode(if2_3);
std::ifstream if2_3("T23short.triangulation"); CGAL::IO::set_ascii_mode(if2_3);
Triangul T2_3_copy; if2_3 >> T2_3_copy;
assert( T2_3_copy.is_valid() &&
T2_3_copy.number_of_vertices() == T2_3.number_of_vertices() );
Expand Down

0 comments on commit a2e3f9b

Please sign in to comment.