From 6b311cef76b08851007481f923a3c7ea6a96cf9d Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Tue, 2 Mar 2021 12:02:18 +0100 Subject: [PATCH] add tests for vectors of vectors and vectors of vectors of vectors --- src/Unittests/unittests_read_write_OM.cc | 29 +++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/Unittests/unittests_read_write_OM.cc b/src/Unittests/unittests_read_write_OM.cc index 413fbf47..a02ae16b 100644 --- a/src/Unittests/unittests_read_write_OM.cc +++ b/src/Unittests/unittests_read_write_OM.cc @@ -1597,7 +1597,7 @@ enum class PropertyAction Add, Check, Request }; - +// For a given Handle and Type add, check or request a property template void do_property(MeshT& _mesh, PropertyAction action) { @@ -1615,6 +1615,7 @@ void do_property(MeshT& _mesh, PropertyAction action) } } +// for a given handle do action for OpenMesh Vector of dimension Dim with many differnt types template void do_all_property_types_vec(MeshT& _mesh, PropertyAction action) { @@ -1628,6 +1629,7 @@ void do_all_property_types_vec(MeshT& _mesh, PropertyAction action) do_property>(_mesh, action); } +// for a given handle do action for OpenMesh Vectors of dimensions 1 to 4 template void do_all_property_types_vec_all_dim(MeshT& _mesh, PropertyAction action) { @@ -1637,6 +1639,7 @@ void do_all_property_types_vec_all_dim(MeshT& _mesh, PropertyAction action) do_all_property_types_vec(_mesh, action); } +// for a given handle type do action for many different types template void do_all_property_types(MeshT& _mesh, PropertyAction action, int version) { @@ -1652,14 +1655,25 @@ void do_all_property_types(MeshT& _mesh, PropertyAction action, int version) do_property> (_mesh, action); do_property> (_mesh, action); do_property> (_mesh, action); +// do_property> (_mesh, action); - do_property>> (_mesh, action); - //do_property> (_mesh, action); + do_property>> (_mesh, action); + do_property>>(_mesh, action); + do_property>> (_mesh, action); + do_property>> (_mesh, action); +// do_property>> (_mesh, action); + + do_property>>> (_mesh, action); + do_property>>>(_mesh, action); + do_property>>> (_mesh, action); + do_property>>> (_mesh, action); +// do_property>>> (_mesh, action); } do_all_property_types_vec_all_dim(_mesh, action); } +// Do action for all property types for faces, edges, halfedges and vertices template void do_all_properties(MeshT& _mesh, PropertyAction action, int version) { @@ -1877,4 +1891,13 @@ TEST_F(OpenMeshReadWriteOM, WriteAndLoadBoolCheckSpaces) { OM_REGISTER_PROPERTY_TYPE(std::vector) OM_REGISTER_PROPERTY_TYPE(std::vector>) +OM_REGISTER_PROPERTY_TYPE(std::vector>) +OM_REGISTER_PROPERTY_TYPE(std::vector>) +OM_REGISTER_PROPERTY_TYPE(std::vector>) +OM_REGISTER_PROPERTY_TYPE(std::vector>) +OM_REGISTER_PROPERTY_TYPE(std::vector>>) +OM_REGISTER_PROPERTY_TYPE(std::vector>>) +OM_REGISTER_PROPERTY_TYPE(std::vector>>) +OM_REGISTER_PROPERTY_TYPE(std::vector>>) +OM_REGISTER_PROPERTY_TYPE(std::vector>>) OM_REGISTER_PROPERTY_TYPE(RegisteredDataType)