(MeshIterator): cast cell type into CellType enum instead of using std::uint8_t
requested to merge 494-meshiterator-cast-cell-type-into-celltype-enum-instead-of-using-std-uint8_t into dev
What does this MR do?
When iterating through mesh cells, the iterator return the type as a CellType enum instead of a std::uint8_t. It allow to avoid a static_cast to compare the type to the enum.
Now we can simple write:
auto cellItr = mesh->begin< ::fwData::iterator::CellIterator >();
const auto cellItrEnd = mesh->end< ::fwData::iterator::CellIterator >();
for (; cellItr != cellItrEnd; ++cellItr)
{
const ::fwData::Mesh::CellType cellType = *cellItr->type;
switch (cellType)
{
case ::fwData::Mesh::CellType::EDGE:
//...
break;
case ::fwData::Mesh::CellType::TRIANGLE:
//...
break;
//...
}
}
note: It is just a proposition, this change is not mandatory but can improve readability.
How to test it?
Launch unit tests, launch the applications that uses mesh (almost all).
Associated Issues/Merge Requests
- Issues
- Fixes #494 (closed)