Skip to content
Snippets Groups Projects
Commit 5f465a62 authored by Dmitry Yu. Naumov's avatar Dmitry Yu. Naumov
Browse files

[MeL] Add hasAnyInactive to ctor parameters.

Allows for delegating ctors.
Make _hasAnyInactive a const member.
parent b0d4cc69
No related branches found
No related tags found
No related merge requests found
......@@ -20,8 +20,10 @@
namespace MeshLib {
ElementStatus::ElementStatus(Mesh const*const mesh)
: _mesh(mesh), _element_status(mesh->getNElements(), true), _hasAnyInactive(false)
ElementStatus::ElementStatus(Mesh const* const mesh, bool hasAnyInactive)
: _mesh(mesh),
_element_status(mesh->getNElements(), true),
_hasAnyInactive(hasAnyInactive)
{
const std::vector<MeshLib::Node*>& nodes(_mesh->getNodes());
for (auto node : nodes)
......
......@@ -27,7 +27,8 @@ class ElementStatus
public:
/// Constructor assuming all nodes and elements
explicit ElementStatus(MeshLib::Mesh const*const mesh);
explicit ElementStatus(MeshLib::Mesh const* const mesh,
bool hasAnyInactive = false);
/// Constructor taking a vector of inactive material IDs
ElementStatus(MeshLib::Mesh const*const mesh, std::vector<unsigned> const& vec_inactive_matIDs);
......@@ -61,7 +62,7 @@ protected:
/// Node status for each mesh node (value = number of active elements connected to node, 0 means inactive)
std::vector<unsigned char> _active_nodes;
bool _hasAnyInactive;
bool const _hasAnyInactive;
std::vector<MeshLib::Node*> _vec_active_nodes;
std::vector<MeshLib::Element*> _vec_active_eles;
......@@ -70,4 +71,3 @@ protected:
} /* namespace */
#endif /* ELEMENTSTATUS_H_ */
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