13 std::vector<std::unique_ptr<MeshLib::Mesh>>
const& mesh_vec,
21 this->startButton->setDisabled(
true);
24 for (
const auto& mesh : mesh_vec)
26 this->meshListBox->addItem(QString::fromStdString(mesh->getName()));
29 auto* collapse_threshold_validator =
31 this->collapsibleNodesThreshold->setValidator(collapse_threshold_validator);
33 auto* volume_threshold_validator =
35 this->zeroVolumeThreshold->setValidator(volume_threshold_validator);
43 *
_mesh_vec[this->meshListBox->currentIndex()].get());
50 this->collapsibleNodesThreshold->text().toDouble() +
51 std::numeric_limits<double>::epsilon()));
52 this->nodesGroupBox->setTitle(
56 const std::vector<ElementErrorCode> element_error_codes(
59 this->zeroVolumeThreshold->text().toDouble() +
60 std::numeric_limits<double>::epsilon()));
61 this->elementsGroupBox->setTitle(
69 this->meshHoleOutputLabel->setText(
70 "<strong>" + QString::number(n_holes) +
71 " hole(s) found within the mesh</strong>");
76 std::vector<std::size_t>
const& node_ids,
77 std::vector<std::size_t>
const& collapsibleNodeIds)
79 const std::size_t nNodeIds(node_ids.size());
80 QString nodes_output(
"");
83 nodes_output +=
"No unused nodes found.";
87 nodes_output += (QString::number(nNodeIds) +
88 " nodes are not part of any element:\n");
89 for (std::size_t i = 0; i < nNodeIds; ++i)
91 nodes_output += (QString::number(node_ids[i]) +
", ");
94 this->unusedNodesText->setText(nodes_output);
96 std::size_t
const nNodes(collapsibleNodeIds.size());
97 QString node_ids_str(
"");
99 for (std::size_t i = 0; i < nNodes; ++i)
101 if (i != collapsibleNodeIds[i])
103 node_ids_str.append(QString::number(i) +
", ");
107 nodes_output = (count > 0) ? QString::number(count) +
" nodes found:\n"
109 nodes_output.append(node_ids_str);
110 this->collapsibleNodesText->setText(nodes_output);
114 const std::vector<ElementErrorCode>& element_error_codes)
116 std::array<std::string,
119 element_error_codes));
121 this->zeroVolumeText->setText(QString::fromStdString(output_str[0]));
122 this->nonPlanarText->setText(QString::fromStdString(output_str[1]));
123 this->nonConvexText->setText(QString::fromStdString(output_str[2]));
124 this->nodeOrderText->setText(QString::fromStdString(output_str[3]));
void on_startButton_pressed()
Starts the analysis.
MeshAnalysisDialog(std::vector< std::unique_ptr< MeshLib::Mesh > > const &mesh_vec, QDialog *parent=nullptr)
void elementsMsgOutput(const std::vector< ElementErrorCode > &error_codes)
Prepares the output for the node message window.
~MeshAnalysisDialog() override
std::vector< std::unique_ptr< MeshLib::Mesh > > const & _mesh_vec
void nodesMsgOutput(std::vector< std::size_t > const &node_ids, std::vector< std::size_t > const &collapsibleNodeIds)
Prepares the output for the node message window.
std::size_t getNumberOfNodes() const
Get the number of nodes.
std::size_t getNumberOfElements() const
Get the number of elements.
const std::vector< std::size_t > & getSearchedNodeIDs() const
return marked node IDs
std::size_t searchUnused()
Marks all unused nodes.
A validator for an input field which only accepts decimals. Source code adapted from StackOverflow