Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
Plugin-MeshRepair
Commits
3abbc5b4
Commit
3abbc5b4
authored
Oct 30, 2020
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ranges for Object Iteration to simplify code
parent
91b2031a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
MeshRepairPlugin.cc
MeshRepairPlugin.cc
+17
-17
No files found.
MeshRepairPlugin.cc
View file @
3abbc5b4
...
...
@@ -114,7 +114,7 @@ initializePlugin()
void
MeshRepairPlugin
::
slotRemoveSelectedVal3Vertices
()
{
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
)
)
)
removeSelectedVal3Vertices
(
o_it
->
id
());
emit
updateView
();
...
...
@@ -124,7 +124,7 @@ void MeshRepairPlugin::slotRemoveSelectedVal3Vertices() {
void
MeshRepairPlugin
::
slotRemoveSelectedEdges
(){
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
))
)
removeSelectedEdges
(
o_it
->
id
());
emit
updateView
();
...
...
@@ -134,7 +134,7 @@ void MeshRepairPlugin::slotRemoveSelectedEdges(){
void
MeshRepairPlugin
::
slotDetectSkinnyTriangleByAngle
()
{
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
detectSkinnyTriangleByAngle
(
o_it
->
id
(),
tool_
->
capAngleSpinbox
->
value
(),
false
);
emit
updateView
();
...
...
@@ -145,7 +145,7 @@ void MeshRepairPlugin::slotDetectSkinnyTriangleByAngle()
void
MeshRepairPlugin
::
slotRemoveSkinnyTriangleByAngle
()
{
//rewrite!!!
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
detectSkinnyTriangleByAngle
(
o_it
->
id
(),
tool_
->
capAngleSpinbox
->
value
(),
true
);
emit
updateView
();
...
...
@@ -155,7 +155,7 @@ void MeshRepairPlugin::slotRemoveSkinnyTriangleByAngle()
void
MeshRepairPlugin
::
slotDetectFoldover
()
{
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
detectFoldover
(
o_it
->
id
(),
tool_
->
detectFoldoverSpinbox
->
value
());
emit
updateView
();
...
...
@@ -165,7 +165,7 @@ void MeshRepairPlugin::slotDetectFoldover() {
void
MeshRepairPlugin
::
slotDetectTriangleAspect
()
{
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
detectTriangleAspect
(
o_it
->
id
(),
tool_
->
triangleAspectSpinbox
->
value
());
emit
updateView
();
...
...
@@ -175,7 +175,7 @@ void MeshRepairPlugin::slotDetectTriangleAspect() {
void
MeshRepairPlugin
::
slotFlipOrientation
(){
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
flipOrientation
(
o_it
->
id
());
emit
updateView
();
...
...
@@ -186,7 +186,7 @@ void MeshRepairPlugin::slotFlipOrientation(){
void
MeshRepairPlugin
::
slotFixMesh
()
{
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
)
)
)
fixMesh
(
o_it
->
id
()
,
tool_
->
fixMeshBox
->
value
()
);
emit
updateView
();
...
...
@@ -196,7 +196,7 @@ void MeshRepairPlugin::slotFixMesh() {
//-----------------------------------------------------------------------------
void
MeshRepairPlugin
::
slotUpdateVertexNormals
()
{
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
updateVertexNormals
(
o_it
->
id
());
emit
updateView
();
...
...
@@ -205,7 +205,7 @@ void MeshRepairPlugin::slotUpdateVertexNormals() {
//-----------------------------------------------------------------------------
void
MeshRepairPlugin
::
slotUpdateFaceNormals
()
{
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
updateFaceNormals
(
o_it
->
id
());
emit
updateView
();
...
...
@@ -214,7 +214,7 @@ void MeshRepairPlugin::slotUpdateFaceNormals() {
//-----------------------------------------------------------------------------
void
MeshRepairPlugin
::
slotUpdateHalfedgeNormals
()
{
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
updateHalfedgeNormals
(
o_it
->
id
());
emit
updateView
();
...
...
@@ -223,7 +223,7 @@ void MeshRepairPlugin::slotUpdateHalfedgeNormals() {
//-----------------------------------------------------------------------------
void
MeshRepairPlugin
::
slotUpdateNormals
(){
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
updateNormals
(
o_it
->
id
());
emit
updateView
();
...
...
@@ -234,7 +234,7 @@ void MeshRepairPlugin::slotUpdateNormals(){
void
MeshRepairPlugin
::
slotDetectEdgesShorter
(){
double
length
=
tool_
->
edgeSpin
->
value
();
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
selectEdgesShorterThan
(
o_it
->
id
(),
length
);
emit
updateView
();
...
...
@@ -245,7 +245,7 @@ void MeshRepairPlugin::slotDetectEdgesShorter(){
void
MeshRepairPlugin
::
slotDetectEdgesLonger
(){
double
length
=
tool_
->
edgeSpin
->
value
();
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
selectEdgesLongerThan
(
o_it
->
id
(),
length
);
emit
updateView
();
...
...
@@ -256,7 +256,7 @@ void MeshRepairPlugin::slotDetectEdgesLonger(){
void
MeshRepairPlugin
::
slotDetectFlatValence3Vertices
()
{
double
angle
=
tool_
->
valenceThreeSpinbox
->
value
();
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
detectFlatValence3Vertices
(
o_it
->
id
(),
angle
);
emit
updateView
();
...
...
@@ -267,7 +267,7 @@ void MeshRepairPlugin::slotDetectFlatValence3Vertices() {
void
MeshRepairPlugin
::
slotSnapBoundary
()
{
double
eps
=
tool_
->
snapBoundarySpinBox
->
value
();
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
snapBoundary
(
o_it
->
id
(),
eps
);
emit
updateView
();
}
...
...
@@ -276,7 +276,7 @@ void MeshRepairPlugin::slotSnapBoundary()
void
MeshRepairPlugin
::
slotFixNonManifoldVertices
()
{
for
(
PluginFunctions
::
O
bject
Iterator
o_it
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
)
);
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
for
(
auto
*
o_it
:
PluginFunctions
::
o
bject
s
(
PluginFunctions
::
TARGET_OBJECTS
,
DataType
(
DATA_TRIANGLE_MESH
|
DATA_POLY_MESH
))
)
fixNonManifoldVertices
(
o_it
->
id
());
emit
updateView
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment