Commit e8053753 authored by Matthias Möller's avatar Matthias Möller

cppcheck fp fix

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1228 fdac6126-5c0c-442c-9429-916003d36597
parent eb877fe9
......@@ -339,9 +339,11 @@ TEST_F(OpenMeshTrimeshCirculatorVertexEdge, CWAndCCWCheck) {
int rev_indices[5];
std::reverse_copy(indices,indices+5,rev_indices);
Mesh::VertexHandle vh = vhandle[1];
//CCW
Mesh::VertexEdgeCCWIter ve_ccwit = mesh_.ve_ccwbegin(vhandle[1]);
Mesh::VertexEdgeCCWIter ve_ccwend = mesh_.ve_ccwend(vhandle[1]);
Mesh::VertexEdgeCCWIter ve_ccwit = mesh_.ve_ccwbegin(vh);
Mesh::VertexEdgeCCWIter ve_ccwend = mesh_.ve_ccwend(vh);
size_t i = 0;
for (;ve_ccwit != ve_ccwend; ++ve_ccwit, ++i)
{
......@@ -352,8 +354,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexEdge, CWAndCCWCheck) {
EXPECT_TRUE( ve_ccwit == ve_ccwend ) << "End iterator for VertexEdgeCCWIter not matching";
//constant CCW
Mesh::ConstVertexEdgeCCWIter cve_ccwit = mesh_.cve_ccwbegin(vhandle[1]);
Mesh::ConstVertexEdgeCCWIter cve_ccwend = mesh_.cve_ccwend(vhandle[1]);
Mesh::ConstVertexEdgeCCWIter cve_ccwit = mesh_.cve_ccwbegin(vh);
Mesh::ConstVertexEdgeCCWIter cve_ccwend = mesh_.cve_ccwend(vh);
i = 0;
for (;cve_ccwit != cve_ccwend; ++cve_ccwit, ++i)
{
......@@ -364,8 +366,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexEdge, CWAndCCWCheck) {
EXPECT_TRUE( cve_ccwit == cve_ccwend ) << "End iterator for ConstVertexEdgeCCWIter not matching";
//CW
Mesh::VertexEdgeCWIter ve_cwit = mesh_.ve_cwbegin(vhandle[1]);
Mesh::VertexEdgeCWIter ve_cwend = mesh_.ve_cwend(vhandle[1]);
Mesh::VertexEdgeCWIter ve_cwit = mesh_.ve_cwbegin(vh);
Mesh::VertexEdgeCWIter ve_cwend = mesh_.ve_cwend(vh);
i = 0;
for (;ve_cwit != ve_cwend; ++ve_cwit, ++i)
{
......@@ -375,8 +377,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexEdge, CWAndCCWCheck) {
EXPECT_TRUE( ve_cwit == ve_cwend ) << "End iterator for VertexEdgeCWIter not matching";
//constant CW
Mesh::ConstVertexEdgeCWIter cve_cwit = mesh_.cve_cwbegin(vhandle[1]);
Mesh::ConstVertexEdgeCWIter cve_cwend = mesh_.cve_cwend(vhandle[1]);
Mesh::ConstVertexEdgeCWIter cve_cwit = mesh_.cve_cwbegin(vh);
Mesh::ConstVertexEdgeCWIter cve_cwend = mesh_.cve_cwend(vh);
i = 0;
for (;cve_cwit != cve_cwend; ++cve_cwit, ++i)
{
......@@ -392,24 +394,24 @@ TEST_F(OpenMeshTrimeshCirculatorVertexEdge, CWAndCCWCheck) {
* c) --cw_iter == CWIter(++ccwIter) for valid iterators
* d) cw_end == CWIter(ccw_end()) => --cw_end != CWIter(++ccw_end()) *
*/
Mesh::VertexEdgeCWIter ve_cwIter = mesh_.ve_cwbegin(vhandle[1]);
Mesh::VertexEdgeCWIter ve_cwIter = mesh_.ve_cwbegin(vh);
// a)
EXPECT_TRUE( ve_cwIter == Mesh::VertexEdgeCWIter(mesh_.ve_ccwbegin(vhandle[1])) ) << "ccw to cw conversion failed";
EXPECT_TRUE( Mesh::VertexEdgeCCWIter(ve_cwIter) == mesh_.ve_ccwbegin(vhandle[1]) ) << "cw to ccw conversion failed";
EXPECT_TRUE( ve_cwIter == Mesh::VertexEdgeCWIter(mesh_.ve_ccwbegin(vh)) ) << "ccw to cw conversion failed";
EXPECT_TRUE( Mesh::VertexEdgeCCWIter(ve_cwIter) == mesh_.ve_ccwbegin(vh) ) << "cw to ccw conversion failed";
// b)
EXPECT_EQ( ve_cwIter->idx(), Mesh::VertexEdgeCCWIter(ve_cwIter)->idx()) << "iterators doesnt point on the same element";
// c)
++ve_cwIter;
ve_ccwend = mesh_.ve_ccwend(vhandle[1]);
ve_ccwend = mesh_.ve_ccwend(vh);
--ve_ccwend;
EXPECT_EQ(ve_cwIter->idx(),ve_ccwend->idx()) << "iteratoes are not equal after inc/dec";
// additional conversion check
ve_ccwend = Mesh::VertexEdgeCCWIter(ve_cwIter);
EXPECT_EQ(ve_cwIter->idx(),ve_ccwend->idx())<< "iterators doesnt point on the same element";
// d)
ve_cwIter = Mesh::VertexEdgeCWIter(mesh_.ve_ccwend(vhandle[1]));
ve_cwIter = Mesh::VertexEdgeCWIter(mesh_.ve_ccwend(vh));
EXPECT_FALSE(ve_cwIter.is_valid()) << "end iterator is not invalid";
EXPECT_TRUE(Mesh::VertexEdgeCCWIter(mesh_.ve_cwend(vhandle[1])) == mesh_.ve_ccwend(vhandle[1])) << "end iterators are not equal";
EXPECT_TRUE(Mesh::VertexEdgeCCWIter(mesh_.ve_cwend(vh)) == mesh_.ve_ccwend(vh)) << "end iterators are not equal";
}
......
......@@ -510,9 +510,11 @@ TEST_F(OpenMeshTrimeshCirculatorVertexFace, CWAndCCWCheck) {
int rev_indices[5];
std::reverse_copy(indices,indices+5,rev_indices);
Mesh::VertexHandle vh = vhandle[1];
//CCW
Mesh::VertexFaceCCWIter vf_ccwit = mesh_.vf_ccwbegin(vhandle[1]);
Mesh::VertexFaceCCWIter vf_ccwend = mesh_.vf_ccwend(vhandle[1]);
Mesh::VertexFaceCCWIter vf_ccwit = mesh_.vf_ccwbegin(vh);
Mesh::VertexFaceCCWIter vf_ccwend = mesh_.vf_ccwend(vh);
size_t i = 0;
for (;vf_ccwit != vf_ccwend; ++vf_ccwit, ++i)
{
......@@ -523,8 +525,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexFace, CWAndCCWCheck) {
EXPECT_TRUE( vf_ccwit == vf_ccwend ) << "End iterator for VertexFaceCCWIter not matching";
//constant CCW
Mesh::ConstVertexFaceCCWIter cvf_ccwit = mesh_.cvf_ccwbegin(vhandle[1]);
Mesh::ConstVertexFaceCCWIter cvf_ccwend = mesh_.cvf_ccwend(vhandle[1]);
Mesh::ConstVertexFaceCCWIter cvf_ccwit = mesh_.cvf_ccwbegin(vh);
Mesh::ConstVertexFaceCCWIter cvf_ccwend = mesh_.cvf_ccwend(vh);
i = 0;
for (;cvf_ccwit != cvf_ccwend; ++cvf_ccwit, ++i)
{
......@@ -535,8 +537,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexFace, CWAndCCWCheck) {
EXPECT_TRUE( cvf_ccwit == cvf_ccwend ) << "End iterator for ConstVertexFaceCCWIter not matching";
//CW
Mesh::VertexFaceCWIter vf_cwit = mesh_.vf_cwbegin(vhandle[1]);
Mesh::VertexFaceCWIter vf_cwend = mesh_.vf_cwend(vhandle[1]);
Mesh::VertexFaceCWIter vf_cwit = mesh_.vf_cwbegin(vh);
Mesh::VertexFaceCWIter vf_cwend = mesh_.vf_cwend(vh);
i = 0;
for (;vf_cwit != vf_cwend; ++vf_cwit, ++i)
{
......@@ -546,8 +548,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexFace, CWAndCCWCheck) {
EXPECT_TRUE( vf_cwit == vf_cwend ) << "End iterator for VertexFaceCWIter not matching";
//constant CW
Mesh::ConstVertexFaceCWIter cvf_cwit = mesh_.cvf_cwbegin(vhandle[1]);
Mesh::ConstVertexFaceCWIter cvf_cwend = mesh_.cvf_cwend(vhandle[1]);
Mesh::ConstVertexFaceCWIter cvf_cwit = mesh_.cvf_cwbegin(vh);
Mesh::ConstVertexFaceCWIter cvf_cwend = mesh_.cvf_cwend(vh);
i = 0;
for (;cvf_cwit != cvf_cwend; ++cvf_cwit, ++i)
{
......@@ -563,24 +565,24 @@ TEST_F(OpenMeshTrimeshCirculatorVertexFace, CWAndCCWCheck) {
* c) --cw_iter == CWIter(++ccwIter) for valid iterators
* d) cw_end == CWIter(ccw_end()) => --cw_end != CWIter(++ccw_end()) *
*/
Mesh::VertexFaceCWIter vf_cwIter = mesh_.vf_cwbegin(vhandle[1]);
Mesh::VertexFaceCWIter vf_cwIter = mesh_.vf_cwbegin(vh);
// a)
EXPECT_TRUE( vf_cwIter == Mesh::VertexFaceCWIter(mesh_.vf_ccwbegin(vhandle[1])) ) << "ccw to cw conversion failed";
EXPECT_TRUE( Mesh::VertexFaceCCWIter(vf_cwIter) == mesh_.vf_ccwbegin(vhandle[1]) ) << "cw to ccw conversion failed";
EXPECT_TRUE( vf_cwIter == Mesh::VertexFaceCWIter(mesh_.vf_ccwbegin(vh)) ) << "ccw to cw conversion failed";
EXPECT_TRUE( Mesh::VertexFaceCCWIter(vf_cwIter) == mesh_.vf_ccwbegin(vh) ) << "cw to ccw conversion failed";
// b)
EXPECT_EQ( vf_cwIter->idx(), Mesh::VertexFaceCCWIter(vf_cwIter)->idx()) << "iterators doesnt point on the same element";
// c)
++vf_cwIter;
vf_ccwend = mesh_.vf_ccwend(vhandle[1]);
vf_ccwend = mesh_.vf_ccwend(vh);
--vf_ccwend;
EXPECT_EQ(vf_cwIter->idx(),vf_ccwend->idx()) << "iteratoes are not equal after inc/dec";
// additional conversion check
vf_ccwend = Mesh::VertexFaceCCWIter(vf_cwIter);
EXPECT_EQ(vf_cwIter->idx(),vf_ccwend->idx())<< "iterators doesnt point on the same element";
// d)
vf_cwIter = Mesh::VertexFaceCWIter(mesh_.vf_ccwend(vhandle[1]));
vf_cwIter = Mesh::VertexFaceCWIter(mesh_.vf_ccwend(vh));
EXPECT_FALSE(vf_cwIter.is_valid()) << "end iterator is not invalid";
EXPECT_TRUE(Mesh::VertexFaceCCWIter(mesh_.vf_cwend(vhandle[1])) == mesh_.vf_ccwend(vhandle[1])) << "end iterators are not equal";
EXPECT_TRUE(Mesh::VertexFaceCCWIter(mesh_.vf_cwend(vh)) == mesh_.vf_ccwend(vh)) << "end iterators are not equal";
}
......
......@@ -453,9 +453,11 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, CWAndCCWCheck) {
int rev_indices[4];
std::reverse_copy(indices,indices+4,rev_indices);
Mesh::VertexHandle vh = vhandle[2];
//CCW
Mesh::VertexIHalfedgeCCWIter vih_ccwit = mesh_.vih_ccwbegin(vhandle[2]);
Mesh::VertexIHalfedgeCCWIter vih_ccwend = mesh_.vih_ccwend(vhandle[2]);
Mesh::VertexIHalfedgeCCWIter vih_ccwit = mesh_.vih_ccwbegin(vh);
Mesh::VertexIHalfedgeCCWIter vih_ccwend = mesh_.vih_ccwend(vh);
size_t i = 0;
for (;vih_ccwit != vih_ccwend; ++vih_ccwit, ++i)
{
......@@ -466,8 +468,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, CWAndCCWCheck) {
EXPECT_TRUE( vih_ccwit == vih_ccwend ) << "End iterator for VertexIHalfedgeCCWIter not matching";
//constant CCW
Mesh::ConstVertexIHalfedgeCCWIter cvih_ccwit = mesh_.cvih_ccwbegin(vhandle[2]);
Mesh::ConstVertexIHalfedgeCCWIter cvih_ccwend = mesh_.cvih_ccwend(vhandle[2]);
Mesh::ConstVertexIHalfedgeCCWIter cvih_ccwit = mesh_.cvih_ccwbegin(vh);
Mesh::ConstVertexIHalfedgeCCWIter cvih_ccwend = mesh_.cvih_ccwend(vh);
i = 0;
for (;cvih_ccwit != cvih_ccwend; ++cvih_ccwit, ++i)
{
......@@ -478,8 +480,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, CWAndCCWCheck) {
EXPECT_TRUE( cvih_ccwit == cvih_ccwend ) << "End iterator for ConstVertexIHalfedgeCCWIter not matching";
//CW
Mesh::VertexIHalfedgeCWIter vih_cwit = mesh_.vih_cwbegin(vhandle[2]);
Mesh::VertexIHalfedgeCWIter vih_cwend = mesh_.vih_cwend(vhandle[2]);
Mesh::VertexIHalfedgeCWIter vih_cwit = mesh_.vih_cwbegin(vh);
Mesh::VertexIHalfedgeCWIter vih_cwend = mesh_.vih_cwend(vh);
i = 0;
for (;vih_cwit != vih_cwend; ++vih_cwit, ++i)
{
......@@ -489,8 +491,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, CWAndCCWCheck) {
EXPECT_TRUE( vih_cwit == vih_cwend ) << "End iterator for VertexIHalfedgeCWIter not matching";
//constant CW
Mesh::ConstVertexIHalfedgeCWIter cvih_cwit = mesh_.cvih_cwbegin(vhandle[2]);
Mesh::ConstVertexIHalfedgeCWIter cvih_cwend = mesh_.cvih_cwend(vhandle[2]);
Mesh::ConstVertexIHalfedgeCWIter cvih_cwit = mesh_.cvih_cwbegin(vh);
Mesh::ConstVertexIHalfedgeCWIter cvih_cwend = mesh_.cvih_cwend(vh);
i = 0;
for (;cvih_cwit != cvih_cwend; ++cvih_cwit, ++i)
{
......@@ -506,24 +508,24 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, CWAndCCWCheck) {
* c) --cw_iter == CWIter(++ccwIter) for valid iterators
* d) cw_end == CWIter(ccw_end()) => --cw_end != CWIter(++ccw_end()) *
*/
Mesh::VertexIHalfedgeCWIter vih_cwIter = mesh_.vih_cwbegin(vhandle[2]);
Mesh::VertexIHalfedgeCWIter vih_cwIter = mesh_.vih_cwbegin(vh);
// a)
EXPECT_TRUE( vih_cwIter == Mesh::VertexIHalfedgeCWIter(mesh_.vih_ccwbegin(vhandle[2])) ) << "ccw to cw conversion failed";
EXPECT_TRUE( Mesh::VertexIHalfedgeCCWIter(vih_cwIter) == mesh_.vih_ccwbegin(vhandle[2]) ) << "cw to ccw conversion failed";
EXPECT_TRUE( vih_cwIter == Mesh::VertexIHalfedgeCWIter(mesh_.vih_ccwbegin(vh)) ) << "ccw to cw conversion failed";
EXPECT_TRUE( Mesh::VertexIHalfedgeCCWIter(vih_cwIter) == mesh_.vih_ccwbegin(vh) ) << "cw to ccw conversion failed";
// b)
EXPECT_EQ( vih_cwIter->idx(), Mesh::VertexIHalfedgeCCWIter(vih_cwIter)->idx()) << "iterators doesnt point on the same element";
// c)
++vih_cwIter;
vih_ccwend = mesh_.vih_ccwend(vhandle[2]);
vih_ccwend = mesh_.vih_ccwend(vh);
--vih_ccwend;
EXPECT_EQ(vih_cwIter->idx(),vih_ccwend->idx()) << "iteratoes are not equal after inc/dec";
// additional conversion check
vih_ccwend = Mesh::VertexIHalfedgeCCWIter(vih_cwIter);
EXPECT_EQ(vih_cwIter->idx(),vih_ccwend->idx())<< "iterators doesnt point on the same element";
// d)
vih_cwIter = Mesh::VertexIHalfedgeCWIter(mesh_.vih_ccwend(vhandle[2]));
vih_cwIter = Mesh::VertexIHalfedgeCWIter(mesh_.vih_ccwend(vh));
EXPECT_FALSE(vih_cwIter.is_valid()) << "end iterator is not invalid";
EXPECT_TRUE(Mesh::VertexIHalfedgeCCWIter(mesh_.vih_cwend(vhandle[2])) == mesh_.vih_ccwend(vhandle[2])) << "end iterators are not equal";
EXPECT_TRUE(Mesh::VertexIHalfedgeCCWIter(mesh_.vih_cwend(vh)) == mesh_.vih_ccwend(vh)) << "end iterators are not equal";
}
......
......@@ -453,9 +453,11 @@ TEST_F(OpenMeshTrimeshCirculatorVertexOHalfEdge, CWAndCCWCheck) {
int rev_indices[5];
std::reverse_copy(indices,indices+5,rev_indices);
Mesh::VertexHandle vh = vhandle[1];
//CCW
Mesh::VertexOHalfedgeCCWIter voh_ccwit = mesh_.voh_ccwbegin(vhandle[1]);
Mesh::VertexOHalfedgeCCWIter voh_ccwend = mesh_.voh_ccwend(vhandle[1]);
Mesh::VertexOHalfedgeCCWIter voh_ccwit = mesh_.voh_ccwbegin(vh);
Mesh::VertexOHalfedgeCCWIter voh_ccwend = mesh_.voh_ccwend(vh);
size_t i = 0;
for (;voh_ccwit != voh_ccwend; ++voh_ccwit, ++i)
{
......@@ -466,8 +468,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexOHalfEdge, CWAndCCWCheck) {
EXPECT_TRUE( voh_ccwit == voh_ccwend ) << "End iterator for VertexOHalfedgeCCWIter not matching";
//constant CCW
Mesh::ConstVertexOHalfedgeCCWIter cvoh_ccwit = mesh_.cvoh_ccwbegin(vhandle[1]);
Mesh::ConstVertexOHalfedgeCCWIter cvoh_ccwend = mesh_.cvoh_ccwend(vhandle[1]);
Mesh::ConstVertexOHalfedgeCCWIter cvoh_ccwit = mesh_.cvoh_ccwbegin(vh);
Mesh::ConstVertexOHalfedgeCCWIter cvoh_ccwend = mesh_.cvoh_ccwend(vh);
i = 0;
for (;cvoh_ccwit != cvoh_ccwend; ++cvoh_ccwit, ++i)
{
......@@ -478,8 +480,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexOHalfEdge, CWAndCCWCheck) {
EXPECT_TRUE( cvoh_ccwit == cvoh_ccwend ) << "End iterator for ConstVertexOHalfedgeCCWIter not matching";
//CW
Mesh::VertexOHalfedgeCWIter voh_cwit = mesh_.voh_cwbegin(vhandle[1]);
Mesh::VertexOHalfedgeCWIter voh_cwend = mesh_.voh_cwend(vhandle[1]);
Mesh::VertexOHalfedgeCWIter voh_cwit = mesh_.voh_cwbegin(vh);
Mesh::VertexOHalfedgeCWIter voh_cwend = mesh_.voh_cwend(vh);
i = 0;
for (;voh_cwit != voh_cwend; ++voh_cwit, ++i)
{
......@@ -489,8 +491,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexOHalfEdge, CWAndCCWCheck) {
EXPECT_TRUE( voh_cwit == voh_cwend ) << "End iterator for VertexOHalfedgeCWIter not matching";
//constant CW
Mesh::ConstVertexOHalfedgeCWIter cvoh_cwit = mesh_.cvoh_cwbegin(vhandle[1]);
Mesh::ConstVertexOHalfedgeCWIter cvoh_cwend = mesh_.cvoh_cwend(vhandle[1]);
Mesh::ConstVertexOHalfedgeCWIter cvoh_cwit = mesh_.cvoh_cwbegin(vh);
Mesh::ConstVertexOHalfedgeCWIter cvoh_cwend = mesh_.cvoh_cwend(vh);
i = 0;
for (;cvoh_cwit != cvoh_cwend; ++cvoh_cwit, ++i)
{
......@@ -506,24 +508,24 @@ TEST_F(OpenMeshTrimeshCirculatorVertexOHalfEdge, CWAndCCWCheck) {
* c) --cw_iter == CWIter(++ccwIter) for valid iterators
* d) cw_end == CWIter(ccw_end()) => --cw_end != CWIter(++ccw_end()) *
*/
Mesh::VertexOHalfedgeCWIter voh_cwIter = mesh_.voh_cwbegin(vhandle[1]);
Mesh::VertexOHalfedgeCWIter voh_cwIter = mesh_.voh_cwbegin(vh);
// a)
EXPECT_TRUE( voh_cwIter == Mesh::VertexOHalfedgeCWIter(mesh_.voh_ccwbegin(vhandle[1])) ) << "ccw to cw conversion failed";
EXPECT_TRUE( Mesh::VertexOHalfedgeCCWIter(voh_cwIter) == mesh_.voh_ccwbegin(vhandle[1]) ) << "cw to ccw conversion failed";
EXPECT_TRUE( voh_cwIter == Mesh::VertexOHalfedgeCWIter(mesh_.voh_ccwbegin(vh)) ) << "ccw to cw conversion failed";
EXPECT_TRUE( Mesh::VertexOHalfedgeCCWIter(voh_cwIter) == mesh_.voh_ccwbegin(vh) ) << "cw to ccw conversion failed";
// b)
EXPECT_EQ( voh_cwIter->idx(), Mesh::VertexOHalfedgeCCWIter(voh_cwIter)->idx()) << "iterators doesnt point on the same element";
// c)
++voh_cwIter;
voh_ccwend = mesh_.voh_ccwend(vhandle[1]);
voh_ccwend = mesh_.voh_ccwend(vh);
--voh_ccwend;
EXPECT_EQ(voh_cwIter->idx(),voh_ccwend->idx()) << "iteratoes are not equal after inc/dec";
// additional conversion check
voh_ccwend = Mesh::VertexOHalfedgeCCWIter(voh_cwIter);
EXPECT_EQ(voh_cwIter->idx(),voh_ccwend->idx())<< "iterators doesnt point on the same element";
// d)
voh_cwIter = Mesh::VertexOHalfedgeCWIter(mesh_.voh_ccwend(vhandle[1]));
voh_cwIter = Mesh::VertexOHalfedgeCWIter(mesh_.voh_ccwend(vh));
EXPECT_FALSE(voh_cwIter.is_valid()) << "end iterator is not invalid";
EXPECT_TRUE(Mesh::VertexOHalfedgeCCWIter(mesh_.voh_cwend(vhandle[1])) == mesh_.voh_ccwend(vhandle[1])) << "end iterators are not equal";
EXPECT_TRUE(Mesh::VertexOHalfedgeCCWIter(mesh_.voh_cwend(vh)) == mesh_.voh_ccwend(vh)) << "end iterators are not equal";
}
......
......@@ -342,9 +342,11 @@ TEST_F(OpenMeshTrimeshCirculatorVertexVertex, CWAndCCWCheck) {
int rev_indices[5];
std::reverse_copy(indices,indices+5,rev_indices);
Mesh::VertexHandle vh = vhandle[1];
//CCW
Mesh::VertexVertexCCWIter vv_ccwit = mesh_.vv_ccwbegin(vhandle[1]);
Mesh::VertexVertexCCWIter vv_ccwend = mesh_.vv_ccwend(vhandle[1]);
Mesh::VertexVertexCCWIter vv_ccwit = mesh_.vv_ccwbegin(vh);
Mesh::VertexVertexCCWIter vv_ccwend = mesh_.vv_ccwend(vh);
size_t i = 0;
for (;vv_ccwit != vv_ccwend; ++vv_ccwit, ++i)
{
......@@ -355,8 +357,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexVertex, CWAndCCWCheck) {
EXPECT_TRUE( vv_ccwit == vv_ccwend ) << "End iterator for VertexVertexCCWIter not matching";
//constant CCW
Mesh::ConstVertexVertexCCWIter cvv_ccwit = mesh_.cvv_ccwbegin(vhandle[1]);
Mesh::ConstVertexVertexCCWIter cvv_ccwend = mesh_.cvv_ccwend(vhandle[1]);
Mesh::ConstVertexVertexCCWIter cvv_ccwit = mesh_.cvv_ccwbegin(vh);
Mesh::ConstVertexVertexCCWIter cvv_ccwend = mesh_.cvv_ccwend(vh);
i = 0;
for (;cvv_ccwit != cvv_ccwend; ++cvv_ccwit, ++i)
{
......@@ -367,8 +369,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexVertex, CWAndCCWCheck) {
EXPECT_TRUE( cvv_ccwit == cvv_ccwend ) << "End iterator for ConstVertexVertexCCWIter not matching";
//CW
Mesh::VertexVertexCWIter vv_cwit = mesh_.vv_cwbegin(vhandle[1]);
Mesh::VertexVertexCWIter vv_cwend = mesh_.vv_cwend(vhandle[1]);
Mesh::VertexVertexCWIter vv_cwit = mesh_.vv_cwbegin(vh);
Mesh::VertexVertexCWIter vv_cwend = mesh_.vv_cwend(vh);
i = 0;
for (;vv_cwit != vv_cwend; ++vv_cwit, ++i)
{
......@@ -378,8 +380,8 @@ TEST_F(OpenMeshTrimeshCirculatorVertexVertex, CWAndCCWCheck) {
EXPECT_TRUE( vv_cwit == vv_cwend ) << "End iterator for VertexVertexCWIter not matching";
//constant CW
Mesh::ConstVertexVertexCWIter cvv_cwit = mesh_.cvv_cwbegin(vhandle[1]);
Mesh::ConstVertexVertexCWIter cvv_cwend = mesh_.cvv_cwend(vhandle[1]);
Mesh::ConstVertexVertexCWIter cvv_cwit = mesh_.cvv_cwbegin(vh);
Mesh::ConstVertexVertexCWIter cvv_cwend = mesh_.cvv_cwend(vh);
i = 0;
for (;cvv_cwit != cvv_cwend; ++cvv_cwit, ++i)
{
......@@ -395,24 +397,24 @@ TEST_F(OpenMeshTrimeshCirculatorVertexVertex, CWAndCCWCheck) {
* c) --cw_iter == CWIter(++ccwIter) for valid iterators
* d) cw_end == CWIter(ccw_end()) => --cw_end != CWIter(++ccw_end()) *
*/
Mesh::VertexVertexCWIter vv_cwIter = mesh_.vv_cwbegin(vhandle[1]);
Mesh::VertexVertexCWIter vv_cwIter = mesh_.vv_cwbegin(vh);
// a)
EXPECT_TRUE( vv_cwIter == Mesh::VertexVertexCWIter(mesh_.vv_ccwbegin(vhandle[1])) ) << "ccw to cw convvrsion failed";
EXPECT_TRUE( Mesh::VertexVertexCCWIter(vv_cwIter) == mesh_.vv_ccwbegin(vhandle[1]) ) << "cw to ccw convvrsion failed";
EXPECT_TRUE( vv_cwIter == Mesh::VertexVertexCWIter(mesh_.vv_ccwbegin(vh)) ) << "ccw to cw convvrsion failed";
EXPECT_TRUE( Mesh::VertexVertexCCWIter(vv_cwIter) == mesh_.vv_ccwbegin(vh) ) << "cw to ccw convvrsion failed";
// b)
EXPECT_EQ( vv_cwIter->idx(), Mesh::VertexVertexCCWIter(vv_cwIter)->idx()) << "iterators doesnt point on the same element";
// c)
++vv_cwIter;
vv_ccwend = mesh_.vv_ccwend(vhandle[1]);
vv_ccwend = mesh_.vv_ccwend(vh);
--vv_ccwend;
EXPECT_EQ(vv_cwIter->idx(),vv_ccwend->idx()) << "iteratoes are not equal after inc/dec";
// additional conversion check
vv_ccwend = Mesh::VertexVertexCCWIter(vv_cwIter);
EXPECT_EQ(vv_cwIter->idx(),vv_ccwend->idx())<< "iterators doesnt point on the same element";
// d)
vv_cwIter = Mesh::VertexVertexCWIter(mesh_.vv_ccwend(vhandle[1]));
vv_cwIter = Mesh::VertexVertexCWIter(mesh_.vv_ccwend(vh));
EXPECT_FALSE(vv_cwIter.is_valid()) << "end iterator is not invalid";
EXPECT_TRUE(Mesh::VertexVertexCCWIter(mesh_.vv_cwend(vhandle[1])) == mesh_.vv_ccwend(vhandle[1])) << "end iterators are not equal";
EXPECT_TRUE(Mesh::VertexVertexCCWIter(mesh_.vv_cwend(vh)) == mesh_.vv_ccwend(vh)) << "end iterators are not equal";
}
......
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