UPdate LCC test to add tests for close and insert_cell_2_in_cell_3.

This commit is contained in:
Guillaume Damiand 2016-10-28 15:06:07 -04:00
parent 220bf51f93
commit e4889ceb4c
3 changed files with 34 additions and 8 deletions

View File

@ -56,6 +56,20 @@ void trace_display_msg(const char*
#endif
}
template<typename LCC,
typename Map=typename LCC::Combinatorial_data_structure>
struct Alpha1
{
static typename LCC::Dart_handle run(LCC&, typename LCC::Dart_handle dh)
{ return dh; }
};
template<typename LCC>
struct Alpha1<LCC, CGAL::Generalized_map_tag>
{
static typename LCC::Dart_handle run(LCC& lcc, typename LCC::Dart_handle dh)
{ return lcc.template alpha<1>(dh); }
};
// Test orientation specialized below only for CMap. For GMap return true.
template<typename LCC, typename Map=typename LCC::Combinatorial_data_structure>
struct Test_change_orientation_LCC_2

View File

@ -881,9 +881,13 @@ bool test_LCC_3()
lcc.template sew<3>(dh1,lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh2)))));
lcc.template sew<3>(lcc.template opposite<2>(lcc.next(dh1)), lcc.template opposite<2>(lcc.previous(dh3)));
lcc.insert_cell_1_in_cell_2(lcc.next(dh1), lcc.previous(dh1));
lcc.template close<3>();
if ( !check_number_of_cells_3(lcc, 16, 28, 16, 4, 1) )
return false;
lcc.insert_cell_1_in_cell_2(lcc.next(dh1), Alpha1<LCC>::run(lcc, lcc.previous(dh1)));
dh2=lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh1))));
lcc.insert_cell_1_in_cell_2(dh2, lcc.next(lcc.next(dh2)));
lcc.insert_cell_1_in_cell_2(dh2, Alpha1<LCC>::run(lcc, lcc.next(lcc.next(dh2))));
std::vector<Dart_handle> path;
path.push_back(lcc.next(dh1));
@ -891,12 +895,13 @@ bool test_LCC_3()
path.push_back(lcc.previous(dh2));
path.push_back(lcc.next(lcc.template opposite<2>(dh2)));
lcc.insert_cell_2_in_cell_3(path.begin(),path.end());
if ( !check_number_of_cells_3(lcc, 16, 30, 19, 4, 1) )
if ( !check_number_of_cells_3(lcc, 16, 30, 19, 5, 1) )
return false;
// Construction from Polyhedron_3
{
trace_test_begin();
lcc.clear();
CGAL::Polyhedron_3<typename LCC::Traits> P;
std::ifstream in("data/head.off");
if ( in.fail() )
@ -905,6 +910,7 @@ bool test_LCC_3()
return false;
}
in >> P;
CGAL::import_from_polyhedron_3<LCC>(lcc,P);
if ( !check_number_of_cells_3(lcc, 1539, 4434, 2894, 2, 2) )
return false;
@ -912,7 +918,6 @@ bool test_LCC_3()
CGAL::write_off(lcc, "copy-head.off");
LCC lcc2; CGAL::load_off(lcc2, "copy-head.off");
// LCC lcc2; CGAL::load_off(lcc2, "data/head.off");
if ( !check_number_of_cells_3(lcc2, 1539, 4434, 2894, 2, 2) )
return false;
@ -955,7 +960,10 @@ bool test_LCC_3()
assert(is.is_open());
is>>lcc2;
if (!lcc.is_isomorphic_to(lcc2))
if ( !check_number_of_cells_3(lcc2, 286, 1490, 2408, 1204, 1) )
return false;
if (!lcc.is_isomorphic_to(lcc2, false, true, true))
{
assert(false);
return false;

View File

@ -379,11 +379,15 @@ bool test_LCC_4()
lcc.template sew<3>(dh1,lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh2)))));
lcc.template sew<3>(lcc.template opposite<2>(lcc.next(dh1)), lcc.template opposite<2>(lcc.previous(dh3)));
lcc.template close<3>();
lcc.template close<4>();
lcc.insert_cell_1_in_cell_2(lcc.next(dh1), lcc.previous(dh1));
if ( !check_number_of_cells_4(lcc, 16, 28, 16, 4, 2, 1) )
return false;
lcc.insert_cell_1_in_cell_2(lcc.next(dh1), Alpha1<LCC>::run(lcc, lcc.previous(dh1)));
dh2=lcc.template opposite<2>(lcc.next(lcc.next(lcc.template opposite<2>(dh1))));
lcc.insert_cell_1_in_cell_2(dh2, lcc.next(lcc.next(dh2)));
lcc.insert_cell_1_in_cell_2(dh2, Alpha1<LCC>::run(lcc, lcc.next(lcc.next(dh2))));
std::vector<Dart_handle> path;
path.push_back(lcc.next(dh1));
@ -391,7 +395,7 @@ bool test_LCC_4()
path.push_back(lcc.previous(dh2));
path.push_back(lcc.next(lcc.template opposite<2>(dh2)));
lcc.insert_cell_2_in_cell_3(path.begin(),path.end());
if ( !check_number_of_cells_4(lcc, 16, 30, 19, 4, 2, 1) )
if ( !check_number_of_cells_4(lcc, 16, 30, 19, 5, 2, 1) )
return false;
if ( !Test_change_orientation_LCC_4<LCC>::run() )