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
OpenMesh
OpenMesh
Commits
6c6ce56c
Commit
6c6ce56c
authored
Apr 15, 2016
by
Isaak Lim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't emit an error message for every face that could not be added (due to complex elements)
parent
17217c40
Pipeline
#1282
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
src/OpenMesh/Core/IO/reader/PLYReader.cc
src/OpenMesh/Core/IO/reader/PLYReader.cc
+26
-0
No files found.
src/OpenMesh/Core/IO/reader/PLYReader.cc
View file @
6c6ce56c
...
...
@@ -304,6 +304,11 @@ bool _PLYReader_::read_ascii(std::istream& _in, BaseImporter& _bi, const Options
return
false
;
}
const
bool
err_enabled
=
omerr
().
is_enabled
();
size_t
complex_faces
=
0
;
if
(
err_enabled
)
omerr
().
disable
();
// read vertices:
for
(
i
=
0
;
i
<
vertexCount_
&&
!
_in
.
eof
();
++
i
)
{
vh
=
_bi
.
add_vertex
();
...
...
@@ -432,6 +437,8 @@ bool _PLYReader_::read_ascii(std::istream& _in, BaseImporter& _bi, const Options
}
fh
=
_bi
.
add_face
(
vhandles
);
if
(
!
fh
.
is_valid
())
++
complex_faces
;
break
;
case
CUSTOM_PROP
:
...
...
@@ -449,6 +456,12 @@ bool _PLYReader_::read_ascii(std::istream& _in, BaseImporter& _bi, const Options
}
if
(
err_enabled
)
{
omerr
().
enable
();
if
(
complex_faces
)
omerr
()
<<
complex_faces
<<
" invalid faces could not be added.
\n
"
;
}
// File was successfully parsed.
return
true
;
}
...
...
@@ -472,6 +485,11 @@ bool _PLYReader_::read_binary(std::istream& _in, BaseImporter& _bi, bool /*_swap
_bi
.
reserve
(
vertexCount_
,
3
*
vertexCount_
,
faceCount_
);
const
bool
err_enabled
=
omerr
().
is_enabled
();
size_t
complex_faces
=
0
;
if
(
err_enabled
)
omerr
().
disable
();
// read vertices:
for
(
unsigned
int
i
=
0
;
i
<
vertexCount_
&&
!
_in
.
eof
();
++
i
)
{
vh
=
_bi
.
add_vertex
();
...
...
@@ -610,6 +628,8 @@ bool _PLYReader_::read_binary(std::istream& _in, BaseImporter& _bi, bool /*_swap
}
fh
=
_bi
.
add_face
(
vhandles
);
if
(
!
fh
.
is_valid
())
++
complex_faces
;
break
;
case
CUSTOM_PROP
:
...
...
@@ -626,6 +646,12 @@ bool _PLYReader_::read_binary(std::istream& _in, BaseImporter& _bi, bool /*_swap
}
}
if
(
err_enabled
)
{
omerr
().
enable
();
if
(
complex_faces
)
omerr
()
<<
complex_faces
<<
" invalid faces could not be added.
\n
"
;
}
return
true
;
}
...
...
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