24 std::vector<std::unique_ptr<MeshLib::Mesh>>
const& mesh_vec,
26 : QDialog(parent), _mesh_vec(mesh_vec)
32 this->startButton->setDisabled(
true);
35 for (
const auto& mesh : mesh_vec)
37 this->meshListBox->addItem(QString::fromStdString(mesh->getName()));
40 auto* collapse_threshold_validator =
42 this->collapsibleNodesThreshold->setValidator(collapse_threshold_validator);
44 auto* volume_threshold_validator =
46 this->zeroVolumeThreshold->setValidator(volume_threshold_validator);
54 *
_mesh_vec[this->meshListBox->currentIndex()].get());
61 this->collapsibleNodesThreshold->text().toDouble() +
62 std::numeric_limits<double>::epsilon()));
63 this->nodesGroupBox->setTitle(
67 const std::vector<ElementErrorCode> element_error_codes(
70 this->zeroVolumeThreshold->text().toDouble() +
71 std::numeric_limits<double>::epsilon()));
72 this->elementsGroupBox->setTitle(
80 this->meshHoleOutputLabel->setText(
81 "<strong>" + QString::number(n_holes) +
82 " hole(s) found within the mesh</strong>");
87 std::vector<std::size_t>
const& node_ids,
88 std::vector<std::size_t>
const& collapsibleNodeIds)
90 const std::size_t nNodeIds(node_ids.size());
91 QString nodes_output(
"");
94 nodes_output +=
"No unused nodes found.";
98 nodes_output += (QString::number(nNodeIds) +
99 " nodes are not part of any element:\n");
100 for (std::size_t i = 0; i < nNodeIds; ++i)
102 nodes_output += (QString::number(node_ids[i]) +
", ");
105 this->unusedNodesText->setText(nodes_output);
107 std::size_t
const nNodes(collapsibleNodeIds.size());
108 QString node_ids_str(
"");
110 for (std::size_t i = 0; i < nNodes; ++i)
112 if (i != collapsibleNodeIds[i])
114 node_ids_str.append(QString::number(i) +
", ");
118 nodes_output = (count > 0) ? QString::number(count) +
" nodes found:\n"
120 nodes_output.append(node_ids_str);
121 this->collapsibleNodesText->setText(nodes_output);
125 const std::vector<ElementErrorCode>& element_error_codes)
127 std::array<std::string,
130 element_error_codes));
132 this->zeroVolumeText->setText(QString::fromStdString(output_str[0]));
133 this->nonPlanarText->setText(QString::fromStdString(output_str[1]));
134 this->nonConvexText->setText(QString::fromStdString(output_str[2]));
135 this->nodeOrderText->setText(QString::fromStdString(output_str[3]));
Definition of the MeshAnalysisDialog class.
Definition of the MeshRevision class.
Definition of the MeshValidation class.
Definition of the Mesh class.
Implementation of the StrictDoubleValidator class.
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