diff --git a/MeshLib/Properties.cpp b/MeshLib/Properties.cpp index 0d4c2a240151c81ff75fb15c7159aa3d2b6a909a..3c29f8605d648829231bfbc914176f9ff626ff46 100644 --- a/MeshLib/Properties.cpp +++ b/MeshLib/Properties.cpp @@ -72,6 +72,26 @@ Properties Properties::excludeCopyProperties( return exclude_copy; } +Properties Properties::excludeCopyProperties( + std::vector<MeshItemType> const& exclude_mesh_item_types) const +{ + Properties new_properties; + for (auto property_vector : _properties) { + if (std::find(exclude_mesh_item_types.begin(), + exclude_mesh_item_types.end(), + property_vector.second->getMeshItemType()) != + exclude_mesh_item_types.end()) + continue; + + std::vector<std::size_t> const exclude_positions; + new_properties._properties.insert( + std::make_pair(property_vector.first, + property_vector.second->clone(exclude_positions)) + ); + } + return new_properties; +} + Properties::Properties(Properties const& properties) : _properties(properties._properties) { diff --git a/MeshLib/Properties.h b/MeshLib/Properties.h index 1dacf08e7d5799e2e89e0873f31c305cff348740..a5ea25de6b0bf71ea2054f691604a44b6fbf6c55 100644 --- a/MeshLib/Properties.h +++ b/MeshLib/Properties.h @@ -107,6 +107,12 @@ public: std::vector<std::size_t> const& exclude_elem_ids, std::vector<std::size_t> const& exclude_node_ids) const; + /** copy all PropertyVector objects stored in the (internal) map but + * PropertyVector objects with the given MeshItemType are excluded. + */ + Properties excludeCopyProperties( + std::vector<MeshItemType> const& exclude_mesh_item_types) const; + Properties() {} Properties(Properties const& properties);