First set of changes to the new circulators

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@898 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2013-08-07 09:40:10 +00:00
parent 1c8d4fb59b
commit afda61f067
23 changed files with 148 additions and 148 deletions

View File

@@ -243,7 +243,7 @@ public:
prev_rule()->raise(eh, _target_state - 1);
}
for (fv_it = mesh_.fv_iter(_fh); fv_it; ++fv_it) {
for (fv_it = mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
vh = fv_it.handle();
prev_rule()->raise(vh, _target_state - 1);
@@ -305,7 +305,7 @@ public:
{
for (voh_it = mesh_.voh_iter(_vh); voh_it; ++voh_it) {
halfedge_vector.push_back(voh_it.handle());
halfedge_vector.push_back(*voh_it);
}
while ( !halfedge_vector.empty() ) {
@@ -316,7 +316,7 @@ public:
}
for (voh_it = mesh_.voh_iter(_vh); voh_it; ++voh_it) {
halfedge_vector.push_back(voh_it.handle());
halfedge_vector.push_back(*voh_it);
}
while ( !halfedge_vector.empty() ) {

View File

@@ -110,7 +110,7 @@ Tvv3<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
int valence(0);
// raise all adjacent vertices to level x-1
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it; ++fv_it) {
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
vertex_vector.push_back(fv_it.handle());
}
@@ -140,7 +140,7 @@ Tvv3<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
// calculate display position for new vertex
for (vv_it = Base::mesh_.vv_iter(vh); vv_it; ++vv_it)
{
position += Base::mesh_.point(vv_it.handle());
position += Base::mesh_.point(*vv_it);
++valence;
}
@@ -156,24 +156,24 @@ Tvv3<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
// check for edge flipping
for (voh_it = Base::mesh_.voh_iter(vh); voh_it; ++voh_it) {
if (Base::mesh_.FH(voh_it.handle()).is_valid()) {
if (Base::mesh_.FH(*voh_it).is_valid()) {
MOBJ(Base::mesh_.FH(voh_it.handle())).set_state(_target_state);
MOBJ(Base::mesh_.FH(voh_it.handle())).set_not_final();
MOBJ(Base::mesh_.FH(voh_it.handle())).set_position(_target_state - 1, face_position);
MOBJ(Base::mesh_.FH(*voh_it)).set_state(_target_state);
MOBJ(Base::mesh_.FH(*voh_it)).set_not_final();
MOBJ(Base::mesh_.FH(*voh_it)).set_position(_target_state - 1, face_position);
for (state_t j = 0; j < _target_state; ++j) {
MOBJ(Base::mesh_.FH(voh_it.handle())).set_position(j, MOBJ(_fh).position(j));
MOBJ(Base::mesh_.FH(*voh_it)).set_position(j, MOBJ(_fh).position(j));
}
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))).is_valid()) {
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle())))).state() == _target_state) {
if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)))).state() == _target_state) {
if (Base::mesh_.is_flip_ok(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle())))) {
if (Base::mesh_.is_flip_ok(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it)))) {
edge_vector.push_back(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle())));
edge_vector.push_back(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it)));
}
}
}
@@ -346,7 +346,7 @@ Tvv4<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
std::vector<typename M::HalfedgeHandle> halfedge_vector;
// raise all adjacent vertices to level x-1
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it; ++fv_it) {
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
vertex_vector.push_back(fv_it.handle());
}
@@ -824,7 +824,7 @@ void VF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
if (_target_state > 1) {
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it; ++fv_it) {
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
vertex_vector.push_back(fv_it.handle());
}
@@ -842,7 +842,7 @@ void VF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
typename M::Point position(0.0, 0.0, 0.0);
int valence(0);
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it; ++fv_it) {
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
++valence;
position += Base::mesh_.data(fv_it).position(_target_state - 1);
@@ -1084,13 +1084,13 @@ void FVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
if (Base::mesh_.FH(voh_it.handle()).is_valid()) {
if (Base::mesh_.FH(*voh_it).is_valid()) {
face_vector.push_back(Base::mesh_.FH(voh_it.handle()));
face_vector.push_back(Base::mesh_.FH(*voh_it));
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))).is_valid()) {
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))));
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))));
}
}
}
@@ -1105,13 +1105,13 @@ void FVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
if (Base::mesh_.FH(voh_it.handle()).is_valid()) {
if (Base::mesh_.FH(*voh_it).is_valid()) {
face_vector.push_back(Base::mesh_.FH(voh_it.handle()));
face_vector.push_back(Base::mesh_.FH(*voh_it));
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))).is_valid()) {
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))));
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))));
}
}
}
@@ -1127,13 +1127,13 @@ void FVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
if (Base::mesh_.FH(voh_it.handle()).is_valid()) {
if (Base::mesh_.FH(*voh_it).is_valid()) {
face_vector.push_back(Base::mesh_.FH(voh_it.handle()));
face_vector.push_back(Base::mesh_.FH(*voh_it));
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))).is_valid()) {
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))));
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))));
}
}
}
@@ -1170,25 +1170,25 @@ void FVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
fh = Base::mesh_.FH(voh_it.handle());
fh = Base::mesh_.FH(*voh_it);
if (fh.is_valid())
Base::prev_rule()->raise(fh, _target_state - 1);
fh = Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle())));
fh = Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)));
if (fh.is_valid())
Base::prev_rule()->raise(fh, _target_state - 1);
if (Base::mesh_.FH(voh_it.handle()).is_valid()) {
if (Base::mesh_.FH(*voh_it).is_valid()) {
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))).is_valid()) {
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
position += MOBJ(Base::mesh_.FH(voh_it.handle())).position(_target_state - 1) * c;
position += MOBJ(Base::mesh_.FH(*voh_it)).position(_target_state - 1) * c;
position += MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle())))).position(_target_state - 1) * (1.0 - c);
position += MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)))).position(_target_state - 1) * (1.0 - c);
}
else {
position += MOBJ(Base::mesh_.FH(voh_it.handle())).position(_target_state - 1);
position += MOBJ(Base::mesh_.FH(*voh_it)).position(_target_state - 1);
}
}
@@ -1256,7 +1256,7 @@ void VV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (; vv_it; ++vv_it) {
vertex_vector.push_back(vv_it.handle());
vertex_vector.push_back(*vv_it);
}
while (!vertex_vector.empty()) {
@@ -1269,7 +1269,7 @@ void VV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (; vv_it; ++vv_it) {
vertex_vector.push_back(vv_it.handle());
vertex_vector.push_back(*vv_it);
}
while (!vertex_vector.empty()) {
@@ -1326,7 +1326,7 @@ void VVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (; vv_it; ++vv_it) {
vertex_vector.push_back(vv_it.handle());
vertex_vector.push_back(*vv_it);
}
while (!vertex_vector.empty()) {
@@ -1339,7 +1339,7 @@ void VVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (; vv_it; ++vv_it) {
vertex_vector.push_back(vv_it.handle());
vertex_vector.push_back(*vv_it);
}
while (!vertex_vector.empty()) {
@@ -1673,7 +1673,7 @@ void EVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
face_vector.push_back(Base::mesh_.FH(voh_it.handle()));
face_vector.push_back(Base::mesh_.FH(*voh_it));
}
while (!face_vector.empty()) {
@@ -1687,9 +1687,9 @@ void EVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
edge_vector.push_back(Base::mesh_.EH(voh_it.handle()));
edge_vector.push_back(Base::mesh_.EH(*voh_it));
edge_vector.push_back(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle())));
edge_vector.push_back(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it)));
}
while (!edge_vector.empty()) {
@@ -1714,18 +1714,18 @@ void EVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it)
{
if (MOBJ(Base::mesh_.EH(voh_it.handle())).final())
if (MOBJ(Base::mesh_.EH(*voh_it)).final())
{
position += MOBJ(Base::mesh_.EH(voh_it.handle())).position(_target_state-1)*c;
position += MOBJ(Base::mesh_.EH(*voh_it)).position(_target_state-1)*c;
if ( Base::mesh_.FH(voh_it.handle()).is_valid() &&
MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle()))).final() &&
MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle()))).position(_target_state - 1) != zero_point)
if ( Base::mesh_.FH(*voh_it).is_valid() &&
MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).final() &&
MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).position(_target_state - 1) != zero_point)
{
position += MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle()))).position(_target_state-1) * (1.0-c);
position += MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).position(_target_state-1) * (1.0-c);
}
else {
position += MOBJ(Base::mesh_.EH(voh_it.handle())).position(_target_state - 1) * (1.0 - c);
position += MOBJ(Base::mesh_.EH(*voh_it)).position(_target_state - 1) * (1.0 - c);
}
}
else {

View File

@@ -297,7 +297,7 @@ void CompositeT<MeshType,RealType>::VF()
valence = 0;
cog = zero_point;
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it; ++fv_it) {
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it.is_valid(); ++fv_it) {
cog += mesh_.data(fv_it).position();
++valence;
}
@@ -352,7 +352,7 @@ void CompositeT<MeshType,RealType>::VFa(Coeff& _coeff)
cog = zero_point;
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it; ++fv_it) {
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it.is_valid(); ++fv_it) {
if (fv_it.handle() == vh[i]) {
cog += fv_it->position() * alpha;
} else {
@@ -407,7 +407,7 @@ void CompositeT<MeshType,RealType>::VFa(scalar_t _alpha)
cog = zero_point;
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it; ++fv_it) {
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it.is_valid(); ++fv_it) {
if (fv_it.handle() == vh[i]) {
cog += fv_it->position() * _alpha;
} else {
@@ -586,13 +586,13 @@ void CompositeT<MeshType,RealType>::FVc(Coeff& _coeff)
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
if (mesh_.face_handle(voh_it.handle()).is_valid()) {
if (mesh_.face_handle(*voh_it).is_valid()) {
if (mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(voh_it.handle()))).is_valid()) {
cog += mesh_.data(mesh_.face_handle(voh_it.handle())).position() * c;
cog += mesh_.data(mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(voh_it.handle())))).position() * (1.0 - c);
if (mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(*voh_it))).is_valid()) {
cog += mesh_.data(mesh_.face_handle(*voh_it)).position() * c;
cog += mesh_.data(mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(*voh_it)))).position() * (1.0 - c);
} else {
cog += mesh_.data(mesh_.face_handle(voh_it.handle())).position();
cog += mesh_.data(mesh_.face_handle(*voh_it)).position();
}
} else {
--valence;
@@ -629,13 +629,13 @@ void CompositeT<MeshType,RealType>::FVc(scalar_t _c)
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
if (mesh_.face_handle(voh_it.handle()).is_valid()) {
if (mesh_.face_handle(*voh_it).is_valid()) {
if (mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(voh_it.handle()))).is_valid()) {
cog += mesh_.deref(mesh_.face_handle(voh_it.handle())).position() * _c;
cog += mesh_.deref(mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(voh_it.handle())))).position() * (1.0 - _c);
if (mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(*voh_it))).is_valid()) {
cog += mesh_.deref(mesh_.face_handle(*voh_it)).position() * _c;
cog += mesh_.deref(mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(*voh_it)))).position() * (1.0 - _c);
} else {
cog += mesh_.deref(mesh_.face_handle(voh_it.handle())).position();
cog += mesh_.deref(mesh_.face_handle(*voh_it)).position();
}
} else {
--valence;
@@ -897,8 +897,8 @@ void CompositeT<MeshType,RealType>::EVc(Coeff& _coeff)
c = _coeff(valence);
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
cog += mesh_.data(mesh_.edge_handle(voh_it.handle())).position() * c;
cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(voh_it.handle()))).position() * (1.0 - c);
cog += mesh_.data(mesh_.edge_handle(*voh_it)).position() * c;
cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(*voh_it))).position() * (1.0 - c);
}
cog /= valence;
@@ -927,8 +927,8 @@ void CompositeT<MeshType,RealType>::EVc(scalar_t _c)
}
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
cog += mesh_.data(mesh_.edge_handle(voh_it.handle())).position() * _c;
cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(voh_it.handle()))).position() * (1.0 - _c);
cog += mesh_.data(mesh_.edge_handle(*voh_it)).position() * _c;
cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(*voh_it))).position() * (1.0 - _c);
}
cog /= valence;

View File

@@ -183,7 +183,7 @@ protected:
_m.split(a.first,newVertex);
for ( typename MeshType::VertexOHalfedgeIter voh_it(_m,newVertex); voh_it; ++voh_it) {
typename MeshType::EdgeHandle eh = _m.edge_handle(voh_it.handle());
typename MeshType::EdgeHandle eh = _m.edge_handle(*voh_it);
const typename MeshType::Point to = _m.point(_m.to_vertex_handle(voh_it));
const typename MeshType::Point from = _m.point(_m.from_vertex_handle(voh_it));
real_t length = (to - from).sqrnorm();