Commit b968d149 authored by Matthias Möller's avatar Matthias Möller
Browse files

OM3 iterators

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17214 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 53044630
...@@ -59,7 +59,7 @@ void SkinT<MeshT>::attachSkin() ...@@ -59,7 +59,7 @@ void SkinT<MeshT>::attachSkin()
// backup the default pose // backup the default pose
for(typename MeshT::VertexIter it = mesh_->vertices_begin(); it != mesh_->vertices_end(); ++it) for(typename MeshT::VertexIter it = mesh_->vertices_begin(); it != mesh_->vertices_end(); ++it)
mesh_->property(propDefaultPose, it) = DefaultPose(mesh_->point(it), mesh_->normal(it)); mesh_->property(propDefaultPose, *it) = DefaultPose(mesh_->point(*it), mesh_->normal(*it));
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -130,7 +130,7 @@ void SkinT<MeshT>::deformSkin(const AnimationHandle &_hAni, Method _method) ...@@ -130,7 +130,7 @@ void SkinT<MeshT>::deformSkin(const AnimationHandle &_hAni, Method _method)
typename MeshT::VertexIter it; typename MeshT::VertexIter it;
#ifdef USE_OPENMP #ifdef USE_OPENMP
std::vector< OpenMesh::VertexHandle > vhandles; vhandles.clear(); vhandles.reserve(mesh_->n_vertices()); std::vector< OpenMesh::VertexHandle > vhandles; vhandles.clear(); vhandles.reserve(mesh_->n_vertices());
for(it = mesh_->vertices_begin(); it != mesh_->vertices_end(); ++it){vhandles.push_back(it.handle());} for(it = mesh_->vertices_begin(); it != mesh_->vertices_end(); ++it){vhandles.push_back(*it);}
int vhcount = (int) vhandles.size(); int vhcount = (int) vhandles.size();
#pragma omp parallel for #pragma omp parallel for
for (int vhindex = 0; vhindex < vhcount; vhindex++) for (int vhindex = 0; vhindex < vhcount; vhindex++)
...@@ -223,8 +223,8 @@ void SkinT<MeshT>::releaseSkin() ...@@ -223,8 +223,8 @@ void SkinT<MeshT>::releaseSkin()
typename MeshT::VertexIter it; typename MeshT::VertexIter it;
for(it = mesh_->vertices_begin(); it != mesh_->vertices_end(); ++it) for(it = mesh_->vertices_begin(); it != mesh_->vertices_end(); ++it)
{ {
mesh_->set_point(it, mesh_->property(propDefaultPose, it).point); mesh_->set_point(*it, mesh_->property(propDefaultPose, *it).point);
mesh_->set_normal(it, mesh_->property(propDefaultPose, it).normal); mesh_->set_normal(*it, mesh_->property(propDefaultPose, *it).normal);
} }
mesh_->remove_property(propDefaultPose); mesh_->remove_property(propDefaultPose);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment