diff --git a/MeshLib/MeshEditing/MeshRevision.cpp b/MeshLib/MeshEditing/MeshRevision.cpp index 27b128e914e9069903930e08849ab171275695fa..7f36ffa862c1d18775bdd33e09a930cc73e85429 100644 --- a/MeshLib/MeshEditing/MeshRevision.cpp +++ b/MeshLib/MeshEditing/MeshRevision.cpp @@ -141,69 +141,6 @@ MeshLib::Mesh* MeshRevision::simplifyMesh(const std::string &new_mesh_name, return nullptr; } -MeshLib::Mesh* MeshRevision::subdivideMesh(const std::string &new_mesh_name) const -{ - if (this->_mesh.getNumberOfElements() == 0) - { - return nullptr; - } - - // original data - std::vector<MeshLib::Element*> const& elements(this->_mesh.getElements()); - MeshLib::Properties const& properties(_mesh.getProperties()); - auto const* material_vec = properties.getPropertyVector<int>("MaterialIDs"); - - // data structures for the new mesh - std::vector<MeshLib::Node*> new_nodes = MeshLib::copyNodeVector(_mesh.getNodes()); - std::vector<MeshLib::Element*> new_elements; - MeshLib::Properties new_properties; - PropertyVector<int>* new_material_vec = nullptr; - if (material_vec) { - new_material_vec = new_properties.createNewPropertyVector<int>( - "MaterialIDs", MeshItemType::Cell, 1 - ); - } - - for (std::size_t k(0); k<elements.size(); ++k) { - MeshLib::Element const*const elem(elements[k]); - ElementErrorCode error_code(elem->validate()); - if (error_code[ElementErrorFlag::NonCoplanar]) - { - std::size_t const n_new_elements( - subdivideElement(elem, new_nodes, new_elements)); - if (n_new_elements == 0) - { - ERR("Element %d has unknown element type.", k); - this->cleanUp(new_nodes, new_elements); - return nullptr; - } - // copy material values - if (!material_vec) - { - continue; - } - new_material_vec->insert(new_material_vec->end(), n_new_elements, - (*material_vec)[k]); - } else { - new_elements.push_back(MeshLib::copyElement(elem, new_nodes)); - // copy material values - if (material_vec) - { - new_material_vec->push_back((*material_vec)[k]); - } - } - } - - if (!new_elements.empty()) - { - return new MeshLib::Mesh(new_mesh_name, new_nodes, new_elements, - new_properties); - } - - this->cleanUp(new_nodes, new_elements); - return nullptr; -} - std::vector<std::size_t> MeshRevision::collapseNodeIndices(double eps) const { const std::vector<MeshLib::Node*> &nodes(_mesh.getNodes()); diff --git a/MeshLib/MeshEditing/MeshRevision.h b/MeshLib/MeshEditing/MeshRevision.h index bab42221b54c2ab9b3614580ad10197208c83189..e9bd9a16fed097966612385f48613fae254b4afa 100644 --- a/MeshLib/MeshEditing/MeshRevision.h +++ b/MeshLib/MeshEditing/MeshRevision.h @@ -71,12 +71,6 @@ public: MeshLib::Mesh* simplifyMesh(const std::string& new_mesh_name, double eps, unsigned min_elem_dim = 1); - /** - * Create a new mesh where all elements with nonplanar faces are subdivided into simpler - * element types. This method does not collapse or remove any nodes. - */ - MeshLib::Mesh* subdivideMesh(const std::string &new_mesh_name) const; - private: /// Constructs a new node vector for the resulting mesh by removing all nodes whose ID indicates they need to be merged/removed. std::vector<MeshLib::Node*> constructNewNodesArray(