Commit 4020a879 authored by Matthias Möller's avatar Matthias Möller

moved face* circulators to old behavior

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1234 fdac6126-5c0c-442c-9429-916003d36597
parent 4cd1955f
......@@ -370,6 +370,11 @@ class GenericCirculatorT : protected GenericCirculatorBaseT<Mesh> {
// OpenMeshTrimeshCirculatorVertexOHalfEdge.VertexOHalfEdgeIterCheckInvalidationAtEnds
// OpenMeshTrimeshCirculatorVertexFace.VertexFaceIterCheckInvalidationAtEnds
// OpenMeshTrimeshCirculatorVertexFace.VertexFaceIterWithoutHolesDecrement
// OpenMeshTrimeshCirculatorFaceEdge.FaceEdgeIterCheckInvalidationAtEnds
// OpenMeshTrimeshCirculatorFaceFace.FaceFaceIterCheckInvalidationAtEnds
// OpenMeshTrimeshCirculatorFaceHalfEdge.FaceHalfedgeIterWithoutHolesIncrement
// OpenMeshTrimeshCirculatorFaceVertex.FaceVertexIterCheckInvalidationAtEnds
// OpenMeshTrimeshCirculatorFaceHalfEdge.FaceHalfedgeIterCheckInvalidationAtEnds
//
template<class Mesh, class CenterEntityHandle, class ValueHandle>
......
......@@ -216,10 +216,11 @@ public:
/**
* Enumerate incident vertices in a counter clockwise fashion.
*/
typedef Iterators::GenericCirculatorT<This, This::FaceHandle, This::VertexHandle,
typedef Iterators::GenericCirculatorT_DEPRECATED<This, This::FaceHandle, This::VertexHandle,
&Iterators::GenericCirculatorBaseT<This>::toVertexHandle>
FaceVertexIter;
typedef FaceVertexIter FaceVertexCCWIter;
typedef Iterators::GenericCirculatorT<This, This::FaceHandle, This::VertexHandle,
&Iterators::GenericCirculatorBaseT<This>::toVertexHandle> FaceVertexCCWIter;
/**
* Enumerate incident vertices in a clockwise fashion.
......@@ -231,10 +232,11 @@ public:
/**
* Enumerate incident half edges in a counter clockwise fashion.
*/
typedef Iterators::GenericCirculatorT<This, This::FaceHandle, This::HalfedgeHandle,
typedef Iterators::GenericCirculatorT_DEPRECATED<This, This::FaceHandle, This::HalfedgeHandle,
&Iterators::GenericCirculatorBaseT<This>::toHalfedgeHandle>
FaceHalfedgeIter;
typedef FaceHalfedgeIter FaceHalfedgeCCWIter;
typedef Iterators::GenericCirculatorT<This, This::FaceHandle, This::HalfedgeHandle,
&Iterators::GenericCirculatorBaseT<This>::toHalfedgeHandle> FaceHalfedgeCCWIter;
/**
* Enumerate incident half edges in a clockwise fashion.
......@@ -246,10 +248,11 @@ public:
/**
* Enumerate incident edges in a counter clockwise fashion.
*/
typedef Iterators::GenericCirculatorT<This, This::FaceHandle, This::EdgeHandle,
typedef Iterators::GenericCirculatorT_DEPRECATED<This, This::FaceHandle, This::EdgeHandle,
&Iterators::GenericCirculatorBaseT<This>::toEdgeHandle>
FaceEdgeIter;
typedef FaceEdgeIter FaceEdgeCCWIter;
typedef Iterators::GenericCirculatorT<This, This::FaceHandle, This::EdgeHandle,
&Iterators::GenericCirculatorBaseT<This>::toEdgeHandle> FaceEdgeCCWIter;
/**
* Enumerate incident edges in a clockwise fashion.
......@@ -261,10 +264,11 @@ public:
/**
* Enumerate adjacent faces in a counter clockwise fashion.
*/
typedef Iterators::GenericCirculatorT<This, This::FaceHandle, This::FaceHandle,
typedef Iterators::GenericCirculatorT_DEPRECATED<This, This::FaceHandle, This::FaceHandle,
&Iterators::GenericCirculatorBaseT<This>::toOppositeFaceHandle>
FaceFaceIter;
typedef FaceFaceIter FaceFaceCCWIter;
typedef Iterators::GenericCirculatorT<This, This::FaceHandle, This::FaceHandle,
&Iterators::GenericCirculatorBaseT<This>::toOppositeFaceHandle> FaceFaceCCWIter;
/**
* Enumerate adjacent faces in a clockwise fashion.
......
......@@ -273,84 +273,84 @@ TEST_F(OpenMeshTrimeshCirculatorFaceEdge, CWAndCCWTest) {
/*
* Test if the end iterator stays invalid after one lap
*/
TEST_F(OpenMeshTrimeshCirculatorFaceEdge, FaceEdgeIterCheckInvalidationAtEnds) {
mesh_.clear();
// Add some vertices
Mesh::VertexHandle vhandle[5];
vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
vhandle[1] = mesh_.add_vertex(Mesh::Point(1, 0, 0));
vhandle[2] = mesh_.add_vertex(Mesh::Point(2, 1, 0));
vhandle[3] = mesh_.add_vertex(Mesh::Point(0,-1, 0));
vhandle[4] = mesh_.add_vertex(Mesh::Point(2,-1, 0));
// Add two faces
std::vector<Mesh::VertexHandle> face_vhandles;
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[2]);
Mesh::FaceHandle fh0 = mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[4]);
mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[1]);
mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[4]);
mesh_.add_face(face_vhandles);
/* Test setup:
0 ==== 2
|\ 0 /|
| \ / |
|2 1 3|
| / \ |
|/ 1 \|
3 ==== 4 */
// Check if the end iterator stays invalid after end
Mesh::FaceEdgeIter endIter = mesh_.fe_end(fh0);
EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
++endIter ;
EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid after increment";
// Check if the end iterators becomes valid after decrement
endIter = mesh_.fe_end(fh0);
EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
--endIter;
EXPECT_TRUE(endIter.is_valid()) << "EndIter is invalid after decrement";
EXPECT_EQ(1,endIter->idx()) << "EndIter points on the wrong element";
// Check if the start iterator decrement is invalid
Mesh::FaceEdgeIter startIter = mesh_.fe_begin(fh0);
EXPECT_TRUE(startIter.is_valid()) << "StartIter is not valid";
--startIter;
EXPECT_FALSE(startIter.is_valid()) << "StartIter decrement is not invalid";
// Check if the start iterator becomes valid
++startIter;
EXPECT_TRUE(startIter.is_valid()) << "StartIter is invalid after re-incrementing";
EXPECT_EQ(startIter->idx(), mesh_.fe_begin(fh0)->idx()) << "StartIter points on the wrong element";
}
//TEST_F(OpenMeshTrimeshCirculatorFaceEdge, FaceEdgeIterCheckInvalidationAtEnds) {
//
// mesh_.clear();
//
// // Add some vertices
// Mesh::VertexHandle vhandle[5];
//
// vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
// vhandle[1] = mesh_.add_vertex(Mesh::Point(1, 0, 0));
// vhandle[2] = mesh_.add_vertex(Mesh::Point(2, 1, 0));
// vhandle[3] = mesh_.add_vertex(Mesh::Point(0,-1, 0));
// vhandle[4] = mesh_.add_vertex(Mesh::Point(2,-1, 0));
//
// // Add two faces
// std::vector<Mesh::VertexHandle> face_vhandles;
//
// face_vhandles.push_back(vhandle[0]);
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[2]);
// Mesh::FaceHandle fh0 = mesh_.add_face(face_vhandles);
//
// face_vhandles.clear();
//
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[3]);
// face_vhandles.push_back(vhandle[4]);
// mesh_.add_face(face_vhandles);
//
// face_vhandles.clear();
//
// face_vhandles.push_back(vhandle[0]);
// face_vhandles.push_back(vhandle[3]);
// face_vhandles.push_back(vhandle[1]);
// mesh_.add_face(face_vhandles);
//
// face_vhandles.clear();
//
// face_vhandles.push_back(vhandle[2]);
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[4]);
// mesh_.add_face(face_vhandles);
//
// /* Test setup:
// 0 ==== 2
// |\ 0 /|
// | \ / |
// |2 1 3|
// | / \ |
// |/ 1 \|
// 3 ==== 4 */
//
//
// // Check if the end iterator stays invalid after end
// Mesh::FaceEdgeIter endIter = mesh_.fe_end(fh0);
// EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
// ++endIter ;
// EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid after increment";
//
// // Check if the end iterators becomes valid after decrement
// endIter = mesh_.fe_end(fh0);
// EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
// --endIter;
// EXPECT_TRUE(endIter.is_valid()) << "EndIter is invalid after decrement";
// EXPECT_EQ(1,endIter->idx()) << "EndIter points on the wrong element";
//
//
// // Check if the start iterator decrement is invalid
// Mesh::FaceEdgeIter startIter = mesh_.fe_begin(fh0);
// EXPECT_TRUE(startIter.is_valid()) << "StartIter is not valid";
// --startIter;
// EXPECT_FALSE(startIter.is_valid()) << "StartIter decrement is not invalid";
//
// // Check if the start iterator becomes valid
// ++startIter;
// EXPECT_TRUE(startIter.is_valid()) << "StartIter is invalid after re-incrementing";
// EXPECT_EQ(startIter->idx(), mesh_.fe_begin(fh0)->idx()) << "StartIter points on the wrong element";
//
//}
/*
......
......@@ -406,84 +406,84 @@ TEST_F(OpenMeshTrimeshCirculatorFaceFace, FaceFaceIteratorHandleConversion) {
/*
* Test if the end iterator stays invalid after one lap
*/
TEST_F(OpenMeshTrimeshCirculatorFaceFace, FaceFaceIterCheckInvalidationAtEnds) {
mesh_.clear();
// Add some vertices
Mesh::VertexHandle vhandle[5];
vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
vhandle[1] = mesh_.add_vertex(Mesh::Point(1, 0, 0));
vhandle[2] = mesh_.add_vertex(Mesh::Point(2, 1, 0));
vhandle[3] = mesh_.add_vertex(Mesh::Point(0,-1, 0));
vhandle[4] = mesh_.add_vertex(Mesh::Point(2,-1, 0));
// Add two faces
std::vector<Mesh::VertexHandle> face_vhandles;
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[2]);
Mesh::FaceHandle fh0 = mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[4]);
mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[1]);
mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[4]);
mesh_.add_face(face_vhandles);
/* Test setup:
0 ==== 2
|\ 0 /|
| \ / |
|2 1 3|
| / \ |
|/ 1 \|
3 ==== 4 */
// Check if the end iterator stays invalid after end
Mesh::FaceFaceIter endIter = mesh_.ff_end(fh0);
EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
++endIter ;
EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid after increment";
// Check if the end iterators becomes valid after decrement
endIter = mesh_.ff_end(fh0);
EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
--endIter;
EXPECT_TRUE(endIter.is_valid()) << "EndIter is invalid after decrement";
EXPECT_EQ(3,endIter->idx()) << "EndIter points on the wrong element";
// Check if the start iterator decrement is invalid
Mesh::FaceFaceIter startIter = mesh_.ff_begin(fh0);
EXPECT_TRUE(startIter.is_valid()) << "StartIter is not valid";
--startIter;
EXPECT_FALSE(startIter.is_valid()) << "StartIter decrement is not invalid";
// Check if the start iterator becomes valid
++startIter;
EXPECT_TRUE(startIter.is_valid()) << "StartIter is invalid after re-incrementing";
EXPECT_EQ(startIter->idx(), mesh_.ff_begin(fh0)->idx()) << "StartIter points on the wrong element";
}
//TEST_F(OpenMeshTrimeshCirculatorFaceFace, FaceFaceIterCheckInvalidationAtEnds) {
//
// mesh_.clear();
//
// // Add some vertices
// Mesh::VertexHandle vhandle[5];
//
// vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
// vhandle[1] = mesh_.add_vertex(Mesh::Point(1, 0, 0));
// vhandle[2] = mesh_.add_vertex(Mesh::Point(2, 1, 0));
// vhandle[3] = mesh_.add_vertex(Mesh::Point(0,-1, 0));
// vhandle[4] = mesh_.add_vertex(Mesh::Point(2,-1, 0));
//
// // Add two faces
// std::vector<Mesh::VertexHandle> face_vhandles;
//
// face_vhandles.push_back(vhandle[0]);
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[2]);
// Mesh::FaceHandle fh0 = mesh_.add_face(face_vhandles);
//
// face_vhandles.clear();
//
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[3]);
// face_vhandles.push_back(vhandle[4]);
// mesh_.add_face(face_vhandles);
//
// face_vhandles.clear();
//
// face_vhandles.push_back(vhandle[0]);
// face_vhandles.push_back(vhandle[3]);
// face_vhandles.push_back(vhandle[1]);
// mesh_.add_face(face_vhandles);
//
// face_vhandles.clear();
//
// face_vhandles.push_back(vhandle[2]);
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[4]);
// mesh_.add_face(face_vhandles);
//
// /* Test setup:
// 0 ==== 2
// |\ 0 /|
// | \ / |
// |2 1 3|
// | / \ |
// |/ 1 \|
// 3 ==== 4 */
//
//
// // Check if the end iterator stays invalid after end
// Mesh::FaceFaceIter endIter = mesh_.ff_end(fh0);
// EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
// ++endIter ;
// EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid after increment";
//
// // Check if the end iterators becomes valid after decrement
// endIter = mesh_.ff_end(fh0);
// EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
// --endIter;
// EXPECT_TRUE(endIter.is_valid()) << "EndIter is invalid after decrement";
// EXPECT_EQ(3,endIter->idx()) << "EndIter points on the wrong element";
//
//
// // Check if the start iterator decrement is invalid
// Mesh::FaceFaceIter startIter = mesh_.ff_begin(fh0);
// EXPECT_TRUE(startIter.is_valid()) << "StartIter is not valid";
// --startIter;
// EXPECT_FALSE(startIter.is_valid()) << "StartIter decrement is not invalid";
//
// // Check if the start iterator becomes valid
// ++startIter;
// EXPECT_TRUE(startIter.is_valid()) << "StartIter is invalid after re-incrementing";
// EXPECT_EQ(startIter->idx(), mesh_.ff_begin(fh0)->idx()) << "StartIter points on the wrong element";
//
//}
}
......@@ -127,84 +127,84 @@ TEST_F(OpenMeshTrimeshCirculatorFaceVertex, FaceVertexIterWithoutIncrement) {
/*
* Test if the end iterator stays invalid after one lap
*/
TEST_F(OpenMeshTrimeshCirculatorFaceVertex, FaceVertexIterCheckInvalidationAtEnds) {
mesh_.clear();
// Add some vertices
Mesh::VertexHandle vhandle[5];
vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
vhandle[1] = mesh_.add_vertex(Mesh::Point(1, 0, 0));
vhandle[2] = mesh_.add_vertex(Mesh::Point(2, 1, 0));
vhandle[3] = mesh_.add_vertex(Mesh::Point(0,-1, 0));
vhandle[4] = mesh_.add_vertex(Mesh::Point(2,-1, 0));
// Add two faces
std::vector<Mesh::VertexHandle> face_vhandles;
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[2]);
Mesh::FaceHandle fh0 = mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[4]);
mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[1]);
mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[4]);
mesh_.add_face(face_vhandles);
/* Test setup:
0 ==== 2
|\ 0 /|
| \ / |
|2 1 3|
| / \ |
|/ 1 \|
3 ==== 4 */
// Check if the end iterator stays invalid after end
Mesh::FaceVertexIter endIter = mesh_.fv_end(fh0);
EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
++endIter ;
EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid after increment";
// Check if the end iterators becomes valid after decrement
endIter = mesh_.fv_end(fh0);
EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
--endIter;
EXPECT_TRUE(endIter.is_valid()) << "EndIter is invalid after decrement";
EXPECT_EQ(2,endIter->idx()) << "EndIter points on the wrong element";
// Check if the start iterator decrement is invalid
Mesh::FaceVertexIter startIter = mesh_.fv_begin(fh0);
EXPECT_TRUE(startIter.is_valid()) << "StartIter is not valid";
--startIter;
EXPECT_FALSE(startIter.is_valid()) << "StartIter decrement is not invalid";
// Check if the start iterator becomes valid
++startIter;
EXPECT_TRUE(startIter.is_valid()) << "StartIter is invalid after re-incrementing";
EXPECT_EQ(startIter->idx(), mesh_.fv_begin(fh0)->idx()) << "StartIter points on the wrong element";
}
//TEST_F(OpenMeshTrimeshCirculatorFaceVertex, FaceVertexIterCheckInvalidationAtEnds) {
//
// mesh_.clear();
//
// // Add some vertices
// Mesh::VertexHandle vhandle[5];
//
// vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
// vhandle[1] = mesh_.add_vertex(Mesh::Point(1, 0, 0));
// vhandle[2] = mesh_.add_vertex(Mesh::Point(2, 1, 0));
// vhandle[3] = mesh_.add_vertex(Mesh::Point(0,-1, 0));
// vhandle[4] = mesh_.add_vertex(Mesh::Point(2,-1, 0));
//
// // Add two faces
// std::vector<Mesh::VertexHandle> face_vhandles;
//
// face_vhandles.push_back(vhandle[0]);
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[2]);
// Mesh::FaceHandle fh0 = mesh_.add_face(face_vhandles);
//
// face_vhandles.clear();
//
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[3]);
// face_vhandles.push_back(vhandle[4]);
// mesh_.add_face(face_vhandles);
//
// face_vhandles.clear();
//
// face_vhandles.push_back(vhandle[0]);
// face_vhandles.push_back(vhandle[3]);
// face_vhandles.push_back(vhandle[1]);
// mesh_.add_face(face_vhandles);
//
// face_vhandles.clear();
//
// face_vhandles.push_back(vhandle[2]);
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[4]);
// mesh_.add_face(face_vhandles);
//
// /* Test setup:
// 0 ==== 2
// |\ 0 /|
// | \ / |
// |2 1 3|
// | / \ |
// |/ 1 \|
// 3 ==== 4 */
//
//
// // Check if the end iterator stays invalid after end
// Mesh::FaceVertexIter endIter = mesh_.fv_end(fh0);
// EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
// ++endIter ;
// EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid after increment";
//
// // Check if the end iterators becomes valid after decrement
// endIter = mesh_.fv_end(fh0);
// EXPECT_FALSE(endIter.is_valid()) << "EndIter is not invalid";
// --endIter;
// EXPECT_TRUE(endIter.is_valid()) << "EndIter is invalid after decrement";
// EXPECT_EQ(2,endIter->idx()) << "EndIter points on the wrong element";
//
//
// // Check if the start iterator decrement is invalid
// Mesh::FaceVertexIter startIter = mesh_.fv_begin(fh0);
// EXPECT_TRUE(startIter.is_valid()) << "StartIter is not valid";
// --startIter;
// EXPECT_FALSE(startIter.is_valid()) << "StartIter decrement is not invalid";
//
// // Check if the start iterator becomes valid
// ++startIter;
// EXPECT_TRUE(startIter.is_valid()) << "StartIter is invalid after re-incrementing";
// EXPECT_EQ(startIter->idx(), mesh_.fv_begin(fh0)->idx()) << "StartIter points on the wrong element";
//
//}
/*
* Test CW and CCW iterators
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment