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
8b900239
Commit
8b900239
authored
5 years ago
by
Tom Fischer
Committed by
Tom Fischer
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[MeL/ME] Clang format DuplicateMeshComponents.
parent
916d9508
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
+11
-7
11 additions, 7 deletions
MeshLib/MeshEditing/DuplicateMeshComponents.cpp
MeshLib/MeshEditing/DuplicateMeshComponents.h
+33
-27
33 additions, 27 deletions
MeshLib/MeshEditing/DuplicateMeshComponents.h
with
44 additions
and
34 deletions
MeshLib/MeshEditing/DuplicateMeshComponents.cpp
+
11
−
7
View file @
8b900239
...
@@ -19,8 +19,8 @@
...
@@ -19,8 +19,8 @@
namespace
MeshLib
namespace
MeshLib
{
{
std
::
vector
<
MeshLib
::
Node
*>
copyNodeVector
(
std
::
vector
<
MeshLib
::
Node
*>
copyNodeVector
(
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
)
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
)
{
{
const
std
::
size_t
nNodes
(
nodes
.
size
());
const
std
::
size_t
nNodes
(
nodes
.
size
());
std
::
vector
<
MeshLib
::
Node
*>
new_nodes
;
std
::
vector
<
MeshLib
::
Node
*>
new_nodes
;
...
@@ -33,7 +33,9 @@ std::vector<MeshLib::Node*> copyNodeVector(const std::vector<MeshLib::Node*> &no
...
@@ -33,7 +33,9 @@ std::vector<MeshLib::Node*> copyNodeVector(const std::vector<MeshLib::Node*> &no
return
new_nodes
;
return
new_nodes
;
}
}
std
::
vector
<
MeshLib
::
Element
*>
copyElementVector
(
const
std
::
vector
<
MeshLib
::
Element
*>
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
)
std
::
vector
<
MeshLib
::
Element
*>
copyElementVector
(
const
std
::
vector
<
MeshLib
::
Element
*>&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
)
{
{
const
std
::
size_t
nElements
(
elements
.
size
());
const
std
::
size_t
nElements
(
elements
.
size
());
std
::
vector
<
MeshLib
::
Element
*>
new_elements
;
std
::
vector
<
MeshLib
::
Element
*>
new_elements
;
...
@@ -45,7 +47,8 @@ std::vector<MeshLib::Element*> copyElementVector(const std::vector<MeshLib::Elem
...
@@ -45,7 +47,8 @@ std::vector<MeshLib::Element*> copyElementVector(const std::vector<MeshLib::Elem
return
new_elements
;
return
new_elements
;
}
}
MeshLib
::
Element
*
copyElement
(
MeshLib
::
Element
const
*
const
element
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
)
MeshLib
::
Element
*
copyElement
(
MeshLib
::
Element
const
*
const
element
,
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
)
{
{
if
(
element
->
getGeomType
()
==
MeshElemType
::
LINE
)
if
(
element
->
getGeomType
()
==
MeshElemType
::
LINE
)
{
{
...
@@ -76,12 +79,13 @@ MeshLib::Element* copyElement(MeshLib::Element const*const element, const std::v
...
@@ -76,12 +79,13 @@ MeshLib::Element* copyElement(MeshLib::Element const*const element, const std::v
return
copyElement
<
MeshLib
::
Prism
>
(
element
,
nodes
);
return
copyElement
<
MeshLib
::
Prism
>
(
element
,
nodes
);
}
}
ERR
(
"Error: Unknown element type."
);
ERR
(
"Error: Unknown element type."
);
return
nullptr
;
return
nullptr
;
}
}
template
<
typename
E
>
template
<
typename
E
>
MeshLib
::
Element
*
copyElement
(
MeshLib
::
Element
const
*
const
element
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
)
MeshLib
::
Element
*
copyElement
(
MeshLib
::
Element
const
*
const
element
,
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
)
{
{
auto
**
new_nodes
=
new
MeshLib
::
Node
*
[
element
->
getNumberOfNodes
()];
auto
**
new_nodes
=
new
MeshLib
::
Node
*
[
element
->
getNumberOfNodes
()];
for
(
unsigned
i
=
0
;
i
<
element
->
getNumberOfNodes
();
++
i
)
for
(
unsigned
i
=
0
;
i
<
element
->
getNumberOfNodes
();
++
i
)
...
@@ -102,4 +106,4 @@ std::vector<MeshLib::Element*> cloneElements(
...
@@ -102,4 +106,4 @@ std::vector<MeshLib::Element*> cloneElements(
return
cloned_elements
;
return
cloned_elements
;
}
}
}
// namespace MeshLib
}
// namespace MeshLib
This diff is collapsed.
Click to expand it.
MeshLib/MeshEditing/DuplicateMeshComponents.h
+
33
−
27
View file @
8b900239
...
@@ -18,30 +18,36 @@
...
@@ -18,30 +18,36 @@
namespace
MeshLib
namespace
MeshLib
{
{
class
Mesh
;
class
Mesh
;
class
Node
;
class
Node
;
class
Element
;
class
Element
;
/// Creates a deep copy of a Node vector
/// Creates a deep copy of a Node vector
std
::
vector
<
MeshLib
::
Node
*>
copyNodeVector
(
std
::
vector
<
MeshLib
::
Node
*>
copyNodeVector
(
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
);
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
);
/** 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. This should be consistent with the original node vector.
* @param nodes The new node vector used for the duplicated element vector.
* @return A deep copy of the elements vector using the new nodes vector.
* This should be consistent with the original node vector.
*/
* @return A deep copy of the elements vector using the new nodes vector.
std
::
vector
<
MeshLib
::
Element
*>
copyElementVector
(
const
std
::
vector
<
MeshLib
::
Element
*>
&
elements
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
);
*/
std
::
vector
<
MeshLib
::
Element
*>
copyElementVector
(
/// Copies an element without change, using the nodes vector from the result mesh.
const
std
::
vector
<
MeshLib
::
Element
*>&
elements
,
MeshLib
::
Element
*
copyElement
(
MeshLib
::
Element
const
*
const
element
,
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
);
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
);
/// 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.
template
<
typename
E
>
MeshLib
::
Element
*
copyElement
(
MeshLib
::
Element
const
*
const
element
,
MeshLib
::
Element
*
copyElement
(
MeshLib
::
Element
const
*
const
element
,
const
std
::
vector
<
MeshLib
::
Node
*>
&
nodes
);
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
);
/// Clones a vector of elements using the Element::clone() function.
/// Copies an element without change, using the nodes vector from the result
std
::
vector
<
MeshLib
::
Element
*>
cloneElements
(
/// mesh.
std
::
vector
<
MeshLib
::
Element
*>
const
&
elements
);
template
<
typename
E
>
}
// end namespace MeshLib
MeshLib
::
Element
*
copyElement
(
MeshLib
::
Element
const
*
const
element
,
const
std
::
vector
<
MeshLib
::
Node
*>&
nodes
);
/// Clones a vector of elements using the Element::clone() function.
std
::
vector
<
MeshLib
::
Element
*>
cloneElements
(
std
::
vector
<
MeshLib
::
Element
*>
const
&
elements
);
}
// end 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