Skip to content
Snippets Groups Projects
Commit 04e1e13a authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL] Fix warning: Forcing value to bool.

parent 7359e923
No related branches found
No related tags found
No related merge requests found
...@@ -63,12 +63,11 @@ bool convertMeshToGeo(const MeshLib::Mesh &mesh, GeoLib::GEOObjects &geo_objects ...@@ -63,12 +63,11 @@ bool convertMeshToGeo(const MeshLib::Mesh &mesh, GeoLib::GEOObjects &geo_objects
const std::vector<MeshLib::Element*> &elements = mesh.getElements(); const std::vector<MeshLib::Element*> &elements = mesh.getElements();
const std::size_t nElems (mesh.getNumberOfElements()); const std::size_t nElems (mesh.getNumberOfElements());
auto materialIds = mesh.getProperties().getPropertyVector<int>(mat_name); auto const materialIds = mesh.getProperties().getPropertyVector<int>(mat_name);
auto const materialIdExist = bool(materialIds);
for (unsigned i=0; i<nElems; ++i) for (unsigned i=0; i<nElems; ++i)
{ {
auto surfaceId = materialIdExist ? (*materialIds)[i]-bounds.first : 0; auto surfaceId = !materialIds ? 0 : ((*materialIds)[i] - bounds.first);
MeshLib::Element* e (elements[i]); MeshLib::Element* e (elements[i]);
if (e->getGeomType() == MeshElemType::TRIANGLE) if (e->getGeomType() == MeshElemType::TRIANGLE)
(*sfcs)[surfaceId]->addTriangle(id_map[e->getNodeIndex(0)], id_map[e->getNodeIndex(1)], id_map[e->getNodeIndex(2)]); (*sfcs)[surfaceId]->addTriangle(id_map[e->getNodeIndex(0)], id_map[e->getNodeIndex(1)], id_map[e->getNodeIndex(2)]);
......
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