- marked current_halfedge_handle as deprecated

- updated code to fix related warnings
- added some unittests to ensure unchanged behaviour when replacing current_halfedge_handle

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@917 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Isaak Lim
2013-08-08 12:47:48 +00:00
parent cb16ac26d6
commit 2eeb756b6a
7 changed files with 346 additions and 31 deletions

View File

@@ -140,7 +140,7 @@ public:
fh_iter != mesh_.fh_end(fh); ++fh_iter)
{
//and write the normals to it
typename Mesh::HalfedgeHandle heh = fh_iter.current_halfedge_handle();
typename Mesh::HalfedgeHandle heh = *fh_iter;
typename Mesh::VertexHandle vh = mesh_.to_vertex_handle(heh);
typename std::map<VertexHandle,Normal>::iterator it_heNs = halfedgeNormals_.find(vh);
if (it_heNs != halfedgeNormals_.end())

View File

@@ -313,7 +313,7 @@ class GenericCirculatorT : protected GenericCirculatorBaseT<Mesh> {
return GenericCirculator_ValueHandleFns::is_valid(this->heh_, this->start_, this->lap_counter_);
}
//DEPRECATED("current_halfedge_handle() is an implementation detail and should not be accessed from outside the iterator class.")
DEPRECATED("current_halfedge_handle() is an implementation detail and should not be accessed from outside the iterator class.")
/**
* \deprecated
* current_halfedge_handle() is an implementation detail and should not

View File

@@ -57,9 +57,9 @@ PolyConnectivity::find_halfedge(VertexHandle _start_vh, VertexHandle _end_vh ) c
{
assert(_start_vh.is_valid() && _end_vh.is_valid());
for (ConstVertexVertexIter vvIt=cvv_iter(_start_vh); vvIt.is_valid(); ++vvIt)
if (*vvIt == _end_vh)
return vvIt.current_halfedge_handle();
for (ConstVertexOHalfedgeIter voh_it = cvoh_iter(_start_vh); voh_it.is_valid(); ++voh_it)
if (to_vertex_handle(*voh_it) == _end_vh)
return *voh_it;
return InvalidHalfedgeHandle;
}

View File

@@ -134,19 +134,20 @@ float ModAspectRatioT<MeshT>::collapse_priority(const CollapseInfo& _ci) {
typename Mesh::FaceHandle fh;
const typename Mesh::Point *p1(&_ci.p1), *p2, *p3;
typename Mesh::Scalar r0, r1, r0_min(1.0), r1_min(1.0);
typename Mesh::CVVIter vv_it(mesh_, _ci.v0);
typename Mesh::ConstVertexOHalfedgeIter voh_it(mesh_, _ci.v0);
v3 = *vv_it;
v3 = mesh_.to_vertex_handle(*voh_it);
p3 = &mesh_.point(v3);
while (vv_it.is_valid()) {
while (voh_it.is_valid()) {
v2 = v3;
p2 = p3;
v3 = *(++vv_it);
++voh_it;
v3 = mesh_.to_vertex_handle(*voh_it);
p3 = &mesh_.point(v3);
fh = mesh_.face_handle(vv_it.current_halfedge_handle());
fh = mesh_.face_handle(*voh_it);
// if not boundary
if (fh.is_valid()) {

View File

@@ -97,10 +97,10 @@ void
JacobiLaplaceSmootherT<Mesh>::
compute_new_positions_C0()
{
typename Mesh::VertexIter v_it, v_end(Base::mesh_.vertices_end());
typename Mesh::CVVIter vv_it;
typename Mesh::Normal u, p, zero(0,0,0);
typename Mesh::Scalar w;
typename Mesh::VertexIter v_it, v_end(Base::mesh_.vertices_end());
typename Mesh::ConstVertexOHalfedgeIter voh_it;
typename Mesh::Normal u, p, zero(0,0,0);
typename Mesh::Scalar w;
for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
{
@@ -108,10 +108,9 @@ compute_new_positions_C0()
{
// compute umbrella
u = zero;
for (vv_it=Base::mesh_.cvv_iter(*v_it); vv_it.is_valid(); ++vv_it)
{
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(*vv_it)) * w;
for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
w = this->weight(Base::mesh_.edge_handle(*voh_it));
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(Base::mesh_.to_vertex_handle(*voh_it))) * w;
}
u *= this->weight(*v_it);
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(*v_it));
@@ -136,20 +135,19 @@ void
JacobiLaplaceSmootherT<Mesh>::
compute_new_positions_C1()
{
typename Mesh::VertexIter v_it, v_end(Base::mesh_.vertices_end());
typename Mesh::CVVIter vv_it;
typename Mesh::Normal u, uu, p, zero(0,0,0);
typename Mesh::Scalar w, diag;
typename Mesh::VertexIter v_it, v_end(Base::mesh_.vertices_end());
typename Mesh::ConstVertexOHalfedgeIter voh_it;
typename Mesh::Normal u, uu, p, zero(0,0,0);
typename Mesh::Scalar w, diag;
// 1st pass: compute umbrellas
for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
{
u = zero;
for (vv_it=Base::mesh_.cvv_iter(*v_it); vv_it.is_valid(); ++vv_it)
{
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(*vv_it))*w;
for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
w = this->weight(Base::mesh_.edge_handle(*voh_it));
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(Base::mesh_.to_vertex_handle(*voh_it)))*w;
}
u *= this->weight(*v_it);
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(*v_it));
@@ -165,11 +163,10 @@ compute_new_positions_C1()
{
uu = zero;
diag = 0.0;
for (vv_it=Base::mesh_.cvv_iter(*v_it); vv_it.is_valid(); ++vv_it)
{
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
uu -= Base::mesh_.property(umbrellas_, *vv_it);
diag += (w * this->weight(*vv_it) + 1.0) * w;
for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
w = this->weight(Base::mesh_.edge_handle(*voh_it));
uu -= Base::mesh_.property(umbrellas_, Base::mesh_.to_vertex_handle(*voh_it));
diag += (w * this->weight(Base::mesh_.to_vertex_handle(*voh_it)) + 1.0) * w;
}
uu *= this->weight(*v_it);
diag *= this->weight(*v_it);