Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wenqing
ogs
Commits
fe5e35f8
Commit
fe5e35f8
authored
6 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
clang-format
parent
6667db39
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Applications/DataExplorer/DataView/MeshElementRemovalDialog.cpp
+23
-13
23 additions, 13 deletions
...ations/DataExplorer/DataView/MeshElementRemovalDialog.cpp
MeshLib/MeshSearch/ElementSearch.h
+16
-15
16 additions, 15 deletions
MeshLib/MeshSearch/ElementSearch.h
with
39 additions
and
28 deletions
Applications/DataExplorer/DataView/MeshElementRemovalDialog.cpp
+
23
−
13
View file @
fe5e35f8
...
...
@@ -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
));
...
...
This diff is collapsed.
Click to expand it.
MeshLib/MeshSearch/ElementSearch.h
+
16
−
15
View file @
fe5e35f8
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment