git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@908 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2013-08-07 11:32:50 +00:00
parent 0217136b5e
commit daea181b2f
16 changed files with 117 additions and 119 deletions

View File

@@ -332,7 +332,7 @@ CatmullClarkT<MeshType,RealType>::update_vertex( MeshType& _m, const VertexHandl
Normal Vec;
pos = _m.point(_vh);
VertexEdgeIter ve_itr;
for ( ve_itr = _m.ve_iter( _vh); ve_itr; ++ve_itr)
for ( ve_itr = _m.ve_iter( _vh); ve_itr.is_valid(); ++ve_itr)
if ( _m.is_boundary( *ve_itr))
pos += _m.property( ep_pos_, *ve_itr);
pos /= 3.0;
@@ -363,9 +363,9 @@ CatmullClarkT<MeshType,RealType>::update_vertex( MeshType& _m, const VertexHandl
RealType valence(0.0);
VOHIter voh_it = _m.voh_iter( _vh );
for( ; voh_it; ++voh_it )
for( ; voh_it.is_valid(); ++voh_it )
{
pos += _m.point( _m.to_vertex_handle( voh_it ) );
pos += _m.point( _m.to_vertex_handle( *voh_it ) );
valence+=1.0;
}
pos /= valence*valence;
@@ -373,7 +373,7 @@ CatmullClarkT<MeshType,RealType>::update_vertex( MeshType& _m, const VertexHandl
VertexFaceIter vf_itr;
Point Q(0, 0, 0);
for ( vf_itr = _m.vf_iter( _vh); vf_itr; ++vf_itr) //, neigboring_faces += 1.0 )
for ( vf_itr = _m.vf_iter( _vh); vf_itr.is_valid(); ++vf_itr) //, neigboring_faces += 1.0 )
{
Q += _m.property(fp_pos_, *vf_itr);
}

View File

@@ -439,7 +439,7 @@ void CompositeT<MeshType,RealType>::FF()
valence = 0;
cog = zero_point;
for (ff_it = mesh_.ff_iter(*f_it); ff_it; ++ff_it)
for (ff_it = mesh_.ff_iter(*f_it); ff_it.is_valid(); ++ff_it)
{
cog += mesh_.data(ff_it).position();
++valence;
@@ -578,13 +578,13 @@ void CompositeT<MeshType,RealType>::FVc(Coeff& _coeff)
valence = 0;
cog = zero_point;
for (voh_it = mesh_.voh_iter(*v_it); voh_it; ++voh_it) {
for (voh_it = mesh_.voh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
++valence;
}
c = _coeff(valence);
for (voh_it = mesh_.voh_iter(*v_it); voh_it; ++voh_it) {
for (voh_it = mesh_.voh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
if (mesh_.face_handle(*voh_it).is_valid()) {
@@ -889,14 +889,14 @@ void CompositeT<MeshType,RealType>::EVc(Coeff& _coeff)
valence = 0;
cog = zero_point;
for (voh_it = mesh_.voh_iter(*v_it); voh_it; ++voh_it)
for (voh_it = mesh_.voh_iter(*v_it); voh_it.is_valid(); ++voh_it)
{
++valence;
}
c = _coeff(valence);
for (voh_it = mesh_.voh_iter(*v_it); voh_it; ++voh_it) {
for (voh_it = mesh_.voh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
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);
}

View File

@@ -436,13 +436,13 @@ private: // geometry helper
size_t valence(0);
// Calculate Valence and sum up neighbour points
for (vvit=_m.vv_iter(_vh); vvit; ++vvit) {
for (vvit=_m.vv_iter(_vh); vvit.is_valid(); ++vvit) {
++valence;
pos += vector_cast< Vec >( _m.point(vvit) );
pos += vector_cast< Vec >( _m.point(*vvit) );
}
pos *= weights_[valence].second; // alpha(n)/n * Sum q, q in one-ring of p
pos += weights_[valence].first
* vector_cast<Vec>(_m.point(_vh)); // + (1-a)*p
* vector_cast<Vec>(_m.point(_vh)); // + (1-a)*p
}
_m.property( vp_pos_, _vh ) = pos;

View File

@@ -455,11 +455,11 @@ private:
typename MeshType::HalfedgeHandle heh;
// find boundary edge
for( fe_it=_m.fe_iter( _fh ); fe_it && !_m.is_boundary( fe_it ); ++fe_it ) {};
for( fe_it=_m.fe_iter( _fh ); fe_it.is_valid() && !_m.is_boundary( fe_it ); ++fe_it ) {};
// use precomputed, already inserted but not linked vertices
vhl = _m.property(ep_nv_, fe_it).first;
vhr = _m.property(ep_nv_, fe_it).second;
vhl = _m.property(ep_nv_, *fe_it).first;
vhr = _m.property(ep_nv_, *fe_it).second;
/*
// *---------*---------*
@@ -474,8 +474,7 @@ private:
*/
// get halfedge pointing from P2 to P3 (inner boundary halfedge)
heh = _m.halfedge_handle(fe_it,
_m.is_boundary(_m.halfedge_handle(fe_it,0)));
heh = _m.halfedge_handle(*fe_it, _m.is_boundary(_m.halfedge_handle(*fe_it,0)));
typename MeshType::HalfedgeHandle pl_P3;

View File

@@ -348,11 +348,11 @@ private:
typename MeshType::HalfedgeHandle heh;
// find boundary edge
for( fe_it=_m.fe_iter( _fh ); fe_it && !_m.is_boundary( fe_it ); ++fe_it ) {};
for( fe_it=_m.fe_iter( _fh ); fe_it.is_valid() && !_m.is_boundary( fe_it ); ++fe_it ) {};
// use precomputed, already inserted but not linked vertices
vhl = _m.property(ep_nv_, fe_it).first;
vhr = _m.property(ep_nv_, fe_it).second;
vhl = _m.property(ep_nv_, *fe_it).first;
vhr = _m.property(ep_nv_, *fe_it).second;
/*
// *---------*---------*
@@ -367,8 +367,8 @@ private:
*/
// get halfedge pointing from P2 to P3 (inner boundary halfedge)
heh = _m.halfedge_handle(fe_it,
_m.is_boundary(_m.halfedge_handle(fe_it,0)));
heh = _m.halfedge_handle(*fe_it,
_m.is_boundary(_m.halfedge_handle(*fe_it,0)));
typename MeshType::HalfedgeHandle pl_P3;