diff --git a/MeshLib/MeshEditing/MeshRevision.cpp b/MeshLib/MeshEditing/MeshRevision.cpp index b6d720f0f0c3ab3d80f09c941d515d249e8e7c93..0e6efb7f3796fe96eb452670780e16fbbb27e8e4 100644 --- a/MeshLib/MeshEditing/MeshRevision.cpp +++ b/MeshLib/MeshEditing/MeshRevision.cpp @@ -227,21 +227,20 @@ void MeshRevision::resetNodeIDs() nodes[i]->setID(i); } -bool MeshRevision::subdivideElement( +std::size_t MeshRevision::subdivideElement( MeshLib::Element const*const element, std::vector<MeshLib::Node*> const& nodes, std::vector<MeshLib::Element*> & elements) const { - unsigned n_new_elems (0); if (element->getGeomType() == MeshElemType::QUAD) - n_new_elems = this->subdivideQuad(element, nodes, elements); + return this->subdivideQuad(element, nodes, elements); else if (element->getGeomType() == MeshElemType::HEXAHEDRON) - n_new_elems = this->subdivideHex(element, nodes, elements); + return this->subdivideHex(element, nodes, elements); else if (element->getGeomType() == MeshElemType::PYRAMID) - n_new_elems = this->subdividePyramid(element, nodes, elements); + return this->subdividePyramid(element, nodes, elements); else if (element->getGeomType() == MeshElemType::PRISM) - n_new_elems = this->subdividePrism(element, nodes, elements); - return (n_new_elems > 0); + return this->subdividePrism(element, nodes, elements); + return 0; } void MeshRevision::reduceElement(MeshLib::Element const*const element, diff --git a/MeshLib/MeshEditing/MeshRevision.h b/MeshLib/MeshEditing/MeshRevision.h index 7c9b3ceb3defc91fac4add0bff8966f8aedfc5d2..621a476a04c0cb9e736c732b5c5c4bc243467865 100644 --- a/MeshLib/MeshEditing/MeshRevision.h +++ b/MeshLib/MeshEditing/MeshRevision.h @@ -85,7 +85,15 @@ private: void resetNodeIDs(); /// Subdivides an element if it has a face that is not coplanar - bool subdivideElement(MeshLib::Element const*const element, const std::vector<MeshLib::Node*> &nodes, std::vector<MeshLib::Element*> &elements) const; + /// @param element the element that will be subdivided + /// @param nodes vector containing the nodes the elements originated by the + /// subdivision are based on + /// @param elements vector of MeshLib::Elements; the elements originated by + /// the subdivision will be inserted into elements + /// @return the number of elements originated by the subdivision + std::size_t subdivideElement(MeshLib::Element const*const element, + std::vector<MeshLib::Node*> const& nodes, + std::vector<MeshLib::Element*> & elements) const; // Revises an element by removing collapsed nodes, using the nodes vector from the result mesh. void reduceElement(MeshLib::Element const*const element,