OGS
nextUnusedMaterialId.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2
// SPDX-License-Identifier: BSD-3-Clause
3
4
#pragma once
5
6
#include <range/v3/algorithm/max.hpp>
7
8
#include "
MeshLib/PropertyVector.h
"
9
10
namespace
MeshLib
11
{
14
inline
int
nextUnusedMaterialId
(
PropertyVector<int>
const
& material_ids)
15
{
16
return
material_ids.
empty
() ? 0 : ranges::max(material_ids) + 1;
17
}
18
}
// namespace MeshLib
PropertyVector.h
MeshLib::PropertyVector
Definition
PropertyVector.h:66
MeshLib::PropertyVector::empty
constexpr bool empty() const
Definition
PropertyVector.h:181
MeshLib
Definition
ProjectData.h:26
MeshLib::nextUnusedMaterialId
int nextUnusedMaterialId(PropertyVector< int > const &material_ids)
Definition
nextUnusedMaterialId.h:14
MeshLib
Utils
nextUnusedMaterialId.h
Generated by
1.14.0