- updated the OpenMesh tutorials to be OM 3 compliant

- added all the tutorials except "Using IO::Options" as unittests

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@968 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Isaak Lim
2013-10-14 12:56:49 +00:00
parent f134e74a88
commit 185322a75b
10 changed files with 1056 additions and 34 deletions

View File

@@ -52,21 +52,20 @@ private:
: mesh_(_mesh), cog_(_cog)
{}
void operator()(typename Mesh::Vertex& _v)
void operator()(const typename Mesh::VertexHandle& _vh)
{
typename Mesh::VertexHandle vh( mesh_.handle(_v) );
typename Mesh::VertexVertexIter vv_it;
typename Mesh::Scalar valence(0.0);
mesh_.property(cog_, vh) = typename Mesh::Point(0.0, 0.0, 0.0);
mesh_.property(cog_, _vh) = typename Mesh::Point(0.0, 0.0, 0.0);
for (vv_it=mesh_.vv_iter(vh); vv_it; ++vv_it)
for (vv_it=mesh_.vv_iter(_vh); vv_it.is_valid(); ++vv_it)
{
mesh_.property(cog_, vh) += mesh_.point( vv_it );
mesh_.property(cog_, _vh) += mesh_.point( *vv_it );
++valence;
}
mesh_.property(cog_, mesh_.handle(_v) ) /= valence;
mesh_.property(cog_, _vh ) /= valence;
}
private:
@@ -82,12 +81,11 @@ private:
: mesh_(_mesh), cog_(_cog)
{}
void operator()(typename Mesh::Vertex& _v)
void operator()(const typename Mesh::VertexHandle& _vh)
{
typename Mesh::VertexHandle vh(mesh_.handle(_v));
if (!mesh_.is_boundary(vh))
mesh_.set_point( vh, mesh_.property(cog_, vh) );
if (!mesh_.is_boundary(_vh))
mesh_.set_point( _vh, mesh_.property(cog_, _vh) );
}
private: