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:
@@ -308,7 +308,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (mesh.data(f_it).state() < target1) {
|
||||
++i;
|
||||
fh = f_it.handle();
|
||||
fh = *f_it;
|
||||
timer2.start();
|
||||
subdivider.refine(fh);
|
||||
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) {
|
||||
|
||||
if (mesh.data(v_it).state() < target2) {
|
||||
vh = v_it.handle();
|
||||
vh = *v_it;
|
||||
timer2.cont();
|
||||
subdivider.refine(vh);
|
||||
timer2.stop();
|
||||
@@ -350,7 +350,7 @@ int main(int argc, char **argv)
|
||||
// calculate quality
|
||||
quality = 0.0;
|
||||
|
||||
fh = mesh.faces_begin().handle();
|
||||
fh = *(mesh.faces_begin());
|
||||
|
||||
// check every face
|
||||
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;
|
||||
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),
|
||||
mesh.normal(ff_it) );
|
||||
@@ -383,9 +383,9 @@ int main(int argc, char **argv)
|
||||
#define nheh next_halfedge_handle
|
||||
#define tvh to_vertex_handle
|
||||
#define fvh from_vertex_handle
|
||||
p1 = mesh.point(mesh.tvh(mesh.heh(f_it.handle())));
|
||||
p2 = mesh.point(mesh.fvh(mesh.heh(f_it.handle())));
|
||||
p3 = mesh.point(mesh.tvh(mesh.nheh(mesh.heh(f_it.handle()))));
|
||||
p1 = mesh.point(mesh.tvh(mesh.heh(*f_it)));
|
||||
p2 = mesh.point(mesh.fvh(mesh.heh(*f_it)));
|
||||
p3 = mesh.point(mesh.tvh(mesh.nheh(mesh.heh(*f_it))));
|
||||
#undef heh
|
||||
#undef nheh
|
||||
#undef tvh
|
||||
@@ -397,10 +397,10 @@ int main(int argc, char **argv)
|
||||
face_quality *= pow(double(area), double(.1));
|
||||
//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;
|
||||
fh = f_it.handle();
|
||||
fh = *f_it;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
hh = mesh_.halfedge_handle(f_it.handle());
|
||||
hh = mesh_.halfedge_handle(*f_it);
|
||||
vh = mesh_.to_vertex_handle(hh);
|
||||
fvi[0] = handle2index_map[vh];
|
||||
|
||||
@@ -660,16 +660,16 @@ vdpm_analysis()
|
||||
// initialize
|
||||
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());
|
||||
}
|
||||
|
||||
for (v_it=mesh_.vertices_begin(); v_it!=mesh_.vertices_end(); ++v_it)
|
||||
{
|
||||
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;
|
||||
@@ -859,7 +859,7 @@ compute_screen_space_error(VHierarchyNodeHandle node_handle, VHierarchyNodeHandl
|
||||
|
||||
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));
|
||||
heh = mesh_.next_halfedge_handle(heh);
|
||||
tri[1] = mesh_.point(mesh_.to_vertex_handle(heh));
|
||||
|
||||
@@ -275,7 +275,7 @@ int main(int argc, char *argv[] )
|
||||
timer.start();
|
||||
MyMesh::VertexIter vit = mesh.vertices_begin();
|
||||
for (; vit != mesh.vertices_end(); ++vit)
|
||||
mesh.set_normal( vit.handle(), -mesh.normal( vit.handle() ) );
|
||||
mesh.set_normal( *vit, -mesh.normal( *vit ) );
|
||||
timer.stop();
|
||||
std::cout << " " << mesh.n_vertices()
|
||||
<< " vertex normals in " << timer.as_string() << std::endl;
|
||||
|
||||
@@ -210,7 +210,7 @@ public:
|
||||
_vhandles.clear();
|
||||
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;
|
||||
}
|
||||
return count;
|
||||
|
||||
@@ -205,7 +205,7 @@ update_face_normals()
|
||||
FaceIter f_it(Kernel::faces_begin()), f_end(Kernel::faces_end());
|
||||
|
||||
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());
|
||||
|
||||
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);
|
||||
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());
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
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 );
|
||||
++valence;
|
||||
@@ -110,8 +110,8 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
|
||||
if (!mesh.is_boundary(v_it.handle()))
|
||||
mesh.set_point( v_it.handle(), mesh.data(v_it).cog());
|
||||
if (!mesh.is_boundary(*v_it))
|
||||
mesh.set_point( *v_it, mesh.data(v_it).cog());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -224,11 +224,11 @@ protected:
|
||||
if (_m.is_boundary(fit))
|
||||
{
|
||||
if(gen%2)
|
||||
_m.property(fp_pos_, fit.handle()).invalidate();
|
||||
_m.property(fp_pos_, *fit).invalidate();
|
||||
else
|
||||
{
|
||||
//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) ));
|
||||
pos = zero;
|
||||
@@ -303,7 +303,7 @@ protected:
|
||||
}
|
||||
}
|
||||
vh = _m.add_vertex( pos );
|
||||
_m.property(fp_pos_, fit.handle()) = vh;
|
||||
_m.property(fp_pos_, *fit) = vh;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -312,16 +312,16 @@ protected:
|
||||
int nOrdinary = 0;
|
||||
|
||||
//check number of extraordinary vertices
|
||||
for(fvit = _m.fv_iter( fit ); fvit; ++fvit)
|
||||
if( (_m.valence(fvit.handle())) == 6 || _m.is_boundary(fvit.handle()) )
|
||||
for(fvit = _m.fv_iter( fit ); fvit.is_valid(); ++fvit)
|
||||
if( (_m.valence(*fvit)) == 6 || _m.is_boundary(*fvit) )
|
||||
++nOrdinary;
|
||||
|
||||
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
|
||||
heh = fheit.handle();
|
||||
heh = *fheit;
|
||||
assert(_m.to_vertex_handle(heh).is_valid());
|
||||
pos += real_t(32.0/81) * _m.point(_m.to_vertex_handle(heh));
|
||||
//tip vertex has weight -1/81
|
||||
@@ -346,14 +346,14 @@ protected:
|
||||
else
|
||||
{
|
||||
//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);
|
||||
if( (_m.valence(vh) != 6) && (!_m.is_boundary(vh)) )
|
||||
{
|
||||
unsigned int K = _m.valence(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)) )
|
||||
{
|
||||
pos += weights_[K][i]*_m.point(_m.to_vertex_handle(heh));
|
||||
@@ -364,7 +364,7 @@ protected:
|
||||
}
|
||||
|
||||
vh = _m.add_vertex( pos );
|
||||
_m.property(fp_pos_, fit.handle()) = vh;
|
||||
_m.property(fp_pos_, *fit) = vh;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,8 +377,8 @@ protected:
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(_m.property(fp_pos_, fit.handle()).is_valid());
|
||||
_m.split( fit, _m.property(fp_pos_, fit.handle()) );
|
||||
assert(_m.property(fp_pos_, *fit).is_valid());
|
||||
_m.split( fit, _m.property(fp_pos_, *fit) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ check(unsigned int _targets, std::ostream& _os)
|
||||
{
|
||||
if (!is_deleted(v_it))
|
||||
{
|
||||
vh = v_it.handle();
|
||||
vh = *v_it;
|
||||
|
||||
|
||||
/* 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);
|
||||
vh_it; ++vh_it)
|
||||
{
|
||||
if (mesh_.is_boundary(vh_it.handle()))
|
||||
if (mesh_.is_boundary(*vh_it))
|
||||
{
|
||||
_os << "MeshChecker: vertex " << vh
|
||||
<< ": 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)
|
||||
{
|
||||
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 ?
|
||||
@@ -206,11 +206,11 @@ check(unsigned int _targets, std::ostream& _os)
|
||||
{
|
||||
if (!is_deleted(f_it))
|
||||
{
|
||||
fh = f_it.handle();
|
||||
fh = *f_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
|
||||
<< ": its halfedge does not reference face\n";
|
||||
|
||||
@@ -142,7 +142,7 @@ build_strips()
|
||||
|
||||
|
||||
// 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[2] = mesh_.next_halfedge_handle(h[1]);
|
||||
|
||||
|
||||
@@ -84,22 +84,22 @@ TEST_F(OpenMeshProperties, VertexPropertyCheckDouble) {
|
||||
double index = 0.0;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// Check if it is ok.
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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:
|
||||
std::vector<double>::iterator it=mesh_.property(doubleHandle).data_vector().begin();
|
||||
@@ -174,22 +174,22 @@ TEST_F(OpenMeshProperties, VertexPropertyCheckBool) {
|
||||
bool current = true;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// Check if it is ok.
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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:
|
||||
std::vector<bool>::iterator it=mesh_.property(boolHandle).data_vector().begin();
|
||||
@@ -262,43 +262,43 @@ TEST_F(OpenMeshProperties, VertexPropertyCopypropertiesInt) {
|
||||
|
||||
// Fill property
|
||||
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.
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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
|
||||
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)[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)[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)[2] ) << "Invalid z position for vertex 0";
|
||||
++v_it;
|
||||
|
||||
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( 0, mesh_.point(v_it)[2] ) << "Invalid z 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( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 1";
|
||||
++v_it;
|
||||
|
||||
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( 0, mesh_.point(v_it)[2] ) << "Invalid z 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( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 2";
|
||||
++v_it;
|
||||
|
||||
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)[2] ) << "Invalid z 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)[2] ) << "Invalid z position for vertex 3";
|
||||
++v_it;
|
||||
|
||||
//===========================================================
|
||||
@@ -309,31 +309,31 @@ TEST_F(OpenMeshProperties, VertexPropertyCopypropertiesInt) {
|
||||
// Check vertex positions
|
||||
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)[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)[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)[2] ) << "Invalid z position for vertex 0 after copy";
|
||||
++v_it;
|
||||
|
||||
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( 0, mesh_.point(v_it)[2] ) << "Invalid z 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( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 1 after copy";
|
||||
++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)[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( 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( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 2 after copy";
|
||||
++v_it;
|
||||
|
||||
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)[2] ) << "Invalid z 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)[2] ) << "Invalid z position for vertex 3 after copy";
|
||||
++v_it;
|
||||
|
||||
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 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( 3, mesh_.property(intHandle,v_it) ) << "Invalid int value for vertex 3 after copy";
|
||||
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( 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";
|
||||
|
||||
//===========================================================
|
||||
// Copy from vertex 2 to 3, including build in properties
|
||||
@@ -343,31 +343,31 @@ TEST_F(OpenMeshProperties, VertexPropertyCopypropertiesInt) {
|
||||
// Check vertex positions
|
||||
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)[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)[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)[2] ) << "Invalid z position for vertex 0 after copy";
|
||||
++v_it;
|
||||
|
||||
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( 0, mesh_.point(v_it)[2] ) << "Invalid z 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( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 1 after copy";
|
||||
++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)[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( 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( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 2 after copy";
|
||||
++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)[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( 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( 0, mesh_.point(*v_it)[2] ) << "Invalid z position for vertex 3 after copy";
|
||||
++v_it;
|
||||
|
||||
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 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 3 after copy";
|
||||
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( 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";
|
||||
|
||||
|
||||
}
|
||||
@@ -412,8 +412,8 @@ TEST_F(OpenMeshProperties, CheckStatusPropertiesHalfedgeEdgeAllDeleted) {
|
||||
|
||||
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(he_it.handle()).deleted() ) << "Halfedge not deleted";
|
||||
EXPECT_TRUE( mesh_.status(mesh_.edge_handle(*he_it)).deleted() ) << "Edge not deleted";
|
||||
EXPECT_TRUE( mesh_.status(*he_it).deleted() ) << "Halfedge not deleted";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user