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