A dialog window for calling mesh analysis methods.
Definition at line 31 of file MeshAnalysisDialog.h.
#include <MeshAnalysisDialog.h>
|
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. More...
|
|
void | elementsMsgOutput (const std::vector< ElementErrorCode > &error_codes) |
| Prepares the output for the node message window. More...
|
|
◆ MeshAnalysisDialog()
MeshAnalysisDialog::MeshAnalysisDialog |
( |
std::vector< std::unique_ptr< MeshLib::Mesh >> const & |
mesh_vec, |
|
|
QDialog * |
parent = nullptr |
|
) |
| |
|
explicit |
Definition at line 23 of file MeshAnalysisDialog.cpp.
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);
std::vector< std::unique_ptr< MeshLib::Mesh > > const & _mesh_vec
A validator for an input field which only accepts decimals. Source code adapted from StackOverflow
◆ ~MeshAnalysisDialog()
MeshAnalysisDialog::~MeshAnalysisDialog |
( |
| ) |
|
|
overridedefault |
◆ elementsMsgOutput()
void MeshAnalysisDialog::elementsMsgOutput |
( |
const std::vector< ElementErrorCode > & |
error_codes | ) |
|
|
private |
Prepares the output for the node message window.
Definition at line 124 of file MeshAnalysisDialog.cpp.
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]));
static std::array< std::string, static_cast< std::size_t >ElementErrorFlag::MaxValue)> ElementErrorCodeOutput(const std::vector< ElementErrorCode > &error_codes)
References MeshLib::MeshValidation::ElementErrorCodeOutput(), and MaxValue.
Referenced by on_startButton_pressed().
◆ nodesMsgOutput()
void MeshAnalysisDialog::nodesMsgOutput |
( |
std::vector< std::size_t > const & |
node_ids, |
|
|
std::vector< std::size_t > const & |
collapsibleNodeIds |
|
) |
| |
|
private |
Prepares the output for the node message window.
Definition at line 86 of file MeshAnalysisDialog.cpp.
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);
Referenced by on_startButton_pressed().
◆ on_closeButton_pressed
void MeshAnalysisDialog::on_closeButton_pressed |
( |
| ) |
|
|
inlineprivateslot |
◆ on_startButton_pressed
void MeshAnalysisDialog::on_startButton_pressed |
( |
| ) |
|
|
privateslot |
Starts the analysis.
Definition at line 51 of file MeshAnalysisDialog.cpp.
54 *
_mesh_vec[this->meshListBox->currentIndex()].get());
58 const std::vector<std::size_t> unusedNodesIdx(ns.getSearchedNodeIDs());
60 std::vector<std::size_t>
const& collapsibleNodeIds(rev.collapseNodeIndices(
61 this->collapsibleNodesThreshold->text().toDouble() +
62 std::numeric_limits<double>::epsilon()));
63 this->nodesGroupBox->setTitle(
64 "Nodes (out of " + QString::number(mesh.getNumberOfNodes()) +
")");
67 const std::vector<ElementErrorCode> element_error_codes(
70 this->zeroVolumeThreshold->text().toDouble() +
71 std::numeric_limits<double>::epsilon()));
72 this->elementsGroupBox->setTitle(
73 "Elements (out of " + QString::number(mesh.getNumberOfElements()) +
80 this->meshHoleOutputLabel->setText(
81 "<strong>" + QString::number(n_holes) +
82 " hole(s) found within the mesh</strong>");
void elementsMsgOutput(const std::vector< ElementErrorCode > &error_codes)
Prepares the output for the node message window.
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.
static std::vector< ElementErrorCode > testElementGeometry(const MeshLib::Mesh &mesh, double min_volume=std::numeric_limits< double >::epsilon())
static unsigned detectHoles(MeshLib::Mesh const &mesh)
References _mesh_vec, MeshLib::MeshRevision::collapseNodeIndices(), MeshLib::MeshValidation::detectHoles(), elementsMsgOutput(), MeshLib::Mesh::getNumberOfElements(), MeshLib::Mesh::getNumberOfNodes(), MeshLib::NodeSearch::getSearchedNodeIDs(), nodesMsgOutput(), MeshLib::NodeSearch::searchUnused(), and MeshLib::MeshValidation::testElementGeometry().
◆ _mesh_vec
std::vector<std::unique_ptr<MeshLib::Mesh> > const& MeshAnalysisDialog::_mesh_vec |
|
private |
The documentation for this class was generated from the following files: