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
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
Yuhao Liu
ogs
Commits
cbd16ba8
Commit
cbd16ba8
authored
5 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[MeL/ME] Add an opt. node map. to copyElementVector.
parent
5e586651
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/MeshEditing/DuplicateMeshComponents.cpp
+6
-6
6 additions, 6 deletions
MeshLib/MeshEditing/DuplicateMeshComponents.cpp
MeshLib/MeshEditing/DuplicateMeshComponents.h
+8
-5
8 additions, 5 deletions
MeshLib/MeshEditing/DuplicateMeshComponents.h
with
14 additions
and
11 deletions
MeshLib/MeshEditing/DuplicateMeshComponents.cpp
+
6
−
6
View file @
cbd16ba8
...
@@ -34,15 +34,15 @@ std::vector<MeshLib::Node*> copyNodeVector(
...
@@ -34,15 +34,15 @@ std::vector<MeshLib::Node*> copyNodeVector(
}
}
std
::
vector
<
MeshLib
::
Element
*>
copyElementVector
(
std
::
vector
<
MeshLib
::
Element
*>
copyElementVector
(
const
std
::
vector
<
MeshLib
::
Element
*>&
elements
,
std
::
vector
<
MeshLib
::
Element
*>
const
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
)
std
::
vector
<
MeshLib
::
Node
*>
const
&
new_nodes
,
std
::
vector
<
std
::
size_t
>
const
*
const
node_id_map
)
{
{
const
std
::
size_t
nElements
(
elements
.
size
());
std
::
vector
<
MeshLib
::
Element
*>
new_elements
;
std
::
vector
<
MeshLib
::
Element
*>
new_elements
;
new_elements
.
reserve
(
nE
lements
);
new_elements
.
reserve
(
e
lements
.
size
()
);
for
(
std
::
size_t
k
=
0
;
k
<
nE
lements
;
++
k
)
for
(
auto
element
:
e
lements
)
{
{
new_elements
.
push_back
(
copyElement
(
element
s
[
k
],
nodes
));
new_elements
.
push_back
(
copyElement
(
element
,
new_nodes
,
node_id_map
));
}
}
return
new_elements
;
return
new_elements
;
}
}
...
...
This diff is collapsed.
Click to expand it.
MeshLib/MeshEditing/DuplicateMeshComponents.h
+
8
−
5
View file @
cbd16ba8
...
@@ -28,16 +28,19 @@ std::vector<MeshLib::Node*> copyNodeVector(
...
@@ -28,16 +28,19 @@ std::vector<MeshLib::Node*> copyNodeVector(
/** Creates a deep copy of an element vector using the given Node vector.
/** Creates a deep copy of an element vector using the given Node vector.
* @param elements The element vector that should be duplicated.
* @param elements The element vector that should be duplicated.
* @param nodes The new node vector used for the duplicated element vector.
* @param new_nodes The new node vector used for the duplicated element vector.
* This should be consistent with the original node vector.
* @param node_id_map An optional mapping from the nodes the 'old' elements
* based on to the new nodes. This should be consistent with the original node
* vector.
* @return A deep copy of the elements vector using the new nodes vector.
* @return A deep copy of the elements vector using the new nodes vector.
*/
*/
std
::
vector
<
MeshLib
::
Element
*>
copyElementVector
(
std
::
vector
<
MeshLib
::
Element
*>
copyElementVector
(
const
std
::
vector
<
MeshLib
::
Element
*>&
elements
,
std
::
vector
<
MeshLib
::
Element
*>
const
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
);
std
::
vector
<
MeshLib
::
Node
*>
const
&
new_nodes
,
std
::
vector
<
std
::
size_t
>
const
*
const
node_id_map
=
nullptr
);
/// Copies an element without change, using the nodes vector from the result
/// Copies an element without change, using the nodes vector from the result
/// mesh.
/// mesh
and an optional mapping from the nodes the 'old' elements
.
MeshLib
::
Element
*
copyElement
(
MeshLib
::
Element
*
copyElement
(
MeshLib
::
Element
const
*
const
element
,
MeshLib
::
Element
const
*
const
element
,
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
,
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
,
...
...
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