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
Dmitri Naumov
ogs
Commits
858d0a8a
Commit
858d0a8a
authored
4 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[MeL] Move print bounds lambda to function.
parent
aa675315
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MeshLib/MeshInformation.cpp
+24
-19
24 additions, 19 deletions
MeshLib/MeshInformation.cpp
with
24 additions
and
19 deletions
MeshLib/MeshInformation.cpp
+
24
−
19
View file @
858d0a8a
...
@@ -17,6 +17,23 @@
...
@@ -17,6 +17,23 @@
#include
"Elements/Element.h"
#include
"Elements/Element.h"
#include
"MeshLib/MeshQuality/MeshValidation.h"
#include
"MeshLib/MeshQuality/MeshValidation.h"
namespace
{
template
<
typename
T
>
void
printBounds
(
MeshLib
::
PropertyVector
<
T
>
const
&
property
)
{
auto
const
bounds
=
MeshLib
::
MeshInformation
::
getValueBounds
(
property
);
if
(
!
bounds
.
has_value
())
{
INFO
(
"
\t
{:s}: Could not get value bounds for property vector."
,
property
.
getPropertyName
());
return
;
}
INFO
(
"
\t
{:s}: ({:d} values) [{}, {}]"
,
property
.
getPropertyName
(),
property
.
size
(),
bounds
->
first
,
bounds
->
second
);
}
}
// namespace
namespace
MeshLib
namespace
MeshLib
{
{
GeoLib
::
AABB
MeshInformation
::
getBoundingBox
(
const
MeshLib
::
Mesh
&
mesh
)
GeoLib
::
AABB
MeshInformation
::
getBoundingBox
(
const
MeshLib
::
Mesh
&
mesh
)
...
@@ -58,44 +75,32 @@ void MeshInformation::writePropertyVectorInformation(const MeshLib::Mesh& mesh)
...
@@ -58,44 +75,32 @@ void MeshInformation::writePropertyVectorInformation(const MeshLib::Mesh& mesh)
auto
const
&
properties
=
mesh
.
getProperties
();
auto
const
&
properties
=
mesh
.
getProperties
();
INFO
(
"There are {:d} properties in the mesh:"
,
properties
.
size
());
INFO
(
"There are {:d} properties in the mesh:"
,
properties
.
size
());
auto
print_bounds
=
[](
auto
const
&
property
)
{
auto
const
bounds
=
getValueBounds
(
property
);
if
(
!
bounds
.
has_value
())
{
INFO
(
"
\t
{:s}: Could not get value bounds for property vector."
,
property
.
getPropertyName
());
return
;
}
INFO
(
"
\t
{:s}: ({:d} values) [{}, {}]"
,
property
.
getPropertyName
(),
property
.
size
(),
bounds
->
first
,
bounds
->
second
);
};
for
(
auto
[
name
,
property
]
:
properties
)
for
(
auto
[
name
,
property
]
:
properties
)
{
{
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
double
>*>
(
property
))
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
double
>*>
(
property
))
{
{
print
_b
ounds
(
*
p
);
print
B
ounds
(
*
p
);
}
}
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
float
>*>
(
property
))
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
float
>*>
(
property
))
{
{
print
_b
ounds
(
*
p
);
print
B
ounds
(
*
p
);
}
}
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
int
>*>
(
property
))
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
int
>*>
(
property
))
{
{
print
_b
ounds
(
*
p
);
print
B
ounds
(
*
p
);
}
}
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
unsigned
>*>
(
property
))
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
unsigned
>*>
(
property
))
{
{
print
_b
ounds
(
*
p
);
print
B
ounds
(
*
p
);
}
}
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
long
>*>
(
property
))
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
long
>*>
(
property
))
{
{
print
_b
ounds
(
*
p
);
print
B
ounds
(
*
p
);
}
}
else
if
(
auto
p
=
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
unsigned
long
>*>
(
property
))
dynamic_cast
<
PropertyVector
<
unsigned
long
>*>
(
property
))
{
{
print
_b
ounds
(
*
p
);
print
B
ounds
(
*
p
);
}
}
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
std
::
size_t
>*>
(
property
))
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
std
::
size_t
>*>
(
property
))
{
{
...
@@ -103,7 +108,7 @@ void MeshInformation::writePropertyVectorInformation(const MeshLib::Mesh& mesh)
...
@@ -103,7 +108,7 @@ void MeshInformation::writePropertyVectorInformation(const MeshLib::Mesh& mesh)
}
}
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
char
>*>
(
property
))
else
if
(
auto
p
=
dynamic_cast
<
PropertyVector
<
char
>*>
(
property
))
{
{
print
_b
ounds
(
*
p
);
print
B
ounds
(
*
p
);
}
}
else
else
{
{
...
...
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