4 #include <OpenMesh/Core/Utils/Property.hh>
5 #include "int2roman.hh"
8 template <
typename Mesh>
12 static float a[9] = { 1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f };
14 for(
typename Mesh::VertexIter it=_m.vertices_begin();
15 it != _m.vertices_end(); ++it)
17 const float v = a[it->idx()%9];
18 if ( _check && !(_m.property( _ph, it ) == v) )
21 _m.property( _ph, it ) = v;
27 template <
typename Mesh>
31 for(
typename Mesh::EdgeIter it=_m.edges_begin();
32 it != _m.edges_end(); ++it)
34 const size_t n = it->idx();
35 const bool v = ((n&(n-1))==0);
37 if (_check && _m.property( _ph, it ) != v)
39 std::cout <<
" eprop_bool: " << n <<
" -> "
40 << _m.property(_ph, it ) <<
" != " << v << std::endl;
45 _m.property( _ph, it ) = v;
46 std::cout <<
" eprop_bool: " << n <<
" -> " << v << std::endl;
54 template <
typename Mesh>
58 for(
typename Mesh::FaceIter it=_m.faces_begin();
59 it != _m.faces_end(); ++it)
61 const int n = it->idx();
62 _m.property( _ph, it ) = int2roman(++n);
68 template <
typename Mesh,
typename T>
72 static float a[9] = { 1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f };
73 static float b[9] = { 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 1.1f };
74 static float c[9] = { 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 1.1f, 2.2f };
75 static float d[9] = { 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 1.1f, 2.2f, 3.3f };
79 for(
typename Mesh::HalfedgeIter it=_m.halfedges_begin();
80 it != _m.halfedges_end(); ++it)
82 const int n = it->idx();
87 v.vec4fval[0] = a[n%9];
88 v.vec4fval[1] = b[n%9];
89 v.vec4fval[2] = c[n%9];
90 v.vec4fval[3] = d[n%9];
92 if ( _check && _m.property( _ph, it ) != v )
95 _m.property( _ph, it ) = v;
100 template <
typename Mesh,
typename T>
104 for(
typename Mesh::FaceIter it=_m.faces_begin(); it != _m.faces_end(); ++it)
106 const size_t idx = it->idx();
107 if ( _check && _m.property( _ph )[int2roman(idx+1)] != idx )
110 _m.property( _ph )[int2roman(idx+1)] = idx;
Handle representing an edge property.
Definition: Property.hh:515
Handle representing a mesh property.
Definition: Property.hh:543
Handle representing a halfedge property.
Definition: Property.hh:501
Handle representing a face property.
Definition: Property.hh:529