Skip to content
Snippets Groups Projects
Commit 9b5bf407 authored by Tom Fischer's avatar Tom Fischer
Browse files

Substitute and remove searchByMaterialIDs.

parent 3e35b2fd
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@ void MeshElementRemovalDialog::accept()
{
QList<QListWidgetItem*> items = this->materialListWidget->selectedItems();
for (int i=0; i<items.size(); ++i)
ex.searchByMaterialID(items[i]->text().toInt());
ex.searchByPropertyValue(items[i]->text().toInt());
anything_checked = true;
}
if (this->boundingBoxCheckBox->isChecked())
......
......@@ -21,26 +21,6 @@ ElementSearch::ElementSearch(const MeshLib::Mesh &mesh)
{
}
std::size_t ElementSearch::searchByMaterialID(int const matID)
{
boost::optional<MeshLib::PropertyVector<int> const&> opt_pv(
this->_mesh.getProperties().getPropertyVector<int>("MaterialIDs")
);
if (!opt_pv)
return 0;
MeshLib::PropertyVector<int> const& pv(opt_pv.get());
std::vector<std::size_t> matchedIDs;
for (std::size_t i(0); i<pv.getNumberOfTuples(); ++i) {
if (pv[i]==matID)
matchedIDs.push_back(i);
}
this->updateUnion(matchedIDs);
return matchedIDs.size();
}
template <typename Container, typename Predicate>
std::vector<std::size_t> filter(Container const& container, Predicate const& p)
{
......
......@@ -73,9 +73,6 @@ public:
return matchedIDs.size();
}
/// Marks all elements with the given Material ID.
std::size_t searchByMaterialID(int const matID);
/// Marks all elements of the given element type.
std::size_t searchByElementType(MeshElemType eleType);
......
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