Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
Plugin-FileOM
Commits
dc97b4db
Commit
dc97b4db
authored
Nov 09, 2022
by
Jan Möbius
Browse files
Merge branch 'Plugin-FileOM-updated' into 'master'
new iterators and circulators See merge request
!2
parents
6aec2b62
fb982024
Changes
1
Hide whitespace changes
Inline
Side-by-side
FileOM.cc
View file @
dc97b4db
...
...
@@ -135,11 +135,11 @@ int FileOMPlugin::loadObject(QString _filename) {
if
(
!
PluginFunctions
::
getObject
(
objectId
,
object
))
return
-
1
;
for
(
PolyMesh
::
FaceIter
f_it
=
object
->
mesh
()
->
faces_begin
();
f_it
!=
object
->
mesh
()
->
faces
_end
()
;
++
f_it
)
{
for
(
auto
f_it
:
object
->
mesh
()
->
faces
()
)
{
// Count number of vertices for the current face
uint
count
=
0
;
for
(
PolyMesh
::
FaceVertexIter
fv_it
(
*
(
object
->
mesh
()),
*
f_it
);
fv_it
.
is_valid
();
++
fv_it
)
for
(
auto
fv_it
:
f_it
.
vertices
()
)
++
count
;
// Check if it is a triangle. If not, this is really a poly mesh
...
...
@@ -167,11 +167,11 @@ int FileOMPlugin::loadObject(QString _filename) {
if
(
!
PluginFunctions
::
getObject
(
objectId
,
object
))
return
-
1
;
for
(
PolyMesh
::
FaceIter
f_it
=
object
->
mesh
()
->
faces_begin
();
f_it
!=
object
->
mesh
()
->
faces
_end
()
;
++
f_it
)
{
for
(
auto
f_it
:
object
->
mesh
()
->
faces
()
)
{
// Count number of vertices for the current face
uint
count
=
0
;
for
(
PolyMesh
::
FaceVertexIter
fv_it
(
*
(
object
->
mesh
()),
*
f_it
);
fv_it
.
is_valid
();
++
fv_it
)
for
(
auto
fv_it
:
f_it
.
vertices
()
)
++
count
;
// Check if it is a triangle. If not, this is really a poly mesh
...
...
@@ -447,8 +447,8 @@ void FileOMPlugin::backupTextureCoordinates(MeshT& _mesh) {
if
(
!
_mesh
.
get_property_handle
(
oldVertexCoords
,
"Original Per Vertex Texture Coords"
))
_mesh
.
add_property
(
oldVertexCoords
,
"Original Per Vertex Texture Coords"
);
for
(
typename
MeshT
::
VertexIter
v_it
=
_mesh
.
vertices_begin
();
v_it
!=
_mesh
.
vertices
_end
();
++
v_it
)
_mesh
.
property
(
oldVertexCoords
,
*
v_it
)
=
_mesh
.
texcoord2D
(
*
v_it
);
for
(
auto
v_it
:
_mesh
.
vertices
()
)
_mesh
.
property
(
oldVertexCoords
,
v_it
)
=
_mesh
.
texcoord2D
(
v_it
);
}
...
...
@@ -459,8 +459,8 @@ void FileOMPlugin::backupTextureCoordinates(MeshT& _mesh) {
if
(
!
_mesh
.
get_property_handle
(
oldHalfedgeCoords
,
"Original Per Face Texture Coords"
))
_mesh
.
add_property
(
oldHalfedgeCoords
,
"Original Per Face Texture Coords"
);
for
(
typename
MeshT
::
HalfedgeIter
he_it
=
_mesh
.
halfedges
_begin
();
he_it
!=
_mesh
.
halfedges_end
();
++
he_it
)
_mesh
.
property
(
oldHalfedgeCoords
,
*
he_it
)
=
_mesh
.
texcoord2D
(
*
he_it
);
for
(
auto
he_it
:
_mesh
.
halfedges
()
)
_mesh
.
property
(
oldHalfedgeCoords
,
he_it
)
=
_mesh
.
texcoord2D
(
he_it
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment