Skip to content
Snippets Groups Projects
Commit fe5e35f8 authored by Karsten Rink's avatar Karsten Rink
Browse files

clang-format

parent 6667db39
No related branches found
No related tags found
No related merge requests found
...@@ -14,25 +14,29 @@ ...@@ -14,25 +14,29 @@
#include "MeshElementRemovalDialog.h" #include "MeshElementRemovalDialog.h"
#include <algorithm>
#include <QList> #include <QList>
#include <QListWidgetItem> #include <QListWidgetItem>
#include <algorithm>
#include "Applications/DataExplorer/Base/OGSError.h" #include "Applications/DataExplorer/Base/OGSError.h"
#include "Applications/DataHolderLib/Project.h" #include "Applications/DataHolderLib/Project.h"
#include "Elements/Element.h" #include "Elements/Element.h"
#include "GeoLib/AABB.h" #include "GeoLib/AABB.h"
#include "MeshLib/Mesh.h" #include "MeshLib/Mesh.h"
#include "MeshLib/Properties.h"
#include "MeshLib/PropertyVector.h"
#include "MeshLib/MeshEditing/RemoveMeshComponents.h" #include "MeshLib/MeshEditing/RemoveMeshComponents.h"
#include "MeshLib/MeshSearch/ElementSearch.h" #include "MeshLib/MeshSearch/ElementSearch.h"
#include "MeshLib/Node.h" #include "MeshLib/Node.h"
#include "MeshLib/Properties.h"
#include "MeshLib/PropertyVector.h"
/// Constructor /// Constructor
MeshElementRemovalDialog::MeshElementRemovalDialog(DataHolderLib::Project const& project, QDialog* parent) MeshElementRemovalDialog::MeshElementRemovalDialog(
: QDialog(parent), _project(project), _currentIndex(0), _aabbIndex(std::numeric_limits<unsigned>::max()), DataHolderLib::Project const& project, QDialog* parent)
_scalarIndex(std::numeric_limits<unsigned>::max()) : QDialog(parent),
_project(project),
_currentIndex(0),
_aabbIndex(std::numeric_limits<unsigned>::max()),
_scalarIndex(std::numeric_limits<unsigned>::max())
{ {
setupUi(this); setupUi(this);
...@@ -240,7 +244,8 @@ void MeshElementRemovalDialog::on_scalarArrayCheckBox_toggled(bool is_checked) ...@@ -240,7 +244,8 @@ void MeshElementRemovalDialog::on_scalarArrayCheckBox_toggled(bool is_checked)
return; return;
} }
MeshLib::Mesh const*const mesh = _project.getMesh(meshNameComboBox->currentText().toStdString()); MeshLib::Mesh const* const mesh =
_project.getMesh(meshNameComboBox->currentText().toStdString());
if (addScalarArrays(*mesh) > 0) if (addScalarArrays(*mesh) > 0)
enableScalarArrayWidgets(true); enableScalarArrayWidgets(true);
else else
...@@ -262,23 +267,27 @@ void MeshElementRemovalDialog::on_meshNameComboBox_currentIndexChanged(int idx) ...@@ -262,23 +267,27 @@ void MeshElementRemovalDialog::on_meshNameComboBox_currentIndexChanged(int idx)
this->outsideScalarMaxEdit->setText(""); this->outsideScalarMaxEdit->setText("");
this->insideScalarMinEdit->setText(""); this->insideScalarMinEdit->setText("");
this->insideScalarMaxEdit->setText(""); this->insideScalarMaxEdit->setText("");
if (this->scalarArrayCheckBox->isChecked()) on_scalarArrayCheckBox_toggled(true); if (this->scalarArrayCheckBox->isChecked())
if (this->boundingBoxCheckBox->isChecked()) on_boundingBoxCheckBox_toggled(true); on_scalarArrayCheckBox_toggled(true);
if (this->boundingBoxCheckBox->isChecked())
on_boundingBoxCheckBox_toggled(true);
} }
void MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(int idx) void MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(int idx)
{ {
Q_UNUSED(idx); Q_UNUSED(idx);
MeshLib::Mesh const*const mesh = _project.getMesh(meshNameComboBox->currentText().toStdString()); MeshLib::Mesh const* const mesh =
_project.getMesh(meshNameComboBox->currentText().toStdString());
MeshLib::Properties const& properties = mesh->getProperties(); MeshLib::Properties const& properties = mesh->getProperties();
std::string const vec_name (scalarArrayComboBox->currentText().toStdString()); std::string const vec_name(scalarArrayComboBox->currentText().toStdString());
if (vec_name == "") if (vec_name == "")
return; return;
if (properties.existsPropertyVector<int>(vec_name)) if (properties.existsPropertyVector<int>(vec_name))
{ {
MeshLib::PropertyVector<int> const& vec = *properties.getPropertyVector<int>(vec_name); MeshLib::PropertyVector<int> const& vec =
*properties.getPropertyVector<int>(vec_name);
auto min = std::min_element(vec.cbegin(), vec.cend()); auto min = std::min_element(vec.cbegin(), vec.cend());
auto max = std::max_element(vec.cbegin(), vec.cend()); auto max = std::max_element(vec.cbegin(), vec.cend());
this->outsideScalarMinEdit->setText(QString::number(*min)); this->outsideScalarMinEdit->setText(QString::number(*min));
...@@ -288,7 +297,8 @@ void MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(int id ...@@ -288,7 +297,8 @@ void MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(int id
} }
else if (properties.existsPropertyVector<double>(vec_name)) else if (properties.existsPropertyVector<double>(vec_name))
{ {
MeshLib::PropertyVector<double> const& vec = *properties.getPropertyVector<double>(vec_name); MeshLib::PropertyVector<double> const& vec =
*properties.getPropertyVector<double>(vec_name);
auto min = std::min_element(vec.cbegin(), vec.cend()); auto min = std::min_element(vec.cbegin(), vec.cend());
auto max = std::max_element(vec.cbegin(), vec.cend()); auto max = std::max_element(vec.cbegin(), vec.cend());
this->outsideScalarMinEdit->setText(QString::number(*min)); this->outsideScalarMinEdit->setText(QString::number(*min));
......
...@@ -34,34 +34,35 @@ public: ...@@ -34,34 +34,35 @@ public:
/// @tparam PROPERTY_TYPE integral type of the property /// @tparam PROPERTY_TYPE integral type of the property
/// Different properties can be assigned to the elements of the mesh. These /// Different properties can be assigned to the elements of the mesh. These
/// properties can be accessed by the name of the property. The method marks /// properties can be accessed by the name of the property. The method marks
/// all elements of the mesh for the property \c property_name with a property value /// all elements of the mesh for the property \c property_name with a
/// equal to \c property_value. /// property value equal to \c property_value.
/// @param property_name the name of the property the searching/marking is /// @param property_name the name of the property the searching/marking is
/// based on /// based on
/// @param property_value value required for the element to be marked /// @param property_value value required for the element to be marked
/// @return The number of marked elements will be returned. The concrete /// @return The number of marked elements will be returned. The concrete
/// element ids can be requested by getSearchedElementIDs(). /// element ids can be requested by getSearchedElementIDs().
template <typename PROPERTY_TYPE> template <typename PROPERTY_TYPE>
std::size_t searchByPropertyValue( std::size_t searchByPropertyValue(std::string const& property_name,
std::string const& property_name, PROPERTY_TYPE const property_value)
PROPERTY_TYPE const property_value)
{ {
return searchByPropertyValueRange<PROPERTY_TYPE>(property_name, property_value, property_value, false); return searchByPropertyValueRange<PROPERTY_TYPE>(
property_name, property_value, property_value, false);
} }
/// @tparam PROPERTY_TYPE integral type of the property /// @tparam PROPERTY_TYPE integral type of the property
/// Different properties can be assigned to the elements of the mesh. These /// Different properties can be assigned to the elements of the mesh. These
/// properties can be accessed by the name of the property. The method marks /// properties can be accessed by the name of the property. The method marks
/// all elements of the mesh for the property \c property_name with a property value /// all elements of the mesh for the property \c property_name with a
/// outside of the interval [min_property_value, max_property_value]. /// property value outside of the interval [min_property_value,
/// max_property_value].
/// @param property_name the name of the property the searching/marking is /// @param property_name the name of the property the searching/marking is
/// based on /// based on
/// @param min_property_value minimum value of the given property for the element not /// @param min_property_value minimum value of the given property for the
/// to be marked /// element not to be marked
/// @param max_property_value maximum value of the given property for the element not /// @param max_property_value maximum value of the given property for the
/// to be marked /// element not to be marked
/// @param outside_of if true, all values outside of the given range or markedc, /// @param outside_of if true, all values outside of the given range or
/// if false, all values inside the given range are marked /// markedc, if false, all values inside the given range are marked
/// @return The number of marked elements will be returned. The concrete /// @return The number of marked elements will be returned. The concrete
/// element ids can be requested by getSearchedElementIDs(). /// element ids can be requested by getSearchedElementIDs().
template <typename PROPERTY_TYPE> template <typename PROPERTY_TYPE>
...@@ -82,7 +83,7 @@ public: ...@@ -82,7 +83,7 @@ public:
if (pv->getMeshItemType() != MeshLib::MeshItemType::Cell) if (pv->getMeshItemType() != MeshLib::MeshItemType::Cell)
{ {
WARN("The property \"%s\" is not assigned to mesh elements.", WARN("The property \"%s\" is not assigned to mesh elements.",
property_name.c_str()); property_name.c_str());
return 0; return 0;
} }
......
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