Next change set for the new interface

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@902 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2013-08-07 10:26:50 +00:00
parent 29335262e4
commit 50dc9e8478
13 changed files with 109 additions and 109 deletions

View File

@@ -4,7 +4,7 @@ MyMesh mesh;
for (MyMesh::VertexIter v_it=mesh.vertices_sbegin(); v_it!=mesh.vertices_end(); ++v_it) for (MyMesh::VertexIter v_it=mesh.vertices_sbegin(); v_it!=mesh.vertices_end(); ++v_it)
{ {
// circulate around the current vertex // circulate around the current vertex
for (MyMesh::VertexVertexIter vv_it=mesh.vv_iter(v_it.handle()); vv_it; ++vv_it) for (MyMesh::VertexVertexIter vv_it=mesh.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
{ {
// do something with e.g. mesh.point(*vv_it) // do something with e.g. mesh.point(*vv_it)
} }

View File

@@ -2,17 +2,17 @@ MyMesh mesh;
// iterate over all vertices // iterate over all vertices
for (MyMesh::VertexIter v_it=mesh.vertices_begin(); v_it!=mesh.vertices_end(); ++v_it) for (MyMesh::VertexIter v_it=mesh.vertices_begin(); v_it!=mesh.vertices_end(); ++v_it)
...; // do something with *v_it, v_it->, or v_it.handle() ...; // do something with *v_it, v_it->, or *v_it
// iterate over all halfedges // iterate over all halfedges
for (MyMesh::HalfedgeIter h_it=mesh.halfedges_begin(); h_it!=mesh.halfedges_end(); ++h_it) for (MyMesh::HalfedgeIter h_it=mesh.halfedges_begin(); h_it!=mesh.halfedges_end(); ++h_it)
...; // do something with *h_it, h_it->, or h_it.handle() ...; // do something with *h_it, h_it->, or *h_it
// iterate over all edges // iterate over all edges
for (MyMesh::EdgeIter e_it=mesh.edges_begin(); e_it!=mesh.edges_end(); ++e_it) for (MyMesh::EdgeIter e_it=mesh.edges_begin(); e_it!=mesh.edges_end(); ++e_it)
...; // do something with *e_it, e_it->, or e_it.handle() ...; // do something with *e_it, e_it->, or *e_it
// iterator over all faces // iterator over all faces
for (MyMesh::FaceIter f_it=mesh.faces_begin(); f_it!=mesh.faces_end(); ++f_it) for (MyMesh::FaceIter f_it=mesh.faces_begin(); f_it!=mesh.faces_end(); ++f_it)
...; // do something with *f_it, f_it->, or f_it.handle() ...; // do something with *f_it, f_it->, or *f_it

View File

@@ -1,7 +1,7 @@
// Get the halfedge handle of i.e. the halfedge // Get the halfedge handle of i.e. the halfedge
// that is associated to the first vertex // that is associated to the first vertex
// of our set of vertices // of our set of vertices
PolyMesh::HalfedgeHandle heh = mesh.halfedge_handle(mesh.vertices_begin().handle()); PolyMesh::HalfedgeHandle heh = mesh.halfedge_handle(*(mesh.vertices_begin()));
// Now get the handle of its opposing halfedge // Now get the handle of its opposing halfedge
PolyMesh::HalfedgeHandle opposite_heh = mesh.opposite_halfedge_handle(heh); PolyMesh::HalfedgeHandle opposite_heh = mesh.opposite_halfedge_handle(heh);

View File

@@ -308,7 +308,7 @@ int main(int argc, char **argv)
if (mesh.data(f_it).state() < target1) { if (mesh.data(f_it).state() < target1) {
++i; ++i;
fh = f_it.handle(); fh = *f_it;
timer2.start(); timer2.start();
subdivider.refine(fh); subdivider.refine(fh);
timer2.stop(); timer2.stop();
@@ -318,7 +318,7 @@ int main(int argc, char **argv)
for (v_it = mesh.vertices_begin(); v_it != mesh.vertices_end(); ++v_it) { for (v_it = mesh.vertices_begin(); v_it != mesh.vertices_end(); ++v_it) {
if (mesh.data(v_it).state() < target2) { if (mesh.data(v_it).state() < target2) {
vh = v_it.handle(); vh = *v_it;
timer2.cont(); timer2.cont();
subdivider.refine(vh); subdivider.refine(vh);
timer2.stop(); timer2.stop();
@@ -350,7 +350,7 @@ int main(int argc, char **argv)
// calculate quality // calculate quality
quality = 0.0; quality = 0.0;
fh = mesh.faces_begin().handle(); fh = *(mesh.faces_begin());
// check every face // check every face
for (f_it = mesh.faces_begin(); f_it != mesh.faces_end(); ++f_it) { for (f_it = mesh.faces_begin(); f_it != mesh.faces_end(); ++f_it) {
@@ -358,7 +358,7 @@ int main(int argc, char **argv)
face_quality = 0.0; face_quality = 0.0;
valence = 0; valence = 0;
for (ff_it = mesh.ff_iter(f_it.handle()); ff_it; ++ff_it) { for (ff_it = mesh.ff_iter(*f_it); ff_it; ++ff_it) {
temp_quality = OpenMesh::dot( mesh.normal(f_it), temp_quality = OpenMesh::dot( mesh.normal(f_it),
mesh.normal(ff_it) ); mesh.normal(ff_it) );
@@ -383,9 +383,9 @@ int main(int argc, char **argv)
#define nheh next_halfedge_handle #define nheh next_halfedge_handle
#define tvh to_vertex_handle #define tvh to_vertex_handle
#define fvh from_vertex_handle #define fvh from_vertex_handle
p1 = mesh.point(mesh.tvh(mesh.heh(f_it.handle()))); p1 = mesh.point(mesh.tvh(mesh.heh(*f_it)));
p2 = mesh.point(mesh.fvh(mesh.heh(f_it.handle()))); p2 = mesh.point(mesh.fvh(mesh.heh(*f_it)));
p3 = mesh.point(mesh.tvh(mesh.nheh(mesh.heh(f_it.handle())))); p3 = mesh.point(mesh.tvh(mesh.nheh(mesh.heh(*f_it))));
#undef heh #undef heh
#undef nheh #undef nheh
#undef tvh #undef tvh
@@ -397,10 +397,10 @@ int main(int argc, char **argv)
face_quality *= pow(double(area), double(.1)); face_quality *= pow(double(area), double(.1));
//face_quality *= area; //face_quality *= area;
if (face_quality >= quality && !mesh.is_boundary(f_it.handle())) if (face_quality >= quality && !mesh.is_boundary(*f_it))
{ {
quality = face_quality; quality = face_quality;
fh = f_it.handle(); fh = *f_it;
} }
} }

View File

@@ -508,7 +508,7 @@ save_vd_prog_mesh(const std::string &_filename)
for (f_it=mesh_.faces_begin(); f_it!=mesh_.faces_end(); ++f_it) { for (f_it=mesh_.faces_begin(); f_it!=mesh_.faces_end(); ++f_it) {
hh = mesh_.halfedge_handle(f_it.handle()); hh = mesh_.halfedge_handle(*f_it);
vh = mesh_.to_vertex_handle(hh); vh = mesh_.to_vertex_handle(hh);
fvi[0] = handle2index_map[vh]; fvi[0] = handle2index_map[vh];
@@ -660,16 +660,16 @@ vdpm_analysis()
// initialize // initialize
for (h_it=mesh_.halfedges_begin(); h_it!=mesh_.halfedges_end(); ++h_it) for (h_it=mesh_.halfedges_begin(); h_it!=mesh_.halfedges_end(); ++h_it)
{ {
vh = mesh_.to_vertex_handle(h_it.handle()); vh = mesh_.to_vertex_handle(*h_it);
mesh_.data(h_it).set_vhierarchy_leaf_node_handle(mesh_.data(vh).vhierarchy_node_handle()); mesh_.data(h_it).set_vhierarchy_leaf_node_handle(mesh_.data(vh).vhierarchy_node_handle());
} }
for (v_it=mesh_.vertices_begin(); v_it!=mesh_.vertices_end(); ++v_it) for (v_it=mesh_.vertices_begin(); v_it!=mesh_.vertices_end(); ++v_it)
{ {
VHierarchyNodeHandle VHierarchyNodeHandle
node_handle = mesh_.data(v_it.handle()).vhierarchy_node_handle(); node_handle = mesh_.data(*v_it).vhierarchy_node_handle();
vhierarchy_.node(node_handle).set_normal(mesh_.normal(v_it.handle())); vhierarchy_.node(node_handle).set_normal(mesh_.normal(*v_it));
} }
std::cout << "Start view-dependent PM analysis" << std::endl; std::cout << "Start view-dependent PM analysis" << std::endl;
@@ -859,7 +859,7 @@ compute_screen_space_error(VHierarchyNodeHandle node_handle, VHierarchyNodeHandl
for (vf_it=mesh_.vf_iter(vh); vf_it; ++vf_it) for (vf_it=mesh_.vf_iter(vh); vf_it; ++vf_it)
{ {
heh = mesh_.halfedge_handle(vf_it.handle()); heh = mesh_.halfedge_handle(*vf_it);
tri[0] = mesh_.point(mesh_.to_vertex_handle(heh)); tri[0] = mesh_.point(mesh_.to_vertex_handle(heh));
heh = mesh_.next_halfedge_handle(heh); heh = mesh_.next_halfedge_handle(heh);
tri[1] = mesh_.point(mesh_.to_vertex_handle(heh)); tri[1] = mesh_.point(mesh_.to_vertex_handle(heh));

View File

@@ -275,7 +275,7 @@ int main(int argc, char *argv[] )
timer.start(); timer.start();
MyMesh::VertexIter vit = mesh.vertices_begin(); MyMesh::VertexIter vit = mesh.vertices_begin();
for (; vit != mesh.vertices_end(); ++vit) for (; vit != mesh.vertices_end(); ++vit)
mesh.set_normal( vit.handle(), -mesh.normal( vit.handle() ) ); mesh.set_normal( *vit, -mesh.normal( *vit ) );
timer.stop(); timer.stop();
std::cout << " " << mesh.n_vertices() std::cout << " " << mesh.n_vertices()
<< " vertex normals in " << timer.as_string() << std::endl; << " vertex normals in " << timer.as_string() << std::endl;

View File

@@ -210,7 +210,7 @@ public:
_vhandles.clear(); _vhandles.clear();
for (typename Mesh::CFVIter fv_it=mesh_.cfv_iter(_fh); fv_it.is_valid(); ++fv_it) for (typename Mesh::CFVIter fv_it=mesh_.cfv_iter(_fh); fv_it.is_valid(); ++fv_it)
{ {
_vhandles.push_back(fv_it.handle()); _vhandles.push_back(*fv_it);
++count; ++count;
} }
return count; return count;

View File

@@ -205,7 +205,7 @@ update_face_normals()
FaceIter f_it(Kernel::faces_begin()), f_end(Kernel::faces_end()); FaceIter f_it(Kernel::faces_begin()), f_end(Kernel::faces_end());
for (; f_it != f_end; ++f_it) for (; f_it != f_end; ++f_it)
this->set_normal(f_it.handle(), calc_face_normal(f_it.handle())); this->set_normal(*f_it, calc_face_normal(f_it.handle()));
} }
@@ -220,7 +220,7 @@ update_halfedge_normals(const double _feature_angle)
HalfedgeIter h_it(Kernel::halfedges_begin()), h_end(Kernel::halfedges_end()); HalfedgeIter h_it(Kernel::halfedges_begin()), h_end(Kernel::halfedges_end());
for (; h_it != h_end; ++h_it) for (; h_it != h_end; ++h_it)
this->set_normal(h_it.handle(), calc_halfedge_normal(h_it.handle(), _feature_angle)); this->set_normal(*h_it, calc_halfedge_normal(*h_it, _feature_angle));
} }
@@ -332,7 +332,7 @@ calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const
{ {
_n.vectorize(0.0); _n.vectorize(0.0);
for (ConstVertexFaceIter vf_it=this->cvf_iter(_vh); vf_it; ++vf_it) for (ConstVertexFaceIter vf_it=this->cvf_iter(_vh); vf_it; ++vf_it)
_n += this->normal(vf_it.handle()); _n += this->normal(*vf_it);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -394,7 +394,7 @@ update_vertex_normals()
VertexIter v_it(Kernel::vertices_begin()), v_end(Kernel::vertices_end()); VertexIter v_it(Kernel::vertices_begin()), v_end(Kernel::vertices_end());
for (; v_it!=v_end; ++v_it) for (; v_it!=v_end; ++v_it)
this->set_normal(v_it.handle(), calc_vertex_normal(v_it.handle())); this->set_normal(*v_it, calc_vertex_normal(*v_it));
} }
//============================================================================= //=============================================================================

View File

@@ -100,7 +100,7 @@ int main(int argc, char **argv)
{ {
cog[0] = cog[1] = cog[2] = valence = 0.0; cog[0] = cog[1] = cog[2] = valence = 0.0;
for (vv_it=mesh.vv_iter(v_it.handle()); vv_it; ++vv_it) for (vv_it=mesh.vv_iter(v_it); vv_it.is_valid(); ++vv_it)
{ {
cog += mesh.point( *vv_it ); cog += mesh.point( *vv_it );
++valence; ++valence;
@@ -110,8 +110,8 @@ int main(int argc, char **argv)
} }
for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
if (!mesh.is_boundary(v_it.handle())) if (!mesh.is_boundary(*v_it))
mesh.set_point( v_it.handle(), mesh.data(v_it).cog()); mesh.set_point( *v_it, mesh.data(v_it).cog());
} }

View File

@@ -224,11 +224,11 @@ protected:
if (_m.is_boundary(fit)) if (_m.is_boundary(fit))
{ {
if(gen%2) if(gen%2)
_m.property(fp_pos_, fit.handle()).invalidate(); _m.property(fp_pos_, *fit).invalidate();
else else
{ {
//find the interior boundary halfedge //find the interior boundary halfedge
for( heh = _m.halfedge_handle(fit.handle()); !_m.is_boundary( _m.opposite_halfedge_handle(heh) ); heh = _m.next_halfedge_handle(heh) ) for( heh = _m.halfedge_handle(*fit); !_m.is_boundary( _m.opposite_halfedge_handle(heh) ); heh = _m.next_halfedge_handle(heh) )
; ;
assert(_m.is_boundary( _m.opposite_halfedge_handle(heh) )); assert(_m.is_boundary( _m.opposite_halfedge_handle(heh) ));
pos = zero; pos = zero;
@@ -303,7 +303,7 @@ protected:
} }
} }
vh = _m.add_vertex( pos ); vh = _m.add_vertex( pos );
_m.property(fp_pos_, fit.handle()) = vh; _m.property(fp_pos_, *fit) = vh;
} }
} }
else else
@@ -312,16 +312,16 @@ protected:
int nOrdinary = 0; int nOrdinary = 0;
//check number of extraordinary vertices //check number of extraordinary vertices
for(fvit = _m.fv_iter( fit ); fvit; ++fvit) for(fvit = _m.fv_iter( fit ); fvit.is_valid(); ++fvit)
if( (_m.valence(fvit.handle())) == 6 || _m.is_boundary(fvit.handle()) ) if( (_m.valence(*fvit)) == 6 || _m.is_boundary(*fvit) )
++nOrdinary; ++nOrdinary;
if(nOrdinary==3) if(nOrdinary==3)
{ {
for(fheit = _m.fh_iter( fit ); fheit; ++fheit) for(fheit = _m.fh_iter( fit ); fheit.is_valid(); ++fheit)
{ {
//one ring vertex has weight 32/81 //one ring vertex has weight 32/81
heh = fheit.handle(); heh = *fheit;
assert(_m.to_vertex_handle(heh).is_valid()); assert(_m.to_vertex_handle(heh).is_valid());
pos += real_t(32.0/81) * _m.point(_m.to_vertex_handle(heh)); pos += real_t(32.0/81) * _m.point(_m.to_vertex_handle(heh));
//tip vertex has weight -1/81 //tip vertex has weight -1/81
@@ -346,14 +346,14 @@ protected:
else else
{ {
//only use irregular vertices: //only use irregular vertices:
for(fheit = _m.fh_iter( fit ); fheit; ++fheit) for(fheit = _m.fh_iter( fit ); fheit.is_valid(); ++fheit)
{ {
vh = _m.to_vertex_handle(fheit); vh = _m.to_vertex_handle(fheit);
if( (_m.valence(vh) != 6) && (!_m.is_boundary(vh)) ) if( (_m.valence(vh) != 6) && (!_m.is_boundary(vh)) )
{ {
unsigned int K = _m.valence(vh); unsigned int K = _m.valence(vh);
pos += weights_[K][K]*_m.point(vh); pos += weights_[K][K]*_m.point(vh);
heh = _m.opposite_halfedge_handle( fheit.handle() ); heh = _m.opposite_halfedge_handle( *fheit );
for(unsigned int i = 0; i<K; ++i, heh = _m.opposite_halfedge_handle(_m.prev_halfedge_handle(heh)) ) for(unsigned int i = 0; i<K; ++i, heh = _m.opposite_halfedge_handle(_m.prev_halfedge_handle(heh)) )
{ {
pos += weights_[K][i]*_m.point(_m.to_vertex_handle(heh)); pos += weights_[K][i]*_m.point(_m.to_vertex_handle(heh));
@@ -364,7 +364,7 @@ protected:
} }
vh = _m.add_vertex( pos ); vh = _m.add_vertex( pos );
_m.property(fp_pos_, fit.handle()) = vh; _m.property(fp_pos_, *fit) = vh;
} }
} }
@@ -377,8 +377,8 @@ protected:
} }
else else
{ {
assert(_m.property(fp_pos_, fit.handle()).is_valid()); assert(_m.property(fp_pos_, *fit).is_valid());
_m.split( fit, _m.property(fp_pos_, fit.handle()) ); _m.split( fit, _m.property(fp_pos_, *fit) );
} }
} }

View File

@@ -84,7 +84,7 @@ check(unsigned int _targets, std::ostream& _os)
{ {
if (!is_deleted(v_it)) if (!is_deleted(v_it))
{ {
vh = v_it.handle(); vh = *v_it;
/* The outgoing halfedge of a boundary vertex has to be a /* The outgoing halfedge of a boundary vertex has to be a
@@ -95,7 +95,7 @@ check(unsigned int _targets, std::ostream& _os)
for (typename Mesh::ConstVertexOHalfedgeIter vh_it(mesh_, vh); for (typename Mesh::ConstVertexOHalfedgeIter vh_it(mesh_, vh);
vh_it; ++vh_it) vh_it; ++vh_it)
{ {
if (mesh_.is_boundary(vh_it.handle())) if (mesh_.is_boundary(*vh_it))
{ {
_os << "MeshChecker: vertex " << vh _os << "MeshChecker: vertex " << vh
<< ": outgoing halfedge not on boundary error\n"; << ": outgoing halfedge not on boundary error\n";
@@ -150,9 +150,9 @@ check(unsigned int _targets, std::ostream& _os)
for (; h_it != h_end; ++h_it) for (; h_it != h_end; ++h_it)
{ {
if (!is_deleted(mesh_.edge_handle(h_it.handle()))) if (!is_deleted(mesh_.edge_handle(*h_it)))
{ {
hh = h_it.handle(); hh = *h_it;
// degenerated halfedge ? // degenerated halfedge ?
@@ -206,11 +206,11 @@ check(unsigned int _targets, std::ostream& _os)
{ {
if (!is_deleted(f_it)) if (!is_deleted(f_it))
{ {
fh = f_it.handle(); fh = *f_it;
for (fh_it=mesh_.cfh_iter(fh); fh_it; ++fh_it) for (fh_it=mesh_.cfh_iter(fh); fh_it; ++fh_it)
{ {
if (mesh_.face_handle(fh_it.handle()) != fh) if (mesh_.face_handle(*fh_it) != fh)
{ {
_os << "MeshChecker: face " << fh _os << "MeshChecker: face " << fh
<< ": its halfedge does not reference face\n"; << ": its halfedge does not reference face\n";

View File

@@ -142,7 +142,7 @@ build_strips()
// collect starting halfedges // collect starting halfedges
h[0] = mesh_.halfedge_handle(f_it.handle()); h[0] = mesh_.halfedge_handle(*f_it);
h[1] = mesh_.next_halfedge_handle(h[0]); h[1] = mesh_.next_halfedge_handle(h[0]);
h[2] = mesh_.next_halfedge_handle(h[1]); h[2] = mesh_.next_halfedge_handle(h[1]);

View File

@@ -84,22 +84,22 @@ TEST_F(OpenMeshProperties, VertexPropertyCheckDouble) {
double index = 0.0; double index = 0.0;
for ( Mesh::VertexIter v_it = mesh_.vertices_begin() ; v_it != mesh_.vertices_end(); ++v_it ) { for ( Mesh::VertexIter v_it = mesh_.vertices_begin() ; v_it != mesh_.vertices_end(); ++v_it ) {
mesh_.property(doubleHandle,v_it) = index; mesh_.property(doubleHandle,*v_it) = index;
index += 1.0; index += 1.0;
} }
// Check if it is ok. // Check if it is ok.
Mesh::VertexIter v_it = mesh_.vertices_begin(); Mesh::VertexIter v_it = mesh_.vertices_begin();
EXPECT_EQ( mesh_.property(doubleHandle,v_it) , 0.0 ) << "Invalid double value for vertex 0"; EXPECT_EQ( mesh_.property(doubleHandle,*v_it) , 0.0 ) << "Invalid double value for vertex 0";
++v_it; ++v_it;
EXPECT_EQ( mesh_.property(doubleHandle,v_it) , 1.0 ) << "Invalid double value for vertex 1"; EXPECT_EQ( mesh_.property(doubleHandle,*v_it) , 1.0 ) << "Invalid double value for vertex 1";
++v_it; ++v_it;
EXPECT_EQ( mesh_.property(doubleHandle,v_it) , 2.0 ) << "Invalid double value for vertex 2"; EXPECT_EQ( mesh_.property(doubleHandle,*v_it) , 2.0 ) << "Invalid double value for vertex 2";
++v_it; ++v_it;
EXPECT_EQ( mesh_.property(doubleHandle,v_it) , 3.0 ) << "Invalid double value for vertex 3"; EXPECT_EQ( mesh_.property(doubleHandle,*v_it) , 3.0 ) << "Invalid double value for vertex 3";
// Try to get the stl iterators: // Try to get the stl iterators:
std::vector<double>::iterator it=mesh_.property(doubleHandle).data_vector().begin(); std::vector<double>::iterator it=mesh_.property(doubleHandle).data_vector().begin();
@@ -174,22 +174,22 @@ TEST_F(OpenMeshProperties, VertexPropertyCheckBool) {
bool current = true; bool current = true;
for ( Mesh::VertexIter v_it = mesh_.vertices_begin() ; v_it != mesh_.vertices_end(); ++v_it ) { for ( Mesh::VertexIter v_it = mesh_.vertices_begin() ; v_it != mesh_.vertices_end(); ++v_it ) {
mesh_.property(boolHandle,v_it) = current; mesh_.property(boolHandle,*v_it) = current;
current = !current; current = !current;
} }
// Check if it is ok. // Check if it is ok.
Mesh::VertexIter v_it = mesh_.vertices_begin(); Mesh::VertexIter v_it = mesh_.vertices_begin();
EXPECT_TRUE( mesh_.property(boolHandle,v_it) ) << "Invalid bool value for vertex 0"; EXPECT_TRUE( mesh_.property(boolHandle,*v_it) ) << "Invalid bool value for vertex 0";
++v_it; ++v_it;
EXPECT_FALSE( mesh_.property(boolHandle,v_it) ) << "Invalid bool value for vertex 1"; EXPECT_FALSE( mesh_.property(boolHandle,*v_it) ) << "Invalid bool value for vertex 1";
++v_it; ++v_it;
EXPECT_TRUE( mesh_.property(boolHandle,v_it) ) << "Invalid bool value for vertex 2"; EXPECT_TRUE( mesh_.property(boolHandle,*v_it) ) << "Invalid bool value for vertex 2";
++v_it; ++v_it;
EXPECT_FALSE( mesh_.property(boolHandle,v_it) ) << "Invalid bool value for vertex 3"; EXPECT_FALSE( mesh_.property(boolHandle,*v_it) ) << "Invalid bool value for vertex 3";
// Try to get the stl iterators: // Try to get the stl iterators:
std::vector<bool>::iterator it=mesh_.property(boolHandle).data_vector().begin(); std::vector<bool>::iterator it=mesh_.property(boolHandle).data_vector().begin();
@@ -262,43 +262,43 @@ TEST_F(OpenMeshProperties, VertexPropertyCopypropertiesInt) {
// Fill property // Fill property
for ( Mesh::VertexIter v_it = mesh_.vertices_begin() ; v_it != mesh_.vertices_end(); ++v_it ) { for ( Mesh::VertexIter v_it = mesh_.vertices_begin() ; v_it != mesh_.vertices_end(); ++v_it ) {
mesh_.property(intHandle,v_it) = v_it->idx(); mesh_.property(intHandle,*v_it) = v_it->idx();
} }
// Check if property it is ok. // Check if property it is ok.
Mesh::VertexIter v_it = mesh_.vertices_begin(); Mesh::VertexIter v_it = mesh_.vertices_begin();
EXPECT_EQ( 0, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 0"; EXPECT_EQ( 0, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 0";
++v_it; ++v_it;
EXPECT_EQ( 1, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 1"; EXPECT_EQ( 1, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 1";
++v_it; ++v_it;
EXPECT_EQ( 2, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 2"; EXPECT_EQ( 2, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 2";
++v_it; ++v_it;
EXPECT_EQ( 3, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 3"; EXPECT_EQ( 3, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 3";
// Check vertex positions // Check vertex positions
v_it = mesh_.vertices_begin(); v_it = mesh_.vertices_begin();
EXPECT_EQ( 0, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 0"; EXPECT_EQ( 0, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 0";
EXPECT_EQ( 0, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 0"; EXPECT_EQ( 0, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 0";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 0"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 0";
++v_it; ++v_it;
EXPECT_EQ( 0, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 1"; EXPECT_EQ( 0, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 1";
EXPECT_EQ( 1, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 1"; EXPECT_EQ( 1, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 1";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 1"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 1";
++v_it; ++v_it;
EXPECT_EQ( 1, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 2"; EXPECT_EQ( 1, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 2";
EXPECT_EQ( 1, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 2"; EXPECT_EQ( 1, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 2";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 2"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 2";
++v_it; ++v_it;
EXPECT_EQ( 1, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 3"; EXPECT_EQ( 1, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 3";
EXPECT_EQ( 0, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 3"; EXPECT_EQ( 0, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 3";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 3"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 3";
++v_it; ++v_it;
//=========================================================== //===========================================================
@@ -309,31 +309,31 @@ TEST_F(OpenMeshProperties, VertexPropertyCopypropertiesInt) {
// Check vertex positions // Check vertex positions
v_it = mesh_.vertices_begin(); v_it = mesh_.vertices_begin();
EXPECT_EQ( 0, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 0 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 0 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 0 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 0 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 0 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 0 after copy";
++v_it; ++v_it;
EXPECT_EQ( 0, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 1 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 1 after copy";
EXPECT_EQ( 1, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 1 after copy"; EXPECT_EQ( 1, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 1 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 1 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 1 after copy";
++v_it; ++v_it;
EXPECT_EQ( 1, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 2 after copy"; EXPECT_EQ( 1, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 2 after copy";
EXPECT_EQ( 1, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 2 after copy"; EXPECT_EQ( 1, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 2 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 2 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 2 after copy";
++v_it; ++v_it;
EXPECT_EQ( 1, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 3 after copy"; EXPECT_EQ( 1, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 3 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 3 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 3 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 3 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 3 after copy";
++v_it; ++v_it;
v_it = mesh_.vertices_begin(); v_it = mesh_.vertices_begin();
EXPECT_EQ( 1, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 0 after copy"; ++v_it; EXPECT_EQ( 1, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 0 after copy"; ++v_it;
EXPECT_EQ( 1, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 1 after copy"; ++v_it; EXPECT_EQ( 1, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 1 after copy"; ++v_it;
EXPECT_EQ( 2, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 2 after copy"; ++v_it; EXPECT_EQ( 2, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 2 after copy"; ++v_it;
EXPECT_EQ( 3, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 3 after copy"; EXPECT_EQ( 3, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 3 after copy";
//=========================================================== //===========================================================
// Copy from vertex 2 to 3, including build in properties // Copy from vertex 2 to 3, including build in properties
@@ -343,31 +343,31 @@ TEST_F(OpenMeshProperties, VertexPropertyCopypropertiesInt) {
// Check vertex positions // Check vertex positions
v_it = mesh_.vertices_begin(); v_it = mesh_.vertices_begin();
EXPECT_EQ( 0, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 0 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 0 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 0 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 0 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 0 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 0 after copy";
++v_it; ++v_it;
EXPECT_EQ( 0, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 1 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 1 after copy";
EXPECT_EQ( 1, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 1 after copy"; EXPECT_EQ( 1, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 1 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 1 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 1 after copy";
++v_it; ++v_it;
EXPECT_EQ( 1, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 2 after copy"; EXPECT_EQ( 1, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 2 after copy";
EXPECT_EQ( 1, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 2 after copy"; EXPECT_EQ( 1, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 2 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 2 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 2 after copy";
++v_it; ++v_it;
EXPECT_EQ( 1, mesh_.point(v_it)[0] ) << "Invalid x position for vertex 3 after copy"; EXPECT_EQ( 1, mesh_.point(*v_it)[0] ) << "Invalid x position for vertex 3 after copy";
EXPECT_EQ( 1, mesh_.point(v_it)[1] ) << "Invalid y position for vertex 3 after copy"; EXPECT_EQ( 1, mesh_.point(*v_it)[1] ) << "Invalid y position for vertex 3 after copy";
EXPECT_EQ( 0, mesh_.point(v_it)[2] ) << "Invalid z position for vertex 3 after copy"; EXPECT_EQ( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 3 after copy";
++v_it; ++v_it;
v_it = mesh_.vertices_begin(); v_it = mesh_.vertices_begin();
EXPECT_EQ( 1, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 0 after copy"; ++v_it; EXPECT_EQ( 1, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 0 after copy"; ++v_it;
EXPECT_EQ( 1, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 1 after copy"; ++v_it; EXPECT_EQ( 1, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 1 after copy"; ++v_it;
EXPECT_EQ( 2, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 2 after copy"; ++v_it; EXPECT_EQ( 2, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 2 after copy"; ++v_it;
EXPECT_EQ( 2, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 3 after copy"; EXPECT_EQ( 2, mesh_.property(intHandle,*v_it) ) << "Invalid int value for vertex 3 after copy";
} }
@@ -412,8 +412,8 @@ TEST_F(OpenMeshProperties, CheckStatusPropertiesHalfedgeEdgeAllDeleted) {
for( Mesh::ConstHalfedgeIter he_it = mesh_.halfedges_begin(); he_it != mesh_.halfedges_end(); ++he_it) for( Mesh::ConstHalfedgeIter he_it = mesh_.halfedges_begin(); he_it != mesh_.halfedges_end(); ++he_it)
{ {
EXPECT_TRUE( mesh_.status(mesh_.edge_handle(he_it.handle())).deleted() ) << "Edge not deleted"; EXPECT_TRUE( mesh_.status(mesh_.edge_handle(*he_it)).deleted() ) << "Edge not deleted";
EXPECT_TRUE( mesh_.status(he_it.handle()).deleted() ) << "Halfedge not deleted"; EXPECT_TRUE( mesh_.status(*he_it).deleted() ) << "Halfedge not deleted";
} }
} }