30 template<
typename T >
34 std::cout << title <<
" =" << std::endl;
35 for(
auto element : container)
36 std::cout <<
" " << element << std::endl;
37 std::cout << std::endl;
47 template<
typename T >
51 bool are_equal =
false;
55 for(
size_t i = 0; i < v1.size(); i++)
59 std::cout <<
"rotate number = " << i << std::endl;
67 std::cout <<
"v1 == v2" << std::endl;
74 std::cout <<
"v1 != v2" << std::endl;
78 std::rotate(v2.begin(), v2.begin() + 1, v2.end());
81 if(are_equal ==
false && test_in_reverse_order_too)
84 std::cout <<
"reverse v2" << std::endl;
85 std::reverse(v2.begin(), v2.end());
86 test_in_reverse_order_too =
false;
244 std::cout <<
"Input mesh:\n";
251 std::cout <<
"testing get_unordered_one_ring_edges(v0)" << std::endl;
257 std::set< edge_descriptor >{e4, e5, e12, e6, e10}));
259 std::cout <<
"testing get_unordered_one_ring_edges(v1)" << std::endl;
261 std::set< edge_descriptor >{e11, e15}));
263 std::cout <<
"testing get_unordered_one_ring_edges(v2)" << std::endl;
265 std::set< edge_descriptor >{e9, e13, e6, e2, e0}));
267 std::cout <<
"testing get_unordered_one_ring_edges(v11)" << std::endl;
269 std::set< edge_descriptor >{}));
274 std::cout <<
"testing get_ordered_one_ring_edges(v0)" << std::endl;
277 std::vector< edge_descriptor >{e5, e6, e10, e12, e4}));
281 std::cout <<
"testing get_ordered_one_ring_edges(v1)" << std::endl;
283 std::vector< edge_descriptor >{e15, e11}));
287 std::cout <<
"testing get_ordered_one_ring_edges(v2)" << std::endl;
290 std::vector< edge_descriptor >{e0, e2, e6, e9, e13}));
292 std::cout <<
"testing get_ordered_one_ring_edges(v11)" << std::endl;
294 std::vector< edge_descriptor >{}));
299 std::cout <<
"testing get_ordered_one_ring_vertices(v0)" << std::endl;
302 std::vector< vertex_descriptor >{v2, v3, v4, v5, v1}));
304 std::cout <<
"testing get_ordered_one_ring_vertices(v1)" << std::endl;
306 std::vector< vertex_descriptor >{v2, v0, v5}));
308 std::cout <<
"testing get_ordered_one_ring_vertices(v2)" << std::endl;
311 std::vector< vertex_descriptor >{v6, v7, v4, v3, v0, v1}));
313 std::cout <<
"testing get_ordered_one_ring_vertices(v11)" << std::endl;
315 std::vector< vertex_descriptor >{}));
320 std::cout <<
"testing get_ordered_one_ring_of_adjacent_vertices(v0)"
324 std::vector< vertex_descriptor >{v1, v2, v3, v5}));
326 std::cout <<
"testing get_ordered_one_ring_of_adjacent_vertices(v1)"
330 std::vector< vertex_descriptor >{v2, v0, v5}));
332 std::cout <<
"testing get_ordered_one_ring_of_adjacent_vertices(v2)"
336 std::vector< vertex_descriptor >{v6, v3, v0, v1}));
338 std::cout <<
"testing get_ordered_one_ring_of_adjacent_vertices(v11)"
341 std::vector< vertex_descriptor >{}));
345 std::cout <<
"testing one-ring-vertices cache" << std::endl;
349 assert(one_r1 != one_r2);
353 std::cout <<
"testing extract_k_ring" << std::endl;
354 std::vector< vertex_descriptor > qv;
356 assert((qv == std::vector< vertex_descriptor >{v0}));
363 assert((qv == std::vector< vertex_descriptor >{v0, v3, v5, v1, v2}));
366 assert((qv == std::vector< vertex_descriptor >{v0, v3, v5, v1, v2, v4, v6}));
372 (qv == std::vector< vertex_descriptor >{v0, v3, v5, v1, v2, v4, v6, v7}));
377 assert((qv == std::vector< vertex_descriptor >{v8, v9, v7}));
380 assert((qv == std::vector< vertex_descriptor >{v9, v8, v7}));
384 std::cout <<
"testing extract_vertex_star" << std::endl;
385 std::vector< halfedge_descriptor > qh;
387 assert((qh == std::vector< halfedge_descriptor >{
388 halfedge_descriptor(v3, v0, f1, e9,
false),
389 halfedge_descriptor(v5, v0, f0, e11,
false),
391 v0, v1, f0, e13,
false),
392 halfedge_descriptor(v2, v0, f3, e15,
false)}));
396 assert((qh == std::vector< halfedge_descriptor >{
397 halfedge_descriptor(v7, v6, f2, e0,
false),
398 halfedge_descriptor(v6, v2, f2, e14,
false)}));
401 std::cout <<
"Test passed.\n";