Developer Documentation
unittests_iterators.cc
1 #include <gtest/gtest.h>
2 
3 #include <Unittests/unittests_common.hh>
4 
5 using namespace OpenVolumeMesh;
6 
7 TEST_F(HexahedralMeshBase, HexVertexIterTest) {
8 
9  generateHexahedralMesh(mesh_);
10 
11  HexVertexIter hv_it = mesh_.hv_iter(CellHandle(0));
12 
13  EXPECT_TRUE(hv_it.valid());
14 
15  EXPECT_EQ(VertexHandle(0), *hv_it); ++hv_it;
16  EXPECT_EQ(VertexHandle(1), *hv_it); ++hv_it;
17  EXPECT_EQ(VertexHandle(2), *hv_it); ++hv_it;
18  EXPECT_EQ(VertexHandle(3), *hv_it); ++hv_it;
19  EXPECT_EQ(VertexHandle(4), *hv_it); ++hv_it;
20  EXPECT_EQ(VertexHandle(7), *hv_it); ++hv_it;
21  EXPECT_EQ(VertexHandle(6), *hv_it); ++hv_it;
22  EXPECT_EQ(VertexHandle(5), *hv_it);
23 }
24 
Iterate over all vertices of a hexahedron in a specific order.