Commit e21e113b authored by Jan Möbius's avatar Jan Möbius

Replaced all .handle() calls

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@904 fdac6126-5c0c-442c-9429-916003d36597
parent ea099b14
......@@ -322,7 +322,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
glBegin(GL_TRIANGLES);
for (; fIt!=fEnd; ++fIt)
{
fvIt = mesh_.cfv_iter(fIt.handle());
fvIt = mesh_.cfv_iter(*fIt);
glVertex3fv( &mesh_.point(fvIt)[0] );
++fvIt;
glVertex3fv( &mesh_.point(fvIt)[0] );
......@@ -339,7 +339,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
{
glNormal3fv( &mesh_.normal(fIt)[0] );
fvIt = mesh_.cfv_iter(fIt.handle());
fvIt = mesh_.cfv_iter(*fIt);
glVertex3fv( &mesh_.point(fvIt)[0] );
++fvIt;
glVertex3fv( &mesh_.point(fvIt)[0] );
......@@ -371,7 +371,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
glBegin(GL_TRIANGLES);
for (; fIt!=fEnd; ++fIt)
{
fvIt = mesh_.cfv_iter(fIt.handle());
fvIt = mesh_.cfv_iter(*fIt);
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt->idx());
......@@ -407,7 +407,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
glBegin(GL_TRIANGLES);
for (; fIt!=fEnd; ++fIt)
{
fvIt = mesh_.cfv_iter(fIt.handle());
fvIt = mesh_.cfv_iter(*fIt);
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt->idx());
......@@ -433,9 +433,9 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
glBegin(GL_TRIANGLES);
for (; fIt!=fEnd; ++fIt)
{
glColor( fIt.handle() );
glColor( *fIt );
fvIt = mesh_.cfv_iter(fIt.handle());
fvIt = mesh_.cfv_iter(*fIt);
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt->idx());
......@@ -460,9 +460,9 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
glBegin(GL_TRIANGLES);
for (; fIt!=fEnd; ++fIt)
{
glMaterial( fIt.handle() );
glMaterial( *fIt );
fvIt = mesh_.cfv_iter(fIt.handle());
fvIt = mesh_.cfv_iter(*fIt);
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt->idx());
......
......@@ -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, calc_face_normal(f_it.handle()));
this->set_normal(*f_it, calc_face_normal(*f_it));
}
......
......@@ -190,7 +190,7 @@ size_t McDecimaterT<Mesh>::decimate(size_t _n_collapses) {
typename Mesh::VertexFaceIter vf_it = mesh_.vf_iter(ci.v1);
for (; vf_it; ++vf_it)
if (!mesh_.status(vf_it).deleted())
mesh_.set_normal(vf_it, mesh_.calc_face_normal(vf_it.handle()));
mesh_.set_normal(vf_it, mesh_.calc_face_normal(*vf_it));
// post-process collapse
this->postprocess_collapse(ci);
......@@ -324,7 +324,7 @@ size_t McDecimaterT<Mesh>::decimate_to_faces(size_t _nv, size_t _nf) {
typename Mesh::VertexFaceIter vf_it = mesh_.vf_iter(ci.v1);
for (; vf_it; ++vf_it)
if (!mesh_.status(vf_it).deleted())
mesh_.set_normal(vf_it, mesh_.calc_face_normal(vf_it.handle()));
mesh_.set_normal(vf_it, mesh_.calc_face_normal(*vf_it));
// post-process collapse
this->postprocess_collapse(ci);
......@@ -478,7 +478,7 @@ size_t McDecimaterT<Mesh>::decimate_constraints_only(float _factor) {
typename Mesh::VertexFaceIter vf_it = mesh_.vf_iter(ci.v1);
for (; vf_it; ++vf_it)
if (!mesh_.status(vf_it).deleted())
mesh_.set_normal(vf_it, mesh_.calc_face_normal(vf_it.handle()));
mesh_.set_normal(vf_it, mesh_.calc_face_normal(*vf_it));
// post-process collapse
this->postprocess_collapse(ci);
......
......@@ -113,7 +113,7 @@ void ModAspectRatioT<MeshT>::preprocess_collapse(const CollapseInfo& _ci) {
typename Mesh::FVIter fv_it;
for (typename Mesh::VFIter vf_it = mesh_.vf_iter(_ci.v0); vf_it; ++vf_it) {
fh = vf_it.handle();
fh = *vf_it;
if (fh != _ci.fl && fh != _ci.fr) {
typename Mesh::Point& p0 = mesh_.point(fv_it = mesh_.fv_iter(fh));
typename Mesh::Point& p1 = mesh_.point(++fv_it);
......@@ -134,14 +134,14 @@ float ModAspectRatioT<MeshT>::collapse_priority(const CollapseInfo& _ci) {
typename Mesh::Scalar r0, r1, r0_min(1.0), r1_min(1.0);
typename Mesh::CVVIter vv_it(mesh_, _ci.v0);
v3 = vv_it.handle();
v3 = *vv_it;
p3 = &mesh_.point(v3);
while (vv_it) {
v2 = v3;
p2 = p3;
v3 = (++vv_it).handle();
v3 = *(++vv_it);
p3 = &mesh_.point(v3);
fh = mesh_.face_handle(vv_it.current_halfedge_handle());
......
......@@ -216,7 +216,7 @@ collapse_priority(const CollapseInfo& _ci)
// collect all points to be tested
// collect all faces to be tested against
for (vf_it=mesh_.vf_iter(_ci.v0); vf_it; ++vf_it) {
fh = vf_it.handle();
fh = *vf_it;
if (fh != _ci.fl && fh != _ci.fr)
faces.push_back(fh);
......@@ -290,7 +290,7 @@ postprocess_collapse(const CollapseInfo& _ci)
// collect active faces and their points
for (vf_it=mesh_.vf_iter(_ci.v1); vf_it; ++vf_it) {
fh = vf_it.handle();
fh = *vf_it;
faces.push_back(fh);
Points& pts = mesh_.property(points_, fh);
......
......@@ -167,7 +167,7 @@ public:
if (_ci.vrv0.is_valid()) fhr = mesh_.face_handle(_ci.vrv0);
for (; vf_it; ++vf_it) {
fh = vf_it.handle();
fh = *vf_it;
if (fh != _ci.fl && fh != _ci.fr) {
NormalCone nc = mesh_.property(normal_cones_, fh);
......
......@@ -122,7 +122,7 @@ public:
for (; vf_it; ++vf_it)
{
fh = vf_it.handle();
fh = *vf_it;
if (fh != _ci.fl && fh != _ci.fr)
{
typename Mesh::Normal n1 = Base::mesh().normal(fh);
......
......@@ -92,7 +92,7 @@ write( const std::string& _ofname )
for (; v_it != v_end; ++v_it)
if (!Base::mesh().status(v_it).deleted())
{
vhandles[i] = v_it.handle();
vhandles[i] = *v_it;
Base::mesh().property( idx_, v_it ) = i;
++i;
}
......@@ -151,7 +151,7 @@ write( const std::string& _ofname )
{
if (!Base::mesh().status(f_it).deleted())
{
typename Mesh::ConstFaceVertexIter fv_it(Base::mesh(), f_it.handle());
typename Mesh::ConstFaceVertexIter fv_it(Base::mesh(), *f_it);
IO::store( out, Base::mesh().property( idx_, fv_it ) );
IO::store( out, Base::mesh().property( idx_, ++fv_it ) );
......
......@@ -93,10 +93,10 @@ initialize()
for (; f_it != f_end; ++f_it)
{
fv_it = Base::mesh().fv_iter(f_it.handle());
vh0 = fv_it.handle(); ++fv_it;
vh1 = fv_it.handle(); ++fv_it;
vh2 = fv_it.handle();
fv_it = Base::mesh().fv_iter(*f_it);
vh0 = *fv_it; ++fv_it;
vh1 = *fv_it; ++fv_it;
vh2 = *fv_it;
Vec3 v0, v1, v2;
{
......
......@@ -101,23 +101,23 @@ PolyMesh_ArrayKernelT<MeshTraits>* MeshDual (PolyMesh_ArrayKernelT<MeshTraits> &
typename PolyMesh_ArrayKernelT<MeshTraits>::Point centerPoint(0,0,0);
unsigned int degree= 0;
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstFaceVertexIter vit=primal.cfv_iter(fit); vit; ++vit, ++degree)
centerPoint += primal.point(vit.handle());
assert(degree!=0);
centerPoint /= degree;
primal.property(primalToDual, fit) = dual->add_vertex(centerPoint);
centerPoint += primal.point(*vit);
assert(degree!=0);
centerPoint /= degree;
primal.property(primalToDual, fit) = dual->add_vertex(centerPoint);
}
//for each vertex in the primal, add a face in the dual
std::vector< typename PolyMesh_ArrayKernelT<MeshTraits>::VertexHandle > face_vhandles;
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstVertexIter vit=primal.vertices_begin(); vit!=primal.vertices_end(); ++vit)
{
if(!primal.is_boundary(vit.handle()))
{
face_vhandles.clear();
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstVertexFaceIter fit=primal.cvf_iter(vit); fit; ++fit)
face_vhandles.push_back(primal.property(primalToDual, fit));
dual->add_face(face_vhandles);
}
if(!primal.is_boundary(*vit))
{
face_vhandles.clear();
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstVertexFaceIter fit=primal.cvf_iter(vit); fit; ++fit)
face_vhandles.push_back(primal.property(primalToDual, fit));
dual->add_face(face_vhandles);
}
}
primal.remove_property(primalToDual);
......
......@@ -151,14 +151,14 @@ compute_weights(LaplaceWeighting _weighting)
{
for (e_it=Base::mesh_.edges_begin(); e_it!=e_end; ++e_it)
{
heh0 = Base::mesh_.halfedge_handle(e_it.handle(), 0);
heh1 = Base::mesh_.halfedge_handle(e_it.handle(), 1);
v0 = Base::mesh_.to_vertex_handle(heh0);
v1 = Base::mesh_.to_vertex_handle(heh1);
Base::mesh_.property(edge_weights_, e_it) = 1.0;
Base::mesh_.property(vertex_weights_, v0) += 1.0;
Base::mesh_.property(vertex_weights_, v1) += 1.0;
heh0 = Base::mesh_.halfedge_handle(*e_it, 0);
heh1 = Base::mesh_.halfedge_handle(*e_it, 1);
v0 = Base::mesh_.to_vertex_handle(heh0);
v1 = Base::mesh_.to_vertex_handle(heh1);
Base::mesh_.property(edge_weights_, e_it) = 1.0;
Base::mesh_.property(vertex_weights_, v0) += 1.0;
Base::mesh_.property(vertex_weights_, v1) += 1.0;
}
break;
......@@ -170,31 +170,31 @@ compute_weights(LaplaceWeighting _weighting)
{
for (e_it=Base::mesh_.edges_begin(); e_it!=e_end; ++e_it)
{
weight = 0.0;
heh0 = Base::mesh_.halfedge_handle(e_it.handle(), 0);
v0 = Base::mesh_.to_vertex_handle(heh0);
p0 = &Base::mesh_.point(v0);
heh1 = Base::mesh_.halfedge_handle(e_it.handle(), 1);
v1 = Base::mesh_.to_vertex_handle(heh1);
p1 = &Base::mesh_.point(v1);
heh2 = Base::mesh_.next_halfedge_handle(heh0);
p2 = &Base::mesh_.point(Base::mesh_.to_vertex_handle(heh2));
d0 = (*p0 - *p2); d0.normalize();
d1 = (*p1 - *p2); d1.normalize();
weight += 1.0 / tan(acos(std::max(lb, std::min(ub, dot(d0,d1) ))));
heh2 = Base::mesh_.next_halfedge_handle(heh1);
p2 = &Base::mesh_.point(Base::mesh_.to_vertex_handle(heh2));
d0 = (*p0 - *p2); d0.normalize();
d1 = (*p1 - *p2); d1.normalize();
weight += 1.0 / tan(acos(std::max(lb, std::min(ub, dot(d0,d1) ))));
Base::mesh_.property(edge_weights_, e_it) = weight;
Base::mesh_.property(vertex_weights_, v0) += weight;
Base::mesh_.property(vertex_weights_, v1) += weight;
weight = 0.0;
heh0 = Base::mesh_.halfedge_handle(*e_it, 0);
v0 = Base::mesh_.to_vertex_handle(heh0);
p0 = &Base::mesh_.point(v0);
heh1 = Base::mesh_.halfedge_handle(*e_it, 1);
v1 = Base::mesh_.to_vertex_handle(heh1);
p1 = &Base::mesh_.point(v1);
heh2 = Base::mesh_.next_halfedge_handle(heh0);
p2 = &Base::mesh_.point(Base::mesh_.to_vertex_handle(heh2));
d0 = (*p0 - *p2); d0.normalize();
d1 = (*p1 - *p2); d1.normalize();
weight += 1.0 / tan(acos(std::max(lb, std::min(ub, dot(d0,d1) ))));
heh2 = Base::mesh_.next_halfedge_handle(heh1);
p2 = &Base::mesh_.point(Base::mesh_.to_vertex_handle(heh2));
d0 = (*p0 - *p2); d0.normalize();
d1 = (*p1 - *p2); d1.normalize();
weight += 1.0 / tan(acos(std::max(lb, std::min(ub, dot(d0,d1) ))));
Base::mesh_.property(edge_weights_, *e_it) = weight;
Base::mesh_.property(vertex_weights_, v0) += weight;
Base::mesh_.property(vertex_weights_, v1) += weight;
}
break;
}
......@@ -206,9 +206,9 @@ compute_weights(LaplaceWeighting _weighting)
// after: one over sum of edge weights
for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
{
weight = Base::mesh_.property(vertex_weights_, v_it);
weight = Base::mesh_.property(vertex_weights_, *v_it);
if (weight)
Base::mesh_.property(vertex_weights_, v_it) = 1.0 / weight;
Base::mesh_.property(vertex_weights_, *v_it) = 1.0 / weight;
}
}
......
......@@ -85,7 +85,7 @@ initialize( void )
{
mesh_.data(v_it).set_state(0);
mesh_.data(v_it).set_final();
mesh_.data(v_it).set_position(0, mesh_.point(v_it.handle()));
mesh_.data(v_it).set_position(0, mesh_.point(*v_it));
}
// ---------------------------------------- Init Faces
......@@ -203,7 +203,7 @@ void CompositeT<M>::refine(typename M::FaceHandle& _fh)
for (; fh_it; ++fh_it)
{
hh_vector.push_back(mesh_.PHEH(mesh_.OHEH(fh_it.handle())));
hh_vector.push_back(mesh_.PHEH(mesh_.OHEH(*fh_it)));
}
}
......
......@@ -239,14 +239,14 @@ public:
for (fe_it = mesh_.fe_iter(_fh); fe_it; ++fe_it) {
eh = fe_it.handle();
prev_rule()->raise(eh, _target_state - 1);
eh = *fe_it;
prev_rule()->raise(eh, _target_state - 1);
}
for (fv_it = mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
vh = fv_it.handle();
prev_rule()->raise(vh, _target_state - 1);
vh = *fv_it;
prev_rule()->raise(vh, _target_state - 1);
}
}
}
......
......@@ -112,7 +112,7 @@ Tvv3<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
// raise all adjacent vertices to level x-1
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
vertex_vector.push_back(fv_it.handle());
vertex_vector.push_back(*fv_it);
}
while(!vertex_vector.empty()) {
......@@ -348,7 +348,7 @@ Tvv4<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
// raise all adjacent vertices to level x-1
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
vertex_vector.push_back(fv_it.handle());
vertex_vector.push_back(*fv_it);
}
while(!vertex_vector.empty()) {
......@@ -826,7 +826,7 @@ void VF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
vertex_vector.push_back(fv_it.handle());
vertex_vector.push_back(*fv_it);
}
while (!vertex_vector.empty()) {
......@@ -883,20 +883,20 @@ void FF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
for (ff_it = Base::mesh_.ff_iter(_fh); ff_it; ++ff_it) {
face_vector.push_back(ff_it.handle());
face_vector.push_back(*ff_it);
}
while (!face_vector.empty()) {
fh = face_vector.back();
face_vector.pop_back();
fh = face_vector.back();
face_vector.pop_back();
Base::prev_rule()->raise(fh, _target_state - 1);
Base::prev_rule()->raise(fh, _target_state - 1);
}
for (ff_it = Base::mesh_.ff_iter(_fh); ff_it; ++ff_it) {
face_vector.push_back(ff_it.handle());
face_vector.push_back(*ff_it);
}
while (!face_vector.empty()) {
......@@ -946,25 +946,25 @@ void FFc<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
if (_target_state > 1)
{
for (; ff_it; ++ff_it)
face_vector.push_back(ff_it.handle());
face_vector.push_back(*ff_it);
while (!face_vector.empty())
{
fh = face_vector.back();
face_vector.pop_back();
Base::prev_rule()->raise(fh, _target_state - 1);
fh = face_vector.back();
face_vector.pop_back();
Base::prev_rule()->raise(fh, _target_state - 1);
}
for (ff_it = Base::mesh_.ff_iter(_fh); ff_it; ++ff_it)
face_vector.push_back(ff_it.handle());
face_vector.push_back(*ff_it);
while (!face_vector.empty()) {
fh = face_vector.back();
face_vector.pop_back();
fh = face_vector.back();
face_vector.pop_back();
while (MOBJ(fh).state() < _target_state - 1)
Base::prev_rule()->raise(fh, _target_state - 1);
while (MOBJ(fh).state() < _target_state - 1)
Base::prev_rule()->raise(fh, _target_state - 1);
}
}
......@@ -1012,29 +1012,29 @@ void FV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (; vf_it; ++vf_it) {
face_vector.push_back(vf_it.handle());
face_vector.push_back(*vf_it);
}
while (!face_vector.empty()) {
fh = face_vector.back();
face_vector.pop_back();
fh = face_vector.back();
face_vector.pop_back();
Base::prev_rule()->raise(fh, _target_state - 1);
Base::prev_rule()->raise(fh, _target_state - 1);
}
for (vf_it = Base::mesh_.vf_iter(_vh); vf_it; ++vf_it) {
face_vector.push_back(vf_it.handle());
face_vector.push_back(*vf_it);
}
while (!face_vector.empty()) {
fh = face_vector.back();
face_vector.pop_back();
fh = face_vector.back();
face_vector.pop_back();
while (MOBJ(fh).state() < _target_state - 1)
Base::prev_rule()->raise(fh, _target_state - 1);
while (MOBJ(fh).state() < _target_state - 1)
Base::prev_rule()->raise(fh, _target_state - 1);
}
}
......@@ -1595,29 +1595,29 @@ void EV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
for (; ve_it; ++ve_it) {
edge_vector.push_back(ve_it.handle());
edge_vector.push_back(*ve_it);
}
while (!edge_vector.empty()) {
eh = edge_vector.back();
edge_vector.pop_back();
eh = edge_vector.back();
edge_vector.pop_back();
Base::prev_rule()->raise(eh, _target_state - 1);
Base::prev_rule()->raise(eh, _target_state - 1);
}
for (ve_it = Base::mesh_.ve_iter(_vh); ve_it; ++ve_it) {
edge_vector.push_back(ve_it.handle());
edge_vector.push_back(*ve_it);
}
while (!edge_vector.empty()) {
eh = edge_vector.back();
edge_vector.pop_back();
eh = edge_vector.back();
edge_vector.pop_back();
while (MOBJ(eh).state() < _target_state - 1)
Base::prev_rule()->raise(eh, _target_state - 1);
while (MOBJ(eh).state() < _target_state - 1)
Base::prev_rule()->raise(eh, _target_state - 1);
}
}
......@@ -1629,9 +1629,9 @@ void EV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
if (Base::mesh_.data(ve_it).final()) {
++valence;
++valence;
position += Base::mesh_.data(ve_it).position(_target_state - 1);
position += Base::mesh_.data(ve_it).position(_target_state - 1);
}
}
......@@ -1793,29 +1793,29 @@ EF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
for (; fe_it; ++fe_it) {
edge_vector.push_back(fe_it.handle());
edge_vector.push_back(*fe_it);
}
while (!edge_vector.empty()) {
eh = edge_vector.back();
edge_vector.pop_back();
eh = edge_vector.back();
edge_vector.pop_back();
Base::prev_rule()->raise(eh, _target_state - 1);
Base::prev_rule()->raise(eh, _target_state - 1);
}
for (fe_it = Base::mesh_.fe_iter(_fh); fe_it; ++fe_it) {
edge_vector.push_back(fe_it.handle());
edge_vector.push_back(*fe_it);
}
while (!edge_vector.empty()) {
eh = edge_vector.back();
edge_vector.pop_back();
eh = edge_vector.back();
edge_vector.pop_back();
while (MOBJ(eh).state() < _target_state - 1)
Base::prev_rule()->raise(eh, _target_state - 1);
while (MOBJ(eh).state() < _target_state - 1)
Base::prev_rule()->raise(eh, _target_state - 1);
}
}
......@@ -1827,9 +1827,9 @@ EF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
if (Base::mesh_.data(fe_it).final()) {
++valence;
++valence;
position += Base::mesh_.data(fe_it).position(_target_state - 1);
position += Base::mesh_.data(fe_it).position(_target_state - 1);
}
}
......
......@@ -71,7 +71,7 @@ CatmullClarkT< MeshType, RealType >::prepare( MeshType& _m )
// initialize all weights to 0 (= smooth edge)
for( EdgeIter e_it = _m.edges_begin(); e_it != _m.edges_end(); ++e_it)
_m.property(creaseWeights_, e_it.handle() ) = 0.0;
_m.property(creaseWeights_, *e_it ) = 0.0;
return true;
}
......@@ -105,21 +105,21 @@ CatmullClarkT<MeshType,RealType>::subdivide( MeshType& _m , size_t _n , const bo
for ( ; f_itr != f_end; ++f_itr)
{
Point centroid;
_m.calc_face_centroid( f_itr.handle(), centroid);
_m.property( fp_pos_, f_itr.handle() ) = centroid;
_m.calc_face_centroid( *f_itr, centroid);
_m.property( fp_pos_, *f_itr ) = centroid;
}
// Compute position for new (edge-) vertices and store them in the edge property
EdgeIter e_itr = _m.edges_begin();
EdgeIter e_end = _m.edges_end();
for ( ; e_itr != e_end; ++e_itr)
compute_midpoint( _m, e_itr.handle() );
compute_midpoint( _m, *e_itr );
// compute new positions for old vertices
VertexIter v_itr = _m.vertices_begin();
VertexIter v_end = _m.vertices_end();
for ( ; v_itr != v_end; ++v_itr)
update_vertex( _m, v_itr.handle() );
update_vertex( _m, *v_itr );
// Commit changes in geometry
v_itr = _m.vertices_begin();
......@@ -130,13 +130,13 @@ CatmullClarkT<MeshType,RealType>::subdivide( MeshType& _m , size_t _n , const bo
// Attention! Creating new edges, hence make sure the loop ends correctly.
e_itr = _m.edges_begin();
for ( ; e_itr != e_end; ++e_itr)
split_edge( _m, e_itr.handle() );
split_edge( _m, *e_itr );
// Commit changes in topology and reconsitute consistency
// Attention! Creating new faces, hence make sure the loop ends correctly.
f_itr = _m.faces_begin();
for ( ; f_itr != f_end; ++f_itr)
split_face( _m, f_itr.handle());
split_face( _m, *f_itr);
#if defined(_DEBUG) || defined(DEBUG)
......@@ -333,8 +333,8 @@ CatmullClarkT<MeshType,RealType>::update_vertex( MeshType& _m, const VertexHandl
pos = _m.point(_vh);
VertexEdgeIter ve_itr;
for ( ve_itr = _m.ve_iter( _vh); ve_itr; ++ve_itr)
if ( _m.is_boundary( ve_itr.handle()))
pos += _m.property( ep_pos_, ve_itr.handle());
if ( _m.is_boundary( *ve_itr))
pos += _m.property( ep_pos_, *ve_itr);
pos /= 3.0;
}
else // inner vertex
......@@ -356,7 +356,7 @@ CatmullClarkT<MeshType,RealType>::update_vertex( MeshType& _m, const VertexHandl
for ( ve_itr = _m.ve_iter( _vh); ve_itr; ++ve_itr)
{
valence+=1.0;
pos += _m.property(ep_pos_, ve_itr.handle());
pos += _m.property(ep_pos_, *ve_itr);
}
pos /= valence*valence;
*/
......@@ -375,7 +375,7 @@ CatmullClarkT<MeshType,RealType>::update_vertex( MeshType& _m, const VertexHandl
for ( vf_itr = _m.vf_iter( _vh); vf_itr; ++vf_itr) //, neigboring_faces += 1.0 )
{
Q += _m.property(fp_pos_, vf_itr.handle());
Q += _m.property(fp_pos_, *vf_itr);
}
Q /= valence*valence;//neigboring_faces;
......
<
......@@ -145,7 +145,7 @@ protected:
typename MeshType::VertexIter v_it;