Skip to content
Snippets Groups Projects
Commit 06382a60 authored by Tom Fischer's avatar Tom Fischer Committed by Dmitri Naumov
Browse files

[MeL/Elements] Add non-const getNode().

parent 987c1d8c
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,7 @@ public:
* @sa getNodeIndex()
*/
virtual const Node* getNode(unsigned idx) const = 0;
virtual Node* getNode(unsigned idx) = 0;
/**
* (Re)Sets the node of the element.
......
......@@ -109,6 +109,20 @@ const Node* TemplateElement<ELEMENT_RULE>::getNode(unsigned const idx) const
return _nodes[idx];
}
template <class ELEMENT_RULE>
Node* TemplateElement<ELEMENT_RULE>::getNode(unsigned const idx)
{
#ifndef NDEBUG
if (idx >= getNumberOfNodes())
{
ERR("Error in MeshLib::TemplateElement::getNode() - Index {:d} in {:s}",
idx, MeshElemType2String(getGeomType()));
return nullptr;
}
#endif
return _nodes[idx];
}
template <class ELEMENT_RULE>
void TemplateElement<ELEMENT_RULE>::setNode(unsigned idx, Node* node)
{
......
......@@ -189,6 +189,7 @@ public:
}
const Node* getNode(unsigned idx) const override;
Node* getNode(unsigned idx) override;
void setNode(unsigned idx, Node* node) override;
Node* const* getNodes() const override { return _nodes.data(); }
......
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