/** * \file * \author Karsten Rink * \date 2014-03-25 * \brief Definition of Duplicate functions * * \copyright * Copyright (c) 2012-2023, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. * See accompanying file LICENSE.txt or * http://www.opengeosys.org/project/license * */ #pragma once #include namespace MeshLib { class Node; class Element; /// Creates a deep copy of a Node vector std::vector copyNodeVector(const std::vector& nodes); /** Creates a deep copy of an element vector using the given Node vector. * \param elements The element vector that should be duplicated. * \param new_nodes The new node vector used for the duplicated element vector. * \param node_id_map An optional mapping from the nodes the 'old' elements * based on to the new nodes. This should be consistent with the original node * vector. * \return A deep copy of the elements vector using the new nodes vector. */ std::vector copyElementVector( std::vector const& elements, std::vector const& new_nodes, std::vector const* const node_id_map = nullptr); /// Copies an element without change, using the nodes vector from the result /// mesh and an optional mapping from the nodes the 'old' elements. Element* copyElement(Element const* const element, const std::vector& nodes, std::vector const* const id_map = nullptr); /// Clones a vector of elements using the Element::clone() function. std::vector cloneElements(std::vector const& elements); } // end namespace MeshLib