Mesh: define the typenames FacetIndex and PointIndex to distinguish between facet and point related indexes

This commit is contained in:
wmayer
2021-09-14 23:01:29 +02:00
parent ce285ea265
commit 33f3fa6865
91 changed files with 2057 additions and 2254 deletions

View File

@@ -51,11 +51,11 @@ PyObject* ViewProviderMeshPy::setSelection(PyObject *args)
return 0;
Py::Sequence list(obj);
std::vector<unsigned long> selection;
std::vector<Mesh::FacetIndex> selection;
selection.reserve(list.size());
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
Py::Long index(*it);
unsigned long value = static_cast<unsigned long>(index);
Mesh::FacetIndex value = static_cast<Mesh::FacetIndex>(index);
selection.push_back(value);
}
@@ -71,11 +71,11 @@ PyObject* ViewProviderMeshPy::addSelection(PyObject *args)
return 0;
Py::Sequence list(obj);
std::vector<unsigned long> selection;
std::vector<Mesh::FacetIndex> selection;
selection.reserve(list.size());
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
Py::Long index(*it);
unsigned long value = static_cast<unsigned long>(index);
Mesh::FacetIndex value = static_cast<Mesh::FacetIndex>(index);
selection.push_back(value);
}
@@ -91,11 +91,11 @@ PyObject* ViewProviderMeshPy::removeSelection(PyObject *args)
return 0;
Py::Sequence list(obj);
std::vector<unsigned long> selection;
std::vector<Mesh::FacetIndex> selection;
selection.reserve(list.size());
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
Py::Long index(*it);
unsigned long value = static_cast<unsigned long>(index);
Mesh::FacetIndex value = static_cast<Mesh::FacetIndex>(index);
selection.push_back(value);
}