Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
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
Feliks Kiszkurno
ogs-feliks
Commits
4e48a279
Commit
4e48a279
authored
1 year ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[GL] Extract GeoLib::markUsedPoints() for surfaces
parent
5e5dd1fc
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Applications/Utils/GeoTools/RemoveUnusedPoints.cpp
+1
-7
1 addition, 7 deletions
Applications/Utils/GeoTools/RemoveUnusedPoints.cpp
GeoLib/Surface.cpp
+19
-0
19 additions, 0 deletions
GeoLib/Surface.cpp
GeoLib/Surface.h
+1
-0
1 addition, 0 deletions
GeoLib/Surface.h
with
21 additions
and
7 deletions
Applications/Utils/GeoTools/RemoveUnusedPoints.cpp
+
1
−
7
View file @
4e48a279
...
@@ -92,13 +92,7 @@ int main(int argc, char* argv[])
...
@@ -92,13 +92,7 @@ int main(int argc, char* argv[])
{
{
for
(
auto
const
*
surface
:
*
surfaces
)
for
(
auto
const
*
surface
:
*
surfaces
)
{
{
for
(
std
::
size_t
i
=
0
;
i
<
surface
->
getNumberOfTriangles
();
++
i
)
GeoLib
::
markUsedPoints
(
*
surface
,
used_points
);
{
auto
const
*
triangle
=
(
*
surface
)[
i
];
used_points
[(
*
triangle
)[
0
]]
=
true
;
used_points
[(
*
triangle
)[
1
]]
=
true
;
used_points
[(
*
triangle
)[
2
]]
=
true
;
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
GeoLib/Surface.cpp
+
19
−
0
View file @
4e48a279
...
@@ -129,4 +129,23 @@ void resetPointIDs(Surface& surface, std::vector<std::size_t> const& mapping)
...
@@ -129,4 +129,23 @@ void resetPointIDs(Surface& surface, std::vector<std::size_t> const& mapping)
}
}
}
}
void
markUsedPoints
(
Surface
const
&
surface
,
std
::
vector
<
bool
>&
used_points
)
{
if
(
surface
.
getPointVec
()
->
size
()
!=
used_points
.
size
())
{
OGS_FATAL
(
"internal error in markUsedPoints(): surface based on point vector "
"of size {}, given used_points has size {}"
,
surface
.
getPointVec
()
->
size
(),
used_points
.
size
());
}
for
(
std
::
size_t
i
=
0
;
i
<
surface
.
getNumberOfTriangles
();
++
i
)
{
auto
const
&
triangle
=
*
surface
[
i
];
for
(
std
::
size_t
k
=
0
;
k
<
3
;
++
k
)
{
used_points
[
triangle
[
k
]]
=
true
;
}
}
}
}
// namespace GeoLib
}
// namespace GeoLib
This diff is collapsed.
Click to expand it.
GeoLib/Surface.h
+
1
−
0
View file @
4e48a279
...
@@ -97,4 +97,5 @@ bool operator==(Surface const& lhs, Surface const& rhs);
...
@@ -97,4 +97,5 @@ bool operator==(Surface const& lhs, Surface const& rhs);
/// Resets the point IDs of the surface corresponding to the mapping.
/// Resets the point IDs of the surface corresponding to the mapping.
void
resetPointIDs
(
Surface
&
surface
,
std
::
vector
<
std
::
size_t
>
const
&
mapping
);
void
resetPointIDs
(
Surface
&
surface
,
std
::
vector
<
std
::
size_t
>
const
&
mapping
);
void
markUsedPoints
(
Surface
const
&
surface
,
std
::
vector
<
bool
>&
used_points
);
}
// namespace GeoLib
}
// namespace GeoLib
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