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
Chaofan Chen
ogs
Commits
17b0db37
Commit
17b0db37
authored
2 years ago
by
wenqing
Committed by
Dmitri Naumov
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[PropertyVector] Added an overload function hasPropertyVector
parent
aef09045
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/Properties-impl.h
+17
-0
17 additions, 0 deletions
MeshLib/Properties-impl.h
MeshLib/Properties.h
+8
-0
8 additions, 0 deletions
MeshLib/Properties.h
with
25 additions
and
0 deletions
MeshLib/Properties-impl.h
+
17
−
0
View file @
17b0db37
...
@@ -147,6 +147,23 @@ PropertyVector<T>* Properties::getPropertyVector(std::string_view name)
...
@@ -147,6 +147,23 @@ PropertyVector<T>* Properties::getPropertyVector(std::string_view name)
return
dynamic_cast
<
PropertyVector
<
T
>*>
(
it
->
second
);
return
dynamic_cast
<
PropertyVector
<
T
>*>
(
it
->
second
);
}
}
template
<
typename
T
>
bool
Properties
::
hasPropertyVector
(
std
::
string
const
&
name
,
MeshItemType
const
item_type
)
const
{
auto
const
it
=
_properties
.
find
(
name
);
if
(
it
==
_properties
.
end
())
{
return
false
;
}
auto
property
=
dynamic_cast
<
PropertyVector
<
T
>*>
(
it
->
second
);
return
(
property
==
nullptr
)
?
false
:
property
->
getMeshItemType
()
==
item_type
;
}
template
<
typename
T
>
template
<
typename
T
>
PropertyVector
<
T
>
const
*
Properties
::
getPropertyVector
(
PropertyVector
<
T
>
const
*
Properties
::
getPropertyVector
(
std
::
string_view
name
,
MeshItemType
const
item_type
,
std
::
string_view
name
,
MeshItemType
const
item_type
,
...
...
This diff is collapsed.
Click to expand it.
MeshLib/Properties.h
+
8
−
0
View file @
17b0db37
...
@@ -123,6 +123,14 @@ public:
...
@@ -123,6 +123,14 @@ public:
/// @param name the name of the property (for instance porosity)
/// @param name the name of the property (for instance porosity)
bool
hasPropertyVector
(
std
::
string_view
name
)
const
;
bool
hasPropertyVector
(
std
::
string_view
name
)
const
;
/// Check if a PropertyVector accessible by the name and by the item type
/// is already stored within the Properties object.
/// @param name the name of the property, e.g. porosity.
/// @param item_type the type of mesh entity, e.g. CELL.
template
<
typename
T
>
bool
hasPropertyVector
(
std
::
string
const
&
name
,
MeshItemType
const
item_type
)
const
;
std
::
vector
<
std
::
string
>
getPropertyVectorNames
()
const
;
std
::
vector
<
std
::
string
>
getPropertyVectorNames
()
const
;
std
::
vector
<
std
::
string
>
getPropertyVectorNames
(
std
::
vector
<
std
::
string
>
getPropertyVectorNames
(
MeshLib
::
MeshItemType
t
)
const
;
MeshLib
::
MeshItemType
t
)
const
;
...
...
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