Skip to content
Snippets Groups Projects
Commit d24e68e3 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL] Remove templated copyElement from I/F.

This function has internal usage only.
parent b24eabcf
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,20 @@ std::vector<MeshLib::Element*> copyElementVector( ...@@ -47,6 +47,20 @@ std::vector<MeshLib::Element*> copyElementVector(
return new_elements; return new_elements;
} }
/// Copies an element without change, using the nodes vector from the result
/// mesh.
template <typename E>
MeshLib::Element* copyElement(MeshLib::Element const* const element,
const std::vector<MeshLib::Node*>& nodes)
{
auto** new_nodes = new MeshLib::Node*[element->getNumberOfNodes()];
for (unsigned i = 0; i < element->getNumberOfNodes(); ++i)
{
new_nodes[i] = nodes[element->getNode(i)->getID()];
}
return new E(new_nodes);
}
MeshLib::Element* copyElement(MeshLib::Element const* const element, MeshLib::Element* copyElement(MeshLib::Element const* const element,
const std::vector<MeshLib::Node*>& nodes) const std::vector<MeshLib::Node*>& nodes)
{ {
...@@ -83,18 +97,6 @@ MeshLib::Element* copyElement(MeshLib::Element const* const element, ...@@ -83,18 +97,6 @@ MeshLib::Element* copyElement(MeshLib::Element const* const element,
return nullptr; return nullptr;
} }
template <typename E>
MeshLib::Element* copyElement(MeshLib::Element const* const element,
const std::vector<MeshLib::Node*>& nodes)
{
auto** new_nodes = new MeshLib::Node*[element->getNumberOfNodes()];
for (unsigned i = 0; i < element->getNumberOfNodes(); ++i)
{
new_nodes[i] = nodes[element->getNode(i)->getID()];
}
return new E(new_nodes);
}
std::vector<MeshLib::Element*> cloneElements( std::vector<MeshLib::Element*> cloneElements(
std::vector<MeshLib::Element*> const& elements) std::vector<MeshLib::Element*> const& elements)
{ {
......
...@@ -41,12 +41,6 @@ std::vector<MeshLib::Element*> copyElementVector( ...@@ -41,12 +41,6 @@ std::vector<MeshLib::Element*> copyElementVector(
MeshLib::Element* copyElement(MeshLib::Element const* const element, MeshLib::Element* copyElement(MeshLib::Element const* const element,
const std::vector<MeshLib::Node*>& nodes); const std::vector<MeshLib::Node*>& nodes);
/// Copies an element without change, using the nodes vector from the result
/// mesh.
template <typename E>
MeshLib::Element* copyElement(MeshLib::Element const* const element,
const std::vector<MeshLib::Node*>& nodes);
/// Clones a vector of elements using the Element::clone() function. /// Clones a vector of elements using the Element::clone() function.
std::vector<MeshLib::Element*> cloneElements( std::vector<MeshLib::Element*> cloneElements(
std::vector<MeshLib::Element*> const& elements); std::vector<MeshLib::Element*> const& elements);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment