63 if (this->newMeshNameEdit->text().size() == 0)
69 bool anything_checked(
false);
74 if (this->elementTypeCheckBox->isChecked())
76 QList<QListWidgetItem*> items =
77 this->elementTypeListWidget->selectedItems();
78 for (
auto& item : items)
80 ex.searchByElementType(
83 anything_checked =
true;
85 if (this->scalarArrayCheckBox->isChecked())
87 std::string
const array_name =
88 this->scalarArrayComboBox->currentText().toStdString();
91 bool outside = this->outsideButton->isChecked();
94 min_val = this->outsideScalarMinEdit->text().toDouble();
95 max_val = this->outsideScalarMaxEdit->text().toDouble();
99 min_val = this->insideScalarMinEdit->text().toDouble();
100 max_val = this->insideScalarMaxEdit->text().toDouble();
103 std::size_t n_marked_elements(0);
106 n_marked_elements = ex.searchByPropertyValueRange<
double>(
107 array_name, min_val, max_val, outside);
111 int const lbound =
static_cast<int>(min_val);
112 int const rbound =
static_cast<int>(max_val);
113 n_marked_elements = ex.searchByPropertyValueRange<
int>(
114 array_name, lbound, rbound, outside);
117 if (n_marked_elements > 0)
119 anything_checked =
true;
122 if (this->boundingBoxCheckBox->isChecked())
124 std::vector<MeshLib::Node*>
const& nodes(
126 .getMesh(this->meshNameComboBox->currentText().toStdString())
129 auto minAABB = aabb.getMinPoint();
130 auto maxAABB = aabb.getMaxPoint();
135 (
aabb_edits[0]) ? this->xMinEdit->text().toDouble() : (minAABB[0]);
137 (
aabb_edits[1]) ? this->xMaxEdit->text().toDouble() : (maxAABB[0]);
139 (
aabb_edits[2]) ? this->yMinEdit->text().toDouble() : (minAABB[1]);
141 (
aabb_edits[3]) ? this->yMaxEdit->text().toDouble() : (maxAABB[1]);
143 (
aabb_edits[4]) ? this->zMinEdit->text().toDouble() : (minAABB[2]);
145 (
aabb_edits[5]) ? this->zMaxEdit->text().toDouble() : (maxAABB[2]);
146 std::vector<Eigen::Vector3d, Eigen::aligned_allocator<Eigen::Vector3d>>
147 extent{minAABB, maxAABB};
148 const GeoLib::AABB updated_aabb(extent.begin(), extent.end());
149 ex.searchByBoundingBox(updated_aabb);
150 anything_checked =
true;
153 if (this->zeroVolumeCheckBox->isChecked())
155 ex.searchByContent();
156 anything_checked =
true;
159 if (anything_checked)
162 *msh, ex.getSearchedElementIDs(),
163 this->newMeshNameEdit->text().toStdString());
170 if (ex.getSearchedElementIDs().empty())
173 "The current selection removes NO mesh elements.");
184 this->done(QDialog::Accepted);
const MeshLib::Mesh * getMesh(const std::string &name) const
Class AABB is an axis aligned bounding box around a given set of geometric points of (template) type ...
void meshAdded(MeshLib::Mesh *mesh)
std::array< bool, 6 > aabb_edits
Properties & getProperties()
bool existsPropertyVector(std::string const &name) const
MeshLib::Mesh * removeElements(const MeshLib::Mesh &mesh, const std::vector< std::size_t > &removed_element_ids, const std::string &new_mesh_name)
MeshElemType String2MeshElemType(const std::string &s)
Given a string of the shortened name of the element type, this returns the corresponding MeshElemType...