(MeshIterator): cast cell type into CellType enum instead of using std::uint8_t
Description
When iterating on mesh's cells, the cell type value is a std::uint8_t. It can be directly cast to a CellType enum. It will allow to simply compare type to the enum without casting it.
Currently we write:
auto cellItr = mesh->begin< ::fwData::iterator::CellIterator >();
const auto cellItrEnd = mesh->end< ::fwData::iterator::CellIterator >();
for (; cellItr != cellItrEnd; ++cellItr)
{
const ::fwData::Mesh::CellTypes cellType = *cellItr->type;
switch (cellType)
{
case static_cast<std::uint8_t>(::fwData::Mesh::CellType::EDGE):
//...
break;
case static_cast<std::uint8_t>(::fwData::Mesh::CellType::TRIANGLE):
//...
break;
//...
}
}
It would be simpler to 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;
//...
}
}
Proposal
Use ::fwData::Mesh::CellType
enum in MeshIterator type array.