Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
MostafaMollaali
dynamic
Commits
b32d6005
Commit
b32d6005
authored
5 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[MeL] clang-format MeshInformation files.
parent
88c8a5fa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MeshLib/MeshInformation.cpp
+5
-5
5 additions, 5 deletions
MeshLib/MeshInformation.cpp
MeshLib/MeshInformation.h
+21
-21
21 additions, 21 deletions
MeshLib/MeshInformation.h
with
26 additions
and
26 deletions
MeshLib/MeshInformation.cpp
+
5
−
5
View file @
b32d6005
...
@@ -17,17 +17,17 @@
...
@@ -17,17 +17,17 @@
namespace
MeshLib
namespace
MeshLib
{
{
const
GeoLib
::
AABB
MeshInformation
::
getBoundingBox
(
const
MeshLib
::
Mesh
&
mesh
)
const
GeoLib
::
AABB
MeshInformation
::
getBoundingBox
(
const
MeshLib
::
Mesh
&
mesh
)
{
{
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
(
mesh
.
getNodes
());
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
(
mesh
.
getNodes
());
return
GeoLib
::
AABB
(
nodes
.
begin
(),
nodes
.
end
());
return
GeoLib
::
AABB
(
nodes
.
begin
(),
nodes
.
end
());
}
}
const
std
::
array
<
unsigned
,
7
>
MeshInformation
::
getNumberOfElementTypes
(
const
MeshLib
::
Mesh
&
mesh
)
const
std
::
array
<
unsigned
,
7
>
MeshInformation
::
getNumberOfElementTypes
(
const
MeshLib
::
Mesh
&
mesh
)
{
{
std
::
array
<
unsigned
,
7
>
n_element_types
=
{{
0
,
0
,
0
,
0
,
0
,
0
,
0
}};
std
::
array
<
unsigned
,
7
>
n_element_types
=
{{
0
,
0
,
0
,
0
,
0
,
0
,
0
}};
const
std
::
vector
<
MeshLib
::
Element
*>
&
elements
(
mesh
.
getElements
());
const
std
::
vector
<
MeshLib
::
Element
*>&
elements
(
mesh
.
getElements
());
for
(
auto
element
:
elements
)
for
(
auto
element
:
elements
)
{
{
MeshElemType
t
=
element
->
getGeomType
();
MeshElemType
t
=
element
->
getGeomType
();
...
...
This diff is collapsed.
Click to expand it.
MeshLib/MeshInformation.h
+
21
−
21
View file @
b32d6005
...
@@ -15,8 +15,8 @@
...
@@ -15,8 +15,8 @@
#pragma once
#pragma once
#include
<array>
#include
<array>
#include
<string>
#include
<limits>
#include
<limits>
#include
<string>
#include
"GeoLib/AABB.h"
#include
"GeoLib/AABB.h"
#include
"MeshLib/Mesh.h"
#include
"MeshLib/Mesh.h"
...
@@ -25,49 +25,49 @@
...
@@ -25,49 +25,49 @@
namespace
MeshLib
namespace
MeshLib
{
{
/**
/**
* \brief A set of tools for extracting information from a mesh
* \brief A set of tools for extracting information from a mesh
*/
*/
class
MeshInformation
class
MeshInformation
{
{
public:
public:
/// Returns the smallest and largest value of a scalar array with the given name.
/// Returns the smallest and largest value of a scalar array with the given
template
<
typename
T
>
/// name.
static
std
::
pair
<
T
,
T
>
const
template
<
typename
T
>
getValueBounds
(
MeshLib
::
Mesh
const
&
mesh
,
std
::
string
const
&
name
)
static
std
::
pair
<
T
,
T
>
const
getValueBounds
(
MeshLib
::
Mesh
const
&
mesh
,
std
::
string
const
&
name
)
{
{
if
(
!
mesh
.
getProperties
().
existsPropertyVector
<
T
>
(
name
))
if
(
!
mesh
.
getProperties
().
existsPropertyVector
<
T
>
(
name
))
return
{
std
::
numeric_limits
<
T
>::
max
(),
std
::
numeric_limits
<
T
>::
max
()};
return
{
std
::
numeric_limits
<
T
>::
max
(),
std
::
numeric_limits
<
T
>::
max
()};
auto
const
*
const
data_vec
=
auto
const
*
const
data_vec
=
mesh
.
getProperties
().
getPropertyVector
<
T
>
(
name
);
mesh
.
getProperties
().
getPropertyVector
<
T
>
(
name
);
if
(
data_vec
->
empty
())
{
if
(
data_vec
->
empty
())
{
INFO
(
"Mesh does not contain values for the property '%s'."
,
INFO
(
"Mesh does not contain values for the property '%s'."
,
name
.
c_str
());
name
.
c_str
());
return
{
std
::
numeric_limits
<
T
>::
max
(),
std
::
numeric_limits
<
T
>::
max
()};
return
{
std
::
numeric_limits
<
T
>::
max
(),
std
::
numeric_limits
<
T
>::
max
()};
}
}
auto
vec_bounds
=
std
::
minmax_element
(
data_vec
->
cbegin
(),
data_vec
->
cend
());
auto
vec_bounds
=
std
::
minmax_element
(
data_vec
->
cbegin
(),
data_vec
->
cend
());
return
{
*
(
vec_bounds
.
first
),
*
(
vec_bounds
.
second
)};
return
{
*
(
vec_bounds
.
first
),
*
(
vec_bounds
.
second
)};
}
}
/// Returns the bounding box of the mesh.
/// Returns the bounding box of the mesh.
static
const
GeoLib
::
AABB
getBoundingBox
(
const
MeshLib
::
Mesh
&
mesh
);
static
const
GeoLib
::
AABB
getBoundingBox
(
const
MeshLib
::
Mesh
&
mesh
);
/**
/**
* Returns an array with the number of elements of each type in the given mesh.
* Returns an array with the number of elements of each type in the given
* On completion, n_element_types array contains the number of elements of each of the seven
* mesh. On completion, n_element_types array contains the number of
* supported types. The index to element type conversion is this:
* elements of each of the seven supported types. The index to element type
* 0: \#lines
* conversion is this: 0: \#lines 1: \#triangles 2: \#quads 3: \#tetrahedra
* 1: \#triangles
* 2: \#quads
* 3: \#tetrahedra
* 4: \#hexahedra
* 4: \#hexahedra
* 5: \#pyramids
* 5: \#pyramids
* 6: \#prisms
* 6: \#prisms
*/
*/
static
const
std
::
array
<
unsigned
,
7
>
getNumberOfElementTypes
(
const
MeshLib
::
Mesh
&
mesh
);
static
const
std
::
array
<
unsigned
,
7
>
getNumberOfElementTypes
(
const
MeshLib
::
Mesh
&
mesh
);
};
};
}
// namespace MeshLib
}
// namespace MeshLib
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