Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenMesh
OpenMesh
Commits
e222791c
Commit
e222791c
authored
Oct 17, 2019
by
Max Lyon
Browse files
add test that does some comparisons between smart handles and handles
parent
bd337063
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Unittests/unittests_smart_handles.cc
View file @
e222791c
...
@@ -476,4 +476,30 @@ TEST_F(OpenMeshSmartHandles, MixOldAndNew)
...
@@ -476,4 +476,30 @@ TEST_F(OpenMeshSmartHandles, MixOldAndNew)
}
}
/* comparability
*/
TEST_F
(
OpenMeshSmartHandles
,
ComparisionBetweenSmartHandleAndNormalHandles
)
{
OpenMesh
::
VertexHandle
vh
(
0
);
OpenMesh
::
SmartVertexHandle
svh
(
0
,
&
mesh_
);
EXPECT_EQ
(
vh
,
svh
)
<<
"Vertex handle and smart vertex handle are different"
;
std
::
vector
<
OpenMesh
::
VertexHandle
>
vertices
=
mesh_
.
vertices
().
to_vector
([](
OpenMesh
::
SmartVertexHandle
_svh
)
{
return
OpenMesh
::
VertexHandle
(
_svh
);
});
std
::
replace
(
vertices
.
begin
(),
vertices
.
end
(),
OpenMesh
::
VertexHandle
(
0
),
OpenMesh
::
VertexHandle
(
1
));
EXPECT_EQ
(
vertices
[
0
],
OpenMesh
::
VertexHandle
(
1
));
std
::
vector
<
OpenMesh
::
SmartVertexHandle
>
smart_vertices
=
mesh_
.
vertices
().
to_vector
();
std
::
replace
(
smart_vertices
.
begin
(),
smart_vertices
.
end
(),
OpenMesh
::
SmartVertexHandle
(
0
,
&
mesh_
),
OpenMesh
::
SmartVertexHandle
(
1
,
&
mesh_
));
EXPECT_EQ
(
smart_vertices
[
0
],
OpenMesh
::
VertexHandle
(
1
));
EXPECT_EQ
(
smart_vertices
[
0
],
OpenMesh
::
SmartVertexHandle
(
1
,
&
mesh_
));
std
::
replace
(
vertices
.
begin
(),
vertices
.
end
(),
OpenMesh
::
SmartVertexHandle
(
1
,
&
mesh_
),
OpenMesh
::
SmartVertexHandle
(
2
,
&
mesh_
));
EXPECT_EQ
(
vertices
[
0
],
OpenMesh
::
VertexHandle
(
2
));
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment