Replaced all .handle() calls
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@904 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -322,7 +322,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
|
|||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
for (; fIt!=fEnd; ++fIt)
|
for (; fIt!=fEnd; ++fIt)
|
||||||
{
|
{
|
||||||
fvIt = mesh_.cfv_iter(fIt.handle());
|
fvIt = mesh_.cfv_iter(*fIt);
|
||||||
glVertex3fv( &mesh_.point(fvIt)[0] );
|
glVertex3fv( &mesh_.point(fvIt)[0] );
|
||||||
++fvIt;
|
++fvIt;
|
||||||
glVertex3fv( &mesh_.point(fvIt)[0] );
|
glVertex3fv( &mesh_.point(fvIt)[0] );
|
||||||
@@ -339,7 +339,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
|
|||||||
{
|
{
|
||||||
glNormal3fv( &mesh_.normal(fIt)[0] );
|
glNormal3fv( &mesh_.normal(fIt)[0] );
|
||||||
|
|
||||||
fvIt = mesh_.cfv_iter(fIt.handle());
|
fvIt = mesh_.cfv_iter(*fIt);
|
||||||
glVertex3fv( &mesh_.point(fvIt)[0] );
|
glVertex3fv( &mesh_.point(fvIt)[0] );
|
||||||
++fvIt;
|
++fvIt;
|
||||||
glVertex3fv( &mesh_.point(fvIt)[0] );
|
glVertex3fv( &mesh_.point(fvIt)[0] );
|
||||||
@@ -371,7 +371,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
|
|||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
for (; fIt!=fEnd; ++fIt)
|
for (; fIt!=fEnd; ++fIt)
|
||||||
{
|
{
|
||||||
fvIt = mesh_.cfv_iter(fIt.handle());
|
fvIt = mesh_.cfv_iter(*fIt);
|
||||||
glArrayElement(fvIt->idx());
|
glArrayElement(fvIt->idx());
|
||||||
++fvIt;
|
++fvIt;
|
||||||
glArrayElement(fvIt->idx());
|
glArrayElement(fvIt->idx());
|
||||||
@@ -407,7 +407,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
|
|||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
for (; fIt!=fEnd; ++fIt)
|
for (; fIt!=fEnd; ++fIt)
|
||||||
{
|
{
|
||||||
fvIt = mesh_.cfv_iter(fIt.handle());
|
fvIt = mesh_.cfv_iter(*fIt);
|
||||||
glArrayElement(fvIt->idx());
|
glArrayElement(fvIt->idx());
|
||||||
++fvIt;
|
++fvIt;
|
||||||
glArrayElement(fvIt->idx());
|
glArrayElement(fvIt->idx());
|
||||||
@@ -433,9 +433,9 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
|
|||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
for (; fIt!=fEnd; ++fIt)
|
for (; fIt!=fEnd; ++fIt)
|
||||||
{
|
{
|
||||||
glColor( fIt.handle() );
|
glColor( *fIt );
|
||||||
|
|
||||||
fvIt = mesh_.cfv_iter(fIt.handle());
|
fvIt = mesh_.cfv_iter(*fIt);
|
||||||
glArrayElement(fvIt->idx());
|
glArrayElement(fvIt->idx());
|
||||||
++fvIt;
|
++fvIt;
|
||||||
glArrayElement(fvIt->idx());
|
glArrayElement(fvIt->idx());
|
||||||
@@ -460,9 +460,9 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
|
|||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
for (; fIt!=fEnd; ++fIt)
|
for (; fIt!=fEnd; ++fIt)
|
||||||
{
|
{
|
||||||
glMaterial( fIt.handle() );
|
glMaterial( *fIt );
|
||||||
|
|
||||||
fvIt = mesh_.cfv_iter(fIt.handle());
|
fvIt = mesh_.cfv_iter(*fIt);
|
||||||
glArrayElement(fvIt->idx());
|
glArrayElement(fvIt->idx());
|
||||||
++fvIt;
|
++fvIt;
|
||||||
glArrayElement(fvIt->idx());
|
glArrayElement(fvIt->idx());
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ update_face_normals()
|
|||||||
FaceIter f_it(Kernel::faces_begin()), f_end(Kernel::faces_end());
|
FaceIter f_it(Kernel::faces_begin()), f_end(Kernel::faces_end());
|
||||||
|
|
||||||
for (; f_it != f_end; ++f_it)
|
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);
|
typename Mesh::VertexFaceIter vf_it = mesh_.vf_iter(ci.v1);
|
||||||
for (; vf_it; ++vf_it)
|
for (; vf_it; ++vf_it)
|
||||||
if (!mesh_.status(vf_it).deleted())
|
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
|
// post-process collapse
|
||||||
this->postprocess_collapse(ci);
|
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);
|
typename Mesh::VertexFaceIter vf_it = mesh_.vf_iter(ci.v1);
|
||||||
for (; vf_it; ++vf_it)
|
for (; vf_it; ++vf_it)
|
||||||
if (!mesh_.status(vf_it).deleted())
|
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
|
// post-process collapse
|
||||||
this->postprocess_collapse(ci);
|
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);
|
typename Mesh::VertexFaceIter vf_it = mesh_.vf_iter(ci.v1);
|
||||||
for (; vf_it; ++vf_it)
|
for (; vf_it; ++vf_it)
|
||||||
if (!mesh_.status(vf_it).deleted())
|
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
|
// post-process collapse
|
||||||
this->postprocess_collapse(ci);
|
this->postprocess_collapse(ci);
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ void ModAspectRatioT<MeshT>::preprocess_collapse(const CollapseInfo& _ci) {
|
|||||||
typename Mesh::FVIter fv_it;
|
typename Mesh::FVIter fv_it;
|
||||||
|
|
||||||
for (typename Mesh::VFIter vf_it = mesh_.vf_iter(_ci.v0); vf_it; ++vf_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) {
|
if (fh != _ci.fl && fh != _ci.fr) {
|
||||||
typename Mesh::Point& p0 = mesh_.point(fv_it = mesh_.fv_iter(fh));
|
typename Mesh::Point& p0 = mesh_.point(fv_it = mesh_.fv_iter(fh));
|
||||||
typename Mesh::Point& p1 = mesh_.point(++fv_it);
|
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::Scalar r0, r1, r0_min(1.0), r1_min(1.0);
|
||||||
typename Mesh::CVVIter vv_it(mesh_, _ci.v0);
|
typename Mesh::CVVIter vv_it(mesh_, _ci.v0);
|
||||||
|
|
||||||
v3 = vv_it.handle();
|
v3 = *vv_it;
|
||||||
p3 = &mesh_.point(v3);
|
p3 = &mesh_.point(v3);
|
||||||
|
|
||||||
while (vv_it) {
|
while (vv_it) {
|
||||||
v2 = v3;
|
v2 = v3;
|
||||||
p2 = p3;
|
p2 = p3;
|
||||||
|
|
||||||
v3 = (++vv_it).handle();
|
v3 = *(++vv_it);
|
||||||
p3 = &mesh_.point(v3);
|
p3 = &mesh_.point(v3);
|
||||||
|
|
||||||
fh = mesh_.face_handle(vv_it.current_halfedge_handle());
|
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 points to be tested
|
||||||
// collect all faces to be tested against
|
// collect all faces to be tested against
|
||||||
for (vf_it=mesh_.vf_iter(_ci.v0); vf_it; ++vf_it) {
|
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)
|
if (fh != _ci.fl && fh != _ci.fr)
|
||||||
faces.push_back(fh);
|
faces.push_back(fh);
|
||||||
@@ -290,7 +290,7 @@ postprocess_collapse(const CollapseInfo& _ci)
|
|||||||
|
|
||||||
// collect active faces and their points
|
// collect active faces and their points
|
||||||
for (vf_it=mesh_.vf_iter(_ci.v1); vf_it; ++vf_it) {
|
for (vf_it=mesh_.vf_iter(_ci.v1); vf_it; ++vf_it) {
|
||||||
fh = vf_it.handle();
|
fh = *vf_it;
|
||||||
faces.push_back(fh);
|
faces.push_back(fh);
|
||||||
|
|
||||||
Points& pts = mesh_.property(points_, fh);
|
Points& pts = mesh_.property(points_, fh);
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ public:
|
|||||||
if (_ci.vrv0.is_valid()) fhr = mesh_.face_handle(_ci.vrv0);
|
if (_ci.vrv0.is_valid()) fhr = mesh_.face_handle(_ci.vrv0);
|
||||||
|
|
||||||
for (; vf_it; ++vf_it) {
|
for (; vf_it; ++vf_it) {
|
||||||
fh = vf_it.handle();
|
fh = *vf_it;
|
||||||
if (fh != _ci.fl && fh != _ci.fr) {
|
if (fh != _ci.fl && fh != _ci.fr) {
|
||||||
NormalCone nc = mesh_.property(normal_cones_, fh);
|
NormalCone nc = mesh_.property(normal_cones_, fh);
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public:
|
|||||||
|
|
||||||
for (; vf_it; ++vf_it)
|
for (; vf_it; ++vf_it)
|
||||||
{
|
{
|
||||||
fh = vf_it.handle();
|
fh = *vf_it;
|
||||||
if (fh != _ci.fl && fh != _ci.fr)
|
if (fh != _ci.fl && fh != _ci.fr)
|
||||||
{
|
{
|
||||||
typename Mesh::Normal n1 = Base::mesh().normal(fh);
|
typename Mesh::Normal n1 = Base::mesh().normal(fh);
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ write( const std::string& _ofname )
|
|||||||
for (; v_it != v_end; ++v_it)
|
for (; v_it != v_end; ++v_it)
|
||||||
if (!Base::mesh().status(v_it).deleted())
|
if (!Base::mesh().status(v_it).deleted())
|
||||||
{
|
{
|
||||||
vhandles[i] = v_it.handle();
|
vhandles[i] = *v_it;
|
||||||
Base::mesh().property( idx_, v_it ) = i;
|
Base::mesh().property( idx_, v_it ) = i;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,7 @@ write( const std::string& _ofname )
|
|||||||
{
|
{
|
||||||
if (!Base::mesh().status(f_it).deleted())
|
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 ) );
|
||||||
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)
|
for (; f_it != f_end; ++f_it)
|
||||||
{
|
{
|
||||||
fv_it = Base::mesh().fv_iter(f_it.handle());
|
fv_it = Base::mesh().fv_iter(*f_it);
|
||||||
vh0 = fv_it.handle(); ++fv_it;
|
vh0 = *fv_it; ++fv_it;
|
||||||
vh1 = fv_it.handle(); ++fv_it;
|
vh1 = *fv_it; ++fv_it;
|
||||||
vh2 = fv_it.handle();
|
vh2 = *fv_it;
|
||||||
|
|
||||||
Vec3 v0, v1, v2;
|
Vec3 v0, v1, v2;
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ PolyMesh_ArrayKernelT<MeshTraits>* MeshDual (PolyMesh_ArrayKernelT<MeshTraits> &
|
|||||||
typename PolyMesh_ArrayKernelT<MeshTraits>::Point centerPoint(0,0,0);
|
typename PolyMesh_ArrayKernelT<MeshTraits>::Point centerPoint(0,0,0);
|
||||||
unsigned int degree= 0;
|
unsigned int degree= 0;
|
||||||
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstFaceVertexIter vit=primal.cfv_iter(fit); vit; ++vit, ++degree)
|
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstFaceVertexIter vit=primal.cfv_iter(fit); vit; ++vit, ++degree)
|
||||||
centerPoint += primal.point(vit.handle());
|
centerPoint += primal.point(*vit);
|
||||||
assert(degree!=0);
|
assert(degree!=0);
|
||||||
centerPoint /= degree;
|
centerPoint /= degree;
|
||||||
primal.property(primalToDual, fit) = dual->add_vertex(centerPoint);
|
primal.property(primalToDual, fit) = dual->add_vertex(centerPoint);
|
||||||
@@ -111,7 +111,7 @@ PolyMesh_ArrayKernelT<MeshTraits>* MeshDual (PolyMesh_ArrayKernelT<MeshTraits> &
|
|||||||
std::vector< typename PolyMesh_ArrayKernelT<MeshTraits>::VertexHandle > face_vhandles;
|
std::vector< typename PolyMesh_ArrayKernelT<MeshTraits>::VertexHandle > face_vhandles;
|
||||||
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstVertexIter vit=primal.vertices_begin(); vit!=primal.vertices_end(); ++vit)
|
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstVertexIter vit=primal.vertices_begin(); vit!=primal.vertices_end(); ++vit)
|
||||||
{
|
{
|
||||||
if(!primal.is_boundary(vit.handle()))
|
if(!primal.is_boundary(*vit))
|
||||||
{
|
{
|
||||||
face_vhandles.clear();
|
face_vhandles.clear();
|
||||||
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstVertexFaceIter fit=primal.cvf_iter(vit); fit; ++fit)
|
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstVertexFaceIter fit=primal.cvf_iter(vit); fit; ++fit)
|
||||||
|
|||||||
@@ -151,8 +151,8 @@ compute_weights(LaplaceWeighting _weighting)
|
|||||||
{
|
{
|
||||||
for (e_it=Base::mesh_.edges_begin(); e_it!=e_end; ++e_it)
|
for (e_it=Base::mesh_.edges_begin(); e_it!=e_end; ++e_it)
|
||||||
{
|
{
|
||||||
heh0 = Base::mesh_.halfedge_handle(e_it.handle(), 0);
|
heh0 = Base::mesh_.halfedge_handle(*e_it, 0);
|
||||||
heh1 = Base::mesh_.halfedge_handle(e_it.handle(), 1);
|
heh1 = Base::mesh_.halfedge_handle(*e_it, 1);
|
||||||
v0 = Base::mesh_.to_vertex_handle(heh0);
|
v0 = Base::mesh_.to_vertex_handle(heh0);
|
||||||
v1 = Base::mesh_.to_vertex_handle(heh1);
|
v1 = Base::mesh_.to_vertex_handle(heh1);
|
||||||
|
|
||||||
@@ -172,11 +172,11 @@ compute_weights(LaplaceWeighting _weighting)
|
|||||||
{
|
{
|
||||||
weight = 0.0;
|
weight = 0.0;
|
||||||
|
|
||||||
heh0 = Base::mesh_.halfedge_handle(e_it.handle(), 0);
|
heh0 = Base::mesh_.halfedge_handle(*e_it, 0);
|
||||||
v0 = Base::mesh_.to_vertex_handle(heh0);
|
v0 = Base::mesh_.to_vertex_handle(heh0);
|
||||||
p0 = &Base::mesh_.point(v0);
|
p0 = &Base::mesh_.point(v0);
|
||||||
|
|
||||||
heh1 = Base::mesh_.halfedge_handle(e_it.handle(), 1);
|
heh1 = Base::mesh_.halfedge_handle(*e_it, 1);
|
||||||
v1 = Base::mesh_.to_vertex_handle(heh1);
|
v1 = Base::mesh_.to_vertex_handle(heh1);
|
||||||
p1 = &Base::mesh_.point(v1);
|
p1 = &Base::mesh_.point(v1);
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ compute_weights(LaplaceWeighting _weighting)
|
|||||||
d1 = (*p1 - *p2); d1.normalize();
|
d1 = (*p1 - *p2); d1.normalize();
|
||||||
weight += 1.0 / tan(acos(std::max(lb, std::min(ub, dot(d0,d1) ))));
|
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(edge_weights_, *e_it) = weight;
|
||||||
Base::mesh_.property(vertex_weights_, v0) += weight;
|
Base::mesh_.property(vertex_weights_, v0) += weight;
|
||||||
Base::mesh_.property(vertex_weights_, v1) += weight;
|
Base::mesh_.property(vertex_weights_, v1) += weight;
|
||||||
}
|
}
|
||||||
@@ -206,9 +206,9 @@ compute_weights(LaplaceWeighting _weighting)
|
|||||||
// after: one over sum of edge weights
|
// after: one over sum of edge weights
|
||||||
for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
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)
|
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_state(0);
|
||||||
mesh_.data(v_it).set_final();
|
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
|
// ---------------------------------------- Init Faces
|
||||||
@@ -203,7 +203,7 @@ void CompositeT<M>::refine(typename M::FaceHandle& _fh)
|
|||||||
|
|
||||||
for (; fh_it; ++fh_it)
|
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,13 +239,13 @@ public:
|
|||||||
|
|
||||||
for (fe_it = mesh_.fe_iter(_fh); fe_it; ++fe_it) {
|
for (fe_it = mesh_.fe_iter(_fh); fe_it; ++fe_it) {
|
||||||
|
|
||||||
eh = fe_it.handle();
|
eh = *fe_it;
|
||||||
prev_rule()->raise(eh, _target_state - 1);
|
prev_rule()->raise(eh, _target_state - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (fv_it = mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
|
for (fv_it = mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
|
||||||
|
|
||||||
vh = fv_it.handle();
|
vh = *fv_it;
|
||||||
prev_rule()->raise(vh, _target_state - 1);
|
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
|
// raise all adjacent vertices to level x-1
|
||||||
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
|
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()) {
|
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
|
// raise all adjacent vertices to level x-1
|
||||||
for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
|
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()) {
|
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) {
|
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()) {
|
while (!vertex_vector.empty()) {
|
||||||
@@ -883,7 +883,7 @@ void FF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
|
|||||||
|
|
||||||
for (ff_it = Base::mesh_.ff_iter(_fh); ff_it; ++ff_it) {
|
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()) {
|
while (!face_vector.empty()) {
|
||||||
@@ -896,7 +896,7 @@ void FF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
|
|||||||
|
|
||||||
for (ff_it = Base::mesh_.ff_iter(_fh); ff_it; ++ff_it) {
|
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()) {
|
while (!face_vector.empty()) {
|
||||||
@@ -946,7 +946,7 @@ void FFc<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
|
|||||||
if (_target_state > 1)
|
if (_target_state > 1)
|
||||||
{
|
{
|
||||||
for (; ff_it; ++ff_it)
|
for (; ff_it; ++ff_it)
|
||||||
face_vector.push_back(ff_it.handle());
|
face_vector.push_back(*ff_it);
|
||||||
|
|
||||||
while (!face_vector.empty())
|
while (!face_vector.empty())
|
||||||
{
|
{
|
||||||
@@ -956,7 +956,7 @@ void FFc<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (ff_it = Base::mesh_.ff_iter(_fh); ff_it; ++ff_it)
|
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()) {
|
while (!face_vector.empty()) {
|
||||||
|
|
||||||
@@ -1012,7 +1012,7 @@ void FV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
|
|
||||||
for (; vf_it; ++vf_it) {
|
for (; vf_it; ++vf_it) {
|
||||||
|
|
||||||
face_vector.push_back(vf_it.handle());
|
face_vector.push_back(*vf_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!face_vector.empty()) {
|
while (!face_vector.empty()) {
|
||||||
@@ -1025,7 +1025,7 @@ void FV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
|
|
||||||
for (vf_it = Base::mesh_.vf_iter(_vh); vf_it; ++vf_it) {
|
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()) {
|
while (!face_vector.empty()) {
|
||||||
@@ -1595,7 +1595,7 @@ void EV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
|
|
||||||
for (; ve_it; ++ve_it) {
|
for (; ve_it; ++ve_it) {
|
||||||
|
|
||||||
edge_vector.push_back(ve_it.handle());
|
edge_vector.push_back(*ve_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!edge_vector.empty()) {
|
while (!edge_vector.empty()) {
|
||||||
@@ -1608,7 +1608,7 @@ void EV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
|
|
||||||
for (ve_it = Base::mesh_.ve_iter(_vh); ve_it; ++ve_it) {
|
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()) {
|
while (!edge_vector.empty()) {
|
||||||
@@ -1793,7 +1793,7 @@ EF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
|
|||||||
|
|
||||||
for (; fe_it; ++fe_it) {
|
for (; fe_it; ++fe_it) {
|
||||||
|
|
||||||
edge_vector.push_back(fe_it.handle());
|
edge_vector.push_back(*fe_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!edge_vector.empty()) {
|
while (!edge_vector.empty()) {
|
||||||
@@ -1806,7 +1806,7 @@ EF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
|
|||||||
|
|
||||||
for (fe_it = Base::mesh_.fe_iter(_fh); fe_it; ++fe_it) {
|
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()) {
|
while (!edge_vector.empty()) {
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ CatmullClarkT< MeshType, RealType >::prepare( MeshType& _m )
|
|||||||
|
|
||||||
// initialize all weights to 0 (= smooth edge)
|
// initialize all weights to 0 (= smooth edge)
|
||||||
for( EdgeIter e_it = _m.edges_begin(); e_it != _m.edges_end(); ++e_it)
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -105,21 +105,21 @@ CatmullClarkT<MeshType,RealType>::subdivide( MeshType& _m , size_t _n , const bo
|
|||||||
for ( ; f_itr != f_end; ++f_itr)
|
for ( ; f_itr != f_end; ++f_itr)
|
||||||
{
|
{
|
||||||
Point centroid;
|
Point centroid;
|
||||||
_m.calc_face_centroid( f_itr.handle(), centroid);
|
_m.calc_face_centroid( *f_itr, centroid);
|
||||||
_m.property( fp_pos_, f_itr.handle() ) = centroid;
|
_m.property( fp_pos_, *f_itr ) = centroid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute position for new (edge-) vertices and store them in the edge property
|
// Compute position for new (edge-) vertices and store them in the edge property
|
||||||
EdgeIter e_itr = _m.edges_begin();
|
EdgeIter e_itr = _m.edges_begin();
|
||||||
EdgeIter e_end = _m.edges_end();
|
EdgeIter e_end = _m.edges_end();
|
||||||
for ( ; e_itr != e_end; ++e_itr)
|
for ( ; e_itr != e_end; ++e_itr)
|
||||||
compute_midpoint( _m, e_itr.handle() );
|
compute_midpoint( _m, *e_itr );
|
||||||
|
|
||||||
// compute new positions for old vertices
|
// compute new positions for old vertices
|
||||||
VertexIter v_itr = _m.vertices_begin();
|
VertexIter v_itr = _m.vertices_begin();
|
||||||
VertexIter v_end = _m.vertices_end();
|
VertexIter v_end = _m.vertices_end();
|
||||||
for ( ; v_itr != v_end; ++v_itr)
|
for ( ; v_itr != v_end; ++v_itr)
|
||||||
update_vertex( _m, v_itr.handle() );
|
update_vertex( _m, *v_itr );
|
||||||
|
|
||||||
// Commit changes in geometry
|
// Commit changes in geometry
|
||||||
v_itr = _m.vertices_begin();
|
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.
|
// Attention! Creating new edges, hence make sure the loop ends correctly.
|
||||||
e_itr = _m.edges_begin();
|
e_itr = _m.edges_begin();
|
||||||
for ( ; e_itr != e_end; ++e_itr)
|
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
|
// Commit changes in topology and reconsitute consistency
|
||||||
// Attention! Creating new faces, hence make sure the loop ends correctly.
|
// Attention! Creating new faces, hence make sure the loop ends correctly.
|
||||||
f_itr = _m.faces_begin();
|
f_itr = _m.faces_begin();
|
||||||
for ( ; f_itr != f_end; ++f_itr)
|
for ( ; f_itr != f_end; ++f_itr)
|
||||||
split_face( _m, f_itr.handle());
|
split_face( _m, *f_itr);
|
||||||
|
|
||||||
|
|
||||||
#if defined(_DEBUG) || defined(DEBUG)
|
#if defined(_DEBUG) || defined(DEBUG)
|
||||||
@@ -333,8 +333,8 @@ CatmullClarkT<MeshType,RealType>::update_vertex( MeshType& _m, const VertexHandl
|
|||||||
pos = _m.point(_vh);
|
pos = _m.point(_vh);
|
||||||
VertexEdgeIter ve_itr;
|
VertexEdgeIter ve_itr;
|
||||||
for ( ve_itr = _m.ve_iter( _vh); ve_itr; ++ve_itr)
|
for ( ve_itr = _m.ve_iter( _vh); ve_itr; ++ve_itr)
|
||||||
if ( _m.is_boundary( ve_itr.handle()))
|
if ( _m.is_boundary( *ve_itr))
|
||||||
pos += _m.property( ep_pos_, ve_itr.handle());
|
pos += _m.property( ep_pos_, *ve_itr);
|
||||||
pos /= 3.0;
|
pos /= 3.0;
|
||||||
}
|
}
|
||||||
else // inner vertex
|
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)
|
for ( ve_itr = _m.ve_iter( _vh); ve_itr; ++ve_itr)
|
||||||
{
|
{
|
||||||
valence+=1.0;
|
valence+=1.0;
|
||||||
pos += _m.property(ep_pos_, ve_itr.handle());
|
pos += _m.property(ep_pos_, *ve_itr);
|
||||||
}
|
}
|
||||||
pos /= valence*valence;
|
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 )
|
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;
|
Q /= valence*valence;//neigboring_faces;
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ bool CompositeT<MeshType,RealType>::prepare( MeshType& _m )
|
|||||||
typename MeshType::VertexIter v_it(_m.vertices_begin());
|
typename MeshType::VertexIter v_it(_m.vertices_begin());
|
||||||
|
|
||||||
for (; v_it != _m.vertices_end(); ++v_it)
|
for (; v_it != _m.vertices_end(); ++v_it)
|
||||||
_m.data(v_it).set_position(_m.point(v_it.handle()));
|
_m.data(v_it).set_position(_m.point(*v_it()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ void CompositeT<MeshType,RealType>::Tvv3()
|
|||||||
|
|
||||||
mesh_.data(vh).set_position(zero_point);
|
mesh_.data(vh).set_position(zero_point);
|
||||||
|
|
||||||
mesh_.split(f_it.handle(), vh);
|
mesh_.split(*f_it(), vh);
|
||||||
|
|
||||||
++f_it;
|
++f_it;
|
||||||
}
|
}
|
||||||
@@ -132,10 +132,10 @@ void CompositeT<MeshType,RealType>::Tvv3()
|
|||||||
|
|
||||||
e_it = mesh_.edges_begin();
|
e_it = mesh_.edges_begin();
|
||||||
for (j = 0; j < n_edges; ++j) {
|
for (j = 0; j < n_edges; ++j) {
|
||||||
if (mesh_.is_flip_ok(e_it.handle())) {
|
if (mesh_.is_flip_ok(*e_it())) {
|
||||||
mesh_.flip(e_it.handle());
|
mesh_.flip(*e_it());
|
||||||
} else {
|
} else {
|
||||||
edge_vector.push_back(e_it.handle());
|
edge_vector.push_back(*e_it());
|
||||||
}
|
}
|
||||||
++e_it;
|
++e_it;
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ void CompositeT<MeshType,RealType>::Tvv4()
|
|||||||
e_it = mesh_.edges_begin();
|
e_it = mesh_.edges_begin();
|
||||||
for (j = 0; j < n_edges; ++j) {
|
for (j = 0; j < n_edges; ++j) {
|
||||||
|
|
||||||
vh = split_edge(mesh_.halfedge_handle(e_it.handle(), 0));
|
vh = split_edge(mesh_.halfedge_handle(*e_it(), 0));
|
||||||
mesh_.data(vh).set_position(zero_point);
|
mesh_.data(vh).set_position(zero_point);
|
||||||
|
|
||||||
++e_it;
|
++e_it;
|
||||||
@@ -190,7 +190,7 @@ void CompositeT<MeshType,RealType>::Tvv4()
|
|||||||
// Corner Cutting of Each Face
|
// Corner Cutting of Each Face
|
||||||
f_it = mesh_.faces_begin();
|
f_it = mesh_.faces_begin();
|
||||||
for (j = 0; j < n_faces; ++j) {
|
for (j = 0; j < n_faces; ++j) {
|
||||||
typename MeshType::HalfedgeHandle heh1(mesh_.halfedge_handle(f_it.handle()));
|
typename MeshType::HalfedgeHandle heh1(mesh_.halfedge_handle(*f_it()));
|
||||||
typename MeshType::HalfedgeHandle heh2(mesh_.next_halfedge_handle(mesh_.next_halfedge_handle(heh1)));
|
typename MeshType::HalfedgeHandle heh2(mesh_.next_halfedge_handle(mesh_.next_halfedge_handle(heh1)));
|
||||||
typename MeshType::HalfedgeHandle heh3(mesh_.next_halfedge_handle(mesh_.next_halfedge_handle(heh2)));
|
typename MeshType::HalfedgeHandle heh3(mesh_.next_halfedge_handle(mesh_.next_halfedge_handle(heh2)));
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ void CompositeT<MeshType,RealType>::Tfv()
|
|||||||
for (j = 0; j < n_vertices; ++j) {
|
for (j = 0; j < n_vertices; ++j) {
|
||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
for (vf_it = mesh_.vf_iter(v_it.handle()); vf_it; ++vf_it) {
|
for (vf_it = mesh_.vf_iter(*v_it); vf_it; ++vf_it) {
|
||||||
++valence;
|
++valence;
|
||||||
cog += vf_it->position();
|
cog += vf_it->position();
|
||||||
}
|
}
|
||||||
@@ -251,13 +251,13 @@ void CompositeT<MeshType,RealType>::Tfv()
|
|||||||
|
|
||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
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) {
|
||||||
++valence;
|
++valence;
|
||||||
cog += ff_it->position();
|
cog += ff_it->position();
|
||||||
}
|
}
|
||||||
cog /= valence;
|
cog /= valence;
|
||||||
|
|
||||||
mesh_.split(f_it.handle(), vh);
|
mesh_.split(*f_it(), vh);
|
||||||
|
|
||||||
for (vf_it = mesh_.vf_iter(vh); vf_it; ++vf_it) {
|
for (vf_it = mesh_.vf_iter(vh); vf_it; ++vf_it) {
|
||||||
vf_it->set_position(f_it->position());
|
vf_it->set_position(f_it->position());
|
||||||
@@ -273,8 +273,8 @@ void CompositeT<MeshType,RealType>::Tfv()
|
|||||||
// Flip each old edge
|
// Flip each old edge
|
||||||
e_it = mesh_.edges_begin();
|
e_it = mesh_.edges_begin();
|
||||||
for (j = 0; j < n_edges; ++j) {
|
for (j = 0; j < n_edges; ++j) {
|
||||||
if (mesh_.is_flip_ok(e_it.handle()))
|
if (mesh_.is_flip_ok(*e_it()))
|
||||||
mesh_.flip(e_it.handle());
|
mesh_.flip(*e_it());
|
||||||
++e_it;
|
++e_it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,7 +297,7 @@ void CompositeT<MeshType,RealType>::VF()
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it.is_valid(); ++fv_it) {
|
for (fv_it = mesh_.fv_iter(*f_it()); fv_it.is_valid(); ++fv_it) {
|
||||||
cog += mesh_.data(fv_it).position();
|
cog += mesh_.data(fv_it).position();
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
@@ -324,7 +324,7 @@ void CompositeT<MeshType,RealType>::VFa(Coeff& _coeff)
|
|||||||
|
|
||||||
for (f_it = mesh_.faces_begin(); f_it != mesh_.faces_end(); ++f_it) {
|
for (f_it = mesh_.faces_begin(); f_it != mesh_.faces_end(); ++f_it) {
|
||||||
|
|
||||||
heh = mesh_.halfedge_handle(f_it.handle());
|
heh = mesh_.halfedge_handle(*f_it());
|
||||||
for (i = 0; i <= 2; ++i) {
|
for (i = 0; i <= 2; ++i) {
|
||||||
|
|
||||||
valence[i] = 0;
|
valence[i] = 0;
|
||||||
@@ -352,8 +352,8 @@ void CompositeT<MeshType,RealType>::VFa(Coeff& _coeff)
|
|||||||
|
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it.is_valid(); ++fv_it) {
|
for (fv_it = mesh_.fv_iter(*f_it()); fv_it.is_valid(); ++fv_it) {
|
||||||
if (fv_it.handle() == vh[i]) {
|
if (*fv_it == vh[i]) {
|
||||||
cog += fv_it->position() * alpha;
|
cog += fv_it->position() * alpha;
|
||||||
} else {
|
} else {
|
||||||
cog += fv_it->position() * (1.0 - alpha) / 2.0;
|
cog += fv_it->position() * (1.0 - alpha) / 2.0;
|
||||||
@@ -381,7 +381,7 @@ void CompositeT<MeshType,RealType>::VFa(scalar_t _alpha)
|
|||||||
|
|
||||||
for (f_it = mesh_.faces_begin(); f_it != mesh_.faces_end(); ++f_it) {
|
for (f_it = mesh_.faces_begin(); f_it != mesh_.faces_end(); ++f_it) {
|
||||||
|
|
||||||
heh = mesh_.halfedge_handle(f_it.handle());
|
heh = mesh_.halfedge_handle(*f_it());
|
||||||
for (i = 0; i <= 2; ++i) {
|
for (i = 0; i <= 2; ++i) {
|
||||||
|
|
||||||
valence[i] = 0;
|
valence[i] = 0;
|
||||||
@@ -407,8 +407,8 @@ void CompositeT<MeshType,RealType>::VFa(scalar_t _alpha)
|
|||||||
|
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it.is_valid(); ++fv_it) {
|
for (fv_it = mesh_.fv_iter(*f_it()); fv_it.is_valid(); ++fv_it) {
|
||||||
if (fv_it.handle() == vh[i]) {
|
if (*fv_it == vh[i]) {
|
||||||
cog += fv_it->position() * _alpha;
|
cog += fv_it->position() * _alpha;
|
||||||
} else {
|
} else {
|
||||||
cog += fv_it->position() * (1.0 - _alpha) / 2.0;
|
cog += fv_it->position() * (1.0 - _alpha) / 2.0;
|
||||||
@@ -439,7 +439,7 @@ void CompositeT<MeshType,RealType>::FF()
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
cog += mesh_.data(ff_it).position();
|
cog += mesh_.data(ff_it).position();
|
||||||
++valence;
|
++valence;
|
||||||
@@ -475,7 +475,7 @@ void CompositeT<MeshType,RealType>::FFc(Coeff& _coeff)
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
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) {
|
||||||
cog += ff_it->position();
|
cog += ff_it->position();
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
@@ -515,7 +515,7 @@ void CompositeT<MeshType,RealType>::FFc(scalar_t _c)
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
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) {
|
||||||
cog += ff_it->position();
|
cog += ff_it->position();
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
@@ -551,7 +551,7 @@ void CompositeT<MeshType,RealType>::FV()
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (vf_it = mesh_.vf_iter(v_it.handle()); vf_it; ++vf_it) {
|
for (vf_it = mesh_.vf_iter(*v_it); vf_it; ++vf_it) {
|
||||||
cog += vf_it->position();
|
cog += vf_it->position();
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
@@ -578,13 +578,13 @@ void CompositeT<MeshType,RealType>::FVc(Coeff& _coeff)
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
|
for (voh_it = mesh_.voh_iter(*v_it()); voh_it; ++voh_it) {
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
|
|
||||||
c = _coeff(valence);
|
c = _coeff(valence);
|
||||||
|
|
||||||
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
|
for (voh_it = mesh_.voh_iter(*v_it()); voh_it; ++voh_it) {
|
||||||
|
|
||||||
if (mesh_.face_handle(*voh_it).is_valid()) {
|
if (mesh_.face_handle(*voh_it).is_valid()) {
|
||||||
|
|
||||||
@@ -623,11 +623,11 @@ void CompositeT<MeshType,RealType>::FVc(scalar_t _c)
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
|
for (voh_it = mesh_.voh_iter(*v_it()); voh_it; ++voh_it) {
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
|
for (voh_it = mesh_.voh_iter(*v_it()); voh_it; ++voh_it) {
|
||||||
|
|
||||||
if (mesh_.face_handle(*voh_it).is_valid()) {
|
if (mesh_.face_handle(*voh_it).is_valid()) {
|
||||||
|
|
||||||
@@ -666,7 +666,7 @@ void CompositeT<MeshType,RealType>::VdE()
|
|||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
valence = 2;
|
valence = 2;
|
||||||
|
|
||||||
heh1 = mesh_.halfedge_handle(e_it.handle(), 0);
|
heh1 = mesh_.halfedge_handle(*e_it(), 0);
|
||||||
heh2 = mesh_.opposite_halfedge_handle(heh1);
|
heh2 = mesh_.opposite_halfedge_handle(heh1);
|
||||||
cog += mesh_.data(mesh_.to_vertex_handle(heh1)).position();
|
cog += mesh_.data(mesh_.to_vertex_handle(heh1)).position();
|
||||||
cog += mesh_.data(mesh_.to_vertex_handle(heh2)).position();
|
cog += mesh_.data(mesh_.to_vertex_handle(heh2)).position();
|
||||||
@@ -704,7 +704,7 @@ void CompositeT<MeshType,RealType>::VdEc(scalar_t _c)
|
|||||||
|
|
||||||
for (int i = 0; i <= 1; ++i) {
|
for (int i = 0; i <= 1; ++i) {
|
||||||
|
|
||||||
heh = mesh_.halfedge_handle(e_it.handle(), i);
|
heh = mesh_.halfedge_handle(*e_it(), i);
|
||||||
if (!mesh_.is_boundary(heh))
|
if (!mesh_.is_boundary(heh))
|
||||||
{
|
{
|
||||||
cog += mesh_.point(mesh_.to_vertex_handle(mesh_.next_halfedge_handle(heh))) * (0.5 - _c);
|
cog += mesh_.point(mesh_.to_vertex_handle(mesh_.next_halfedge_handle(heh))) * (0.5 - _c);
|
||||||
@@ -739,7 +739,7 @@ void CompositeT<MeshType,RealType>::VdEg(scalar_t _gamma)
|
|||||||
|
|
||||||
for (i = 0; i <= 1; ++i)
|
for (i = 0; i <= 1; ++i)
|
||||||
{
|
{
|
||||||
heh = mesh_.halfedge_handle(e_it.handle(), i);
|
heh = mesh_.halfedge_handle(*e_it(), i);
|
||||||
valence[i] = 0;
|
valence[i] = 0;
|
||||||
|
|
||||||
// look for lowest valence vertex
|
// look for lowest valence vertex
|
||||||
@@ -754,7 +754,7 @@ void CompositeT<MeshType,RealType>::VdEg(scalar_t _gamma)
|
|||||||
else
|
else
|
||||||
i = 1;
|
i = 1;
|
||||||
|
|
||||||
heh = mesh_.halfedge_handle(e_it.handle(), i);
|
heh = mesh_.halfedge_handle(*e_it(), i);
|
||||||
|
|
||||||
if (!mesh_.is_boundary(heh)) {
|
if (!mesh_.is_boundary(heh)) {
|
||||||
cog += mesh_.point(mesh_.to_vertex_handle(mesh_.next_halfedge_handle(heh))) * (_gamma);
|
cog += mesh_.point(mesh_.to_vertex_handle(mesh_.next_halfedge_handle(heh))) * (_gamma);
|
||||||
@@ -764,7 +764,7 @@ void CompositeT<MeshType,RealType>::VdEg(scalar_t _gamma)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
heh = mesh_.halfedge_handle(e_it.handle(), 1-i);
|
heh = mesh_.halfedge_handle(*e_it(), 1-i);
|
||||||
|
|
||||||
if (!mesh_.is_boundary(heh))
|
if (!mesh_.is_boundary(heh))
|
||||||
{
|
{
|
||||||
@@ -800,7 +800,7 @@ void CompositeT<MeshType,RealType>::VdEg(Coeff& _coeff)
|
|||||||
|
|
||||||
for (i = 0; i <= 1; ++i) {
|
for (i = 0; i <= 1; ++i) {
|
||||||
|
|
||||||
heh = mesh_.halfedge_handle(e_it.handle(), i);
|
heh = mesh_.halfedge_handle(*e_it(), i);
|
||||||
valence[i] = 0;
|
valence[i] = 0;
|
||||||
|
|
||||||
// look for lowest valence vertex
|
// look for lowest valence vertex
|
||||||
@@ -817,7 +817,7 @@ void CompositeT<MeshType,RealType>::VdEg(Coeff& _coeff)
|
|||||||
|
|
||||||
gamma = _coeff(valence[i]);
|
gamma = _coeff(valence[i]);
|
||||||
|
|
||||||
heh = mesh_.halfedge_handle(e_it.handle(), i);
|
heh = mesh_.halfedge_handle(*e_it(), i);
|
||||||
|
|
||||||
if (!mesh_.is_boundary(heh))
|
if (!mesh_.is_boundary(heh))
|
||||||
{
|
{
|
||||||
@@ -830,7 +830,7 @@ void CompositeT<MeshType,RealType>::VdEg(Coeff& _coeff)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
heh = mesh_.halfedge_handle(e_it.handle(), 1-i);
|
heh = mesh_.halfedge_handle(*e_it(), 1-i);
|
||||||
|
|
||||||
if (!mesh_.is_boundary(heh)) {
|
if (!mesh_.is_boundary(heh)) {
|
||||||
cog += mesh_.point(mesh_.to_vertex_handle(mesh_.next_halfedge_handle(heh))) * (gamma);
|
cog += mesh_.point(mesh_.to_vertex_handle(mesh_.next_halfedge_handle(heh))) * (gamma);
|
||||||
@@ -860,7 +860,7 @@ void CompositeT<MeshType,RealType>::EV()
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (ve_it = mesh_.ve_iter(v_it.handle()); ve_it; ++ve_it) {
|
for (ve_it = mesh_.ve_iter(*v_it()); ve_it; ++ve_it) {
|
||||||
cog += mesh_.data(ve_it).position();
|
cog += mesh_.data(ve_it).position();
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
@@ -889,14 +889,14 @@ void CompositeT<MeshType,RealType>::EVc(Coeff& _coeff)
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it)
|
for (voh_it = mesh_.voh_iter(*v_it()); voh_it; ++voh_it)
|
||||||
{
|
{
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
|
|
||||||
c = _coeff(valence);
|
c = _coeff(valence);
|
||||||
|
|
||||||
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
|
for (voh_it = mesh_.voh_iter(*v_it()); voh_it; ++voh_it) {
|
||||||
cog += mesh_.data(mesh_.edge_handle(*voh_it)).position() * 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 += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(*voh_it))).position() * (1.0 - c);
|
||||||
}
|
}
|
||||||
@@ -922,11 +922,11 @@ void CompositeT<MeshType,RealType>::EVc(scalar_t _c)
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
|
for (voh_it = mesh_.voh_iter(*v_it()); voh_it; ++voh_it) {
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
|
for (voh_it = mesh_.voh_iter(*v_it()); voh_it; ++voh_it) {
|
||||||
cog += mesh_.data(mesh_.edge_handle(*voh_it)).position() * _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 += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(*voh_it))).position() * (1.0 - _c);
|
||||||
}
|
}
|
||||||
@@ -953,7 +953,7 @@ void CompositeT<MeshType,RealType>::EF()
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (fe_it = mesh_.fe_iter(f_it.handle()); fe_it; ++fe_it) {
|
for (fe_it = mesh_.fe_iter(*f_it()); fe_it; ++fe_it) {
|
||||||
++valence;
|
++valence;
|
||||||
cog += mesh_.data(fe_it).position();
|
cog += mesh_.data(fe_it).position();
|
||||||
}
|
}
|
||||||
@@ -978,13 +978,13 @@ void CompositeT<MeshType,RealType>::FE()
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
if (mesh_.face_handle(mesh_.halfedge_handle(e_it.handle(), 0)).is_valid()) {
|
if (mesh_.face_handle(mesh_.halfedge_handle(*e_it(), 0)).is_valid()) {
|
||||||
cog += mesh_.data(mesh_.face_handle(mesh_.halfedge_handle(e_it.handle(), 0))).position();
|
cog += mesh_.data(mesh_.face_handle(mesh_.halfedge_handle(*e_it(), 0))).position();
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mesh_.face_handle(mesh_.halfedge_handle(e_it.handle(), 1)).is_valid()) {
|
if (mesh_.face_handle(mesh_.halfedge_handle(*e_it(), 1)).is_valid()) {
|
||||||
cog += mesh_.data(mesh_.face_handle(mesh_.halfedge_handle(e_it.handle(), 1))).position();
|
cog += mesh_.data(mesh_.face_handle(mesh_.halfedge_handle(*e_it(), 1))).position();
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1004,8 +1004,8 @@ void CompositeT<MeshType,RealType>::VE()
|
|||||||
|
|
||||||
for (e_it = mesh_.edges_begin(); e_it != mesh_.edges_end(); ++e_it)
|
for (e_it = mesh_.edges_begin(); e_it != mesh_.edges_end(); ++e_it)
|
||||||
{
|
{
|
||||||
cog = mesh_.data(mesh_.to_vertex_handle(mesh_.halfedge_handle(e_it.handle(), 0))).position();
|
cog = mesh_.data(mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it(), 0))).position();
|
||||||
cog += mesh_.data(mesh_.to_vertex_handle(mesh_.halfedge_handle(e_it.handle(), 1))).position();
|
cog += mesh_.data(mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it(), 1))).position();
|
||||||
cog /= 2.0;
|
cog /= 2.0;
|
||||||
mesh_.data(e_it).set_position(cog);
|
mesh_.data(e_it).set_position(cog);
|
||||||
}
|
}
|
||||||
@@ -1031,7 +1031,7 @@ void CompositeT<MeshType,RealType>::VV()
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (vv_it = mesh_.vv_iter(v_it.handle()); vv_it; ++vv_it) {
|
for (vv_it = mesh_.vv_iter(*v_it()); vv_it; ++vv_it) {
|
||||||
cog += vv_it->position();
|
cog += vv_it->position();
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
@@ -1066,7 +1066,7 @@ void CompositeT<MeshType,RealType>::VVc(Coeff& _coeff)
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (vv_it = mesh_.vv_iter(v_it.handle()); vv_it; ++vv_it)
|
for (vv_it = mesh_.vv_iter(*v_it()); vv_it; ++vv_it)
|
||||||
{
|
{
|
||||||
cog += vv_it->position();
|
cog += vv_it->position();
|
||||||
++valence;
|
++valence;
|
||||||
@@ -1102,7 +1102,7 @@ void CompositeT<MeshType,RealType>::VVc(scalar_t _c)
|
|||||||
valence = 0;
|
valence = 0;
|
||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (vv_it = mesh_.vv_iter(v_it.handle()); vv_it; ++vv_it) {
|
for (vv_it = mesh_.vv_iter(*v_it()); vv_it; ++vv_it) {
|
||||||
cog += mesh_.data(vv_it).position();
|
cog += mesh_.data(vv_it).position();
|
||||||
++valence;
|
++valence;
|
||||||
}
|
}
|
||||||
@@ -1143,7 +1143,7 @@ void CompositeT<MeshType,RealType>::EdE()
|
|||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (int i = 0; i <= 1; ++i) {
|
for (int i = 0; i <= 1; ++i) {
|
||||||
heh = mesh_.halfedge_handle(e_it.handle(), i);
|
heh = mesh_.halfedge_handle(*e_it(), i);
|
||||||
if (mesh_.face_handle(heh).is_valid())
|
if (mesh_.face_handle(heh).is_valid())
|
||||||
{
|
{
|
||||||
cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(heh))).position();
|
cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(heh))).position();
|
||||||
@@ -1186,7 +1186,7 @@ void CompositeT<MeshType,RealType>::EdEc(scalar_t _c)
|
|||||||
cog = zero_point;
|
cog = zero_point;
|
||||||
|
|
||||||
for (int i = 0; i <= 1; ++i) {
|
for (int i = 0; i <= 1; ++i) {
|
||||||
heh = mesh_.halfedge_handle(e_it.handle(), i);
|
heh = mesh_.halfedge_handle(*e_it(), i);
|
||||||
if (mesh_.face_handle(heh).is_valid())
|
if (mesh_.face_handle(heh).is_valid())
|
||||||
{
|
{
|
||||||
cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(heh))).position() * (1.0 - _c);
|
cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(heh))).position() * (1.0 - _c);
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ protected:
|
|||||||
typename MeshType::VertexIter v_it;
|
typename MeshType::VertexIter v_it;
|
||||||
|
|
||||||
for (v_it=_m.vertices_begin(); v_it != _m.vertices_end(); ++v_it)
|
for (v_it=_m.vertices_begin(); v_it != _m.vertices_end(); ++v_it)
|
||||||
_m.set_point(v_it.handle(), _m.data(v_it).position());
|
_m.set_point(*v_it, _m.data(v_it).position());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ protected:
|
|||||||
|
|
||||||
// Only push the edges that need to be split
|
// Only push the edges that need to be split
|
||||||
if ( length > max_edge_length_squared_ )
|
if ( length > max_edge_length_squared_ )
|
||||||
queue.push( queueElement(eit.handle(),length) );
|
queue.push( queueElement(*eit,length) );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool stop = false;
|
bool stop = false;
|
||||||
|
|||||||
@@ -159,13 +159,13 @@ protected:
|
|||||||
if(_update_points) {
|
if(_update_points) {
|
||||||
// compute new positions for old vertices
|
// compute new positions for old vertices
|
||||||
for (vit = _m.vertices_begin(); vit != _m.vertices_end(); ++vit) {
|
for (vit = _m.vertices_begin(); vit != _m.vertices_end(); ++vit) {
|
||||||
smooth(_m, vit.handle());
|
smooth(_m, *vit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute position for new vertices and store them in the edge property
|
// Compute position for new vertices and store them in the edge property
|
||||||
for (eit=_m.edges_begin(); eit != _m.edges_end(); ++eit)
|
for (eit=_m.edges_begin(); eit != _m.edges_end(); ++eit)
|
||||||
compute_midpoint( _m, eit.handle() );
|
compute_midpoint( _m, *eit );
|
||||||
|
|
||||||
// Split each edge at midpoint and store precomputed positions (stored in
|
// Split each edge at midpoint and store precomputed positions (stored in
|
||||||
// edge property ep_pos_) in the vertex property vp_pos_;
|
// edge property ep_pos_) in the vertex property vp_pos_;
|
||||||
@@ -173,7 +173,7 @@ protected:
|
|||||||
// Attention! Creating new edges, hence make sure the loop ends correctly.
|
// Attention! Creating new edges, hence make sure the loop ends correctly.
|
||||||
e_end = _m.edges_end();
|
e_end = _m.edges_end();
|
||||||
for (eit=_m.edges_begin(); eit != e_end; ++eit)
|
for (eit=_m.edges_begin(); eit != e_end; ++eit)
|
||||||
split_edge(_m, eit.handle() );
|
split_edge(_m, *eit );
|
||||||
|
|
||||||
|
|
||||||
// Commit changes in topology and reconsitute consistency
|
// Commit changes in topology and reconsitute consistency
|
||||||
@@ -181,7 +181,7 @@ protected:
|
|||||||
// Attention! Creating new faces, hence make sure the loop ends correctly.
|
// Attention! Creating new faces, hence make sure the loop ends correctly.
|
||||||
f_end = _m.faces_end();
|
f_end = _m.faces_end();
|
||||||
for (fit = _m.faces_begin(); fit != f_end; ++fit)
|
for (fit = _m.faces_begin(); fit != f_end; ++fit)
|
||||||
split_face(_m, fit.handle() );
|
split_face(_m, *fit );
|
||||||
|
|
||||||
if(_update_points) {
|
if(_update_points) {
|
||||||
// Commit changes in geometry
|
// Commit changes in geometry
|
||||||
|
|||||||
@@ -190,11 +190,11 @@ protected:
|
|||||||
// This is an interpolating scheme, old vertices remain the same.
|
// This is an interpolating scheme, old vertices remain the same.
|
||||||
typename mesh_t::VertexIter initialVerticesEnd = _m.vertices_end();
|
typename mesh_t::VertexIter initialVerticesEnd = _m.vertices_end();
|
||||||
for ( vit = _m.vertices_begin(); vit != initialVerticesEnd; ++vit)
|
for ( vit = _m.vertices_begin(); vit != initialVerticesEnd; ++vit)
|
||||||
_m.property( vp_pos_, vit.handle() ) = _m.point(vit.handle());
|
_m.property( vp_pos_, *vit ) = _m.point(*vit);
|
||||||
|
|
||||||
// Compute position for new vertices and store them in the edge property
|
// Compute position for new vertices and store them in the edge property
|
||||||
for (eit=_m.edges_begin(); eit != _m.edges_end(); ++eit)
|
for (eit=_m.edges_begin(); eit != _m.edges_end(); ++eit)
|
||||||
compute_midpoint( _m, eit.handle() );
|
compute_midpoint( _m, *eit );
|
||||||
|
|
||||||
|
|
||||||
// Split each edge at midpoint and store precomputed positions (stored in
|
// Split each edge at midpoint and store precomputed positions (stored in
|
||||||
@@ -203,7 +203,7 @@ protected:
|
|||||||
// Attention! Creating new edges, hence make sure the loop ends correctly.
|
// Attention! Creating new edges, hence make sure the loop ends correctly.
|
||||||
e_end = _m.edges_end();
|
e_end = _m.edges_end();
|
||||||
for (eit=_m.edges_begin(); eit != e_end; ++eit)
|
for (eit=_m.edges_begin(); eit != e_end; ++eit)
|
||||||
split_edge(_m, eit.handle() );
|
split_edge(_m, *eit );
|
||||||
|
|
||||||
|
|
||||||
// Commit changes in topology and reconsitute consistency
|
// Commit changes in topology and reconsitute consistency
|
||||||
@@ -211,7 +211,7 @@ protected:
|
|||||||
// Attention! Creating new faces, hence make sure the loop ends correctly.
|
// Attention! Creating new faces, hence make sure the loop ends correctly.
|
||||||
f_end = _m.faces_end();
|
f_end = _m.faces_end();
|
||||||
for (fit = _m.faces_begin(); fit != f_end; ++fit)
|
for (fit = _m.faces_begin(); fit != f_end; ++fit)
|
||||||
split_face(_m, fit.handle() );
|
split_face(_m, *fit );
|
||||||
|
|
||||||
|
|
||||||
// Commit changes in geometry
|
// Commit changes in geometry
|
||||||
|
|||||||
@@ -92,31 +92,31 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, VertexIncomingHalfedgeWithoutHo
|
|||||||
|
|
||||||
EXPECT_EQ(10, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter begin at initialization";
|
EXPECT_EQ(10, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter begin at initialization";
|
||||||
EXPECT_EQ(10, vih_end->idx() ) << "Index wrong in VertexIHalfedgeIter end at initialization";
|
EXPECT_EQ(10, vih_end->idx() ) << "Index wrong in VertexIHalfedgeIter end at initialization";
|
||||||
EXPECT_EQ(1, mesh_.face_handle(vih_it.handle()).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter begin at initialization";
|
EXPECT_EQ(1, mesh_.face_handle(*vih_it).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter begin at initialization";
|
||||||
EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at initialization";
|
EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at initialization";
|
||||||
|
|
||||||
++vih_it ;
|
++vih_it ;
|
||||||
|
|
||||||
EXPECT_EQ(7, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 1";
|
EXPECT_EQ(7, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 1";
|
||||||
EXPECT_EQ(2, mesh_.face_handle(vih_it.handle()).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 1";
|
EXPECT_EQ(2, mesh_.face_handle(*vih_it).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 1";
|
||||||
EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at step 1";
|
EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at step 1";
|
||||||
|
|
||||||
++vih_it ;
|
++vih_it ;
|
||||||
|
|
||||||
EXPECT_EQ(0, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 2";
|
EXPECT_EQ(0, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 2";
|
||||||
EXPECT_EQ(0, mesh_.face_handle(vih_it.handle()).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 2";
|
EXPECT_EQ(0, mesh_.face_handle(*vih_it).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 2";
|
||||||
EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at step 2";
|
EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at step 2";
|
||||||
|
|
||||||
++vih_it ;
|
++vih_it ;
|
||||||
|
|
||||||
EXPECT_EQ(3, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 3";
|
EXPECT_EQ(3, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 3";
|
||||||
EXPECT_EQ(3, mesh_.face_handle(vih_it.handle()).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 3";
|
EXPECT_EQ(3, mesh_.face_handle(*vih_it).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 3";
|
||||||
EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at step 3";
|
EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at step 3";
|
||||||
|
|
||||||
++vih_it ;
|
++vih_it ;
|
||||||
|
|
||||||
EXPECT_EQ(10, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 4";
|
EXPECT_EQ(10, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 4";
|
||||||
EXPECT_EQ(1, mesh_.face_handle(vih_it.handle()).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 4";
|
EXPECT_EQ(1, mesh_.face_handle(*vih_it).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 4";
|
||||||
EXPECT_FALSE(vih_it) << "Iterator still valid in VertexIHalfedgeIter at step 4";
|
EXPECT_FALSE(vih_it) << "Iterator still valid in VertexIHalfedgeIter at step 4";
|
||||||
EXPECT_TRUE( vih_it == vih_end ) << "Miss matched end iterator";
|
EXPECT_TRUE( vih_it == vih_end ) << "Miss matched end iterator";
|
||||||
|
|
||||||
@@ -127,31 +127,31 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, VertexIncomingHalfedgeWithoutHo
|
|||||||
|
|
||||||
EXPECT_EQ(10, cvih_it->idx() ) << "Index wrong in ConstVertexIHalfedgeIter begin at initialization";
|
EXPECT_EQ(10, cvih_it->idx() ) << "Index wrong in ConstVertexIHalfedgeIter begin at initialization";
|
||||||
EXPECT_EQ(10, cvoh_end->idx() ) << "Index wrong in ConstVertexIHalfedgeIter end at initialization";
|
EXPECT_EQ(10, cvoh_end->idx() ) << "Index wrong in ConstVertexIHalfedgeIter end at initialization";
|
||||||
EXPECT_EQ(1, mesh_.face_handle(cvih_it.handle()).idx() ) << "Corresponding face Index wrong in ConstVertexIHalfedgeIter begin at initialization";
|
EXPECT_EQ(1, mesh_.face_handle(*cvih_it).idx() ) << "Corresponding face Index wrong in ConstVertexIHalfedgeIter begin at initialization";
|
||||||
EXPECT_TRUE(cvih_it) << "Iterator invalid in ConstVertexIHalfedgeIter at initialization";
|
EXPECT_TRUE(cvih_it) << "Iterator invalid in ConstVertexIHalfedgeIter at initialization";
|
||||||
|
|
||||||
++cvih_it ;
|
++cvih_it ;
|
||||||
|
|
||||||
EXPECT_EQ(7, cvih_it->idx() ) << "Index wrong in ConstVertexIHalfedgeIter step 1";
|
EXPECT_EQ(7, cvih_it->idx() ) << "Index wrong in ConstVertexIHalfedgeIter step 1";
|
||||||
EXPECT_EQ(2, mesh_.face_handle(cvih_it.handle()).idx() ) << "Corresponding face Index wrong in ConstVertexIHalfedgeIter step 1";
|
EXPECT_EQ(2, mesh_.face_handle(*cvih_it).idx() ) << "Corresponding face Index wrong in ConstVertexIHalfedgeIter step 1";
|
||||||
EXPECT_TRUE(cvih_it) << "Iterator invalid in ConstVertexIHalfedgeIter at step 1";
|
EXPECT_TRUE(cvih_it) << "Iterator invalid in ConstVertexIHalfedgeIter at step 1";
|
||||||
|
|
||||||
++cvih_it ;
|
++cvih_it ;
|
||||||
|
|
||||||
EXPECT_EQ(0, cvih_it->idx() ) << "Index wrong in ConstVertexIHalfedgeIter step 2";
|
EXPECT_EQ(0, cvih_it->idx() ) << "Index wrong in ConstVertexIHalfedgeIter step 2";
|
||||||
EXPECT_EQ(0, mesh_.face_handle(cvih_it.handle()).idx() ) << "Corresponding face Index wrong in ConstVertexIHalfedgeIter step 2";
|
EXPECT_EQ(0, mesh_.face_handle(*cvih_it).idx() ) << "Corresponding face Index wrong in ConstVertexIHalfedgeIter step 2";
|
||||||
EXPECT_TRUE(cvih_it) << "Iterator invalid in ConstVertexIHalfedgeIter at step 2";
|
EXPECT_TRUE(cvih_it) << "Iterator invalid in ConstVertexIHalfedgeIter at step 2";
|
||||||
|
|
||||||
++cvih_it ;
|
++cvih_it ;
|
||||||
|
|
||||||
EXPECT_EQ(3, cvih_it->idx() ) << "Index wrong in ConstVertexIHalfedgeIter step 3";
|
EXPECT_EQ(3, cvih_it->idx() ) << "Index wrong in ConstVertexIHalfedgeIter step 3";
|
||||||
EXPECT_EQ(3, mesh_.face_handle(cvih_it.handle()).idx() ) << "Corresponding face Index wrong in ConstVertexIHalfedgeIter step 3";
|
EXPECT_EQ(3, mesh_.face_handle(*cvih_it).idx() ) << "Corresponding face Index wrong in ConstVertexIHalfedgeIter step 3";
|
||||||
EXPECT_TRUE(cvih_it) << "Iterator invalid in ConstVertexIHalfedgeIter at step 3";
|
EXPECT_TRUE(cvih_it) << "Iterator invalid in ConstVertexIHalfedgeIter at step 3";
|
||||||
|
|
||||||
++cvih_it ;
|
++cvih_it ;
|
||||||
|
|
||||||
EXPECT_EQ(10, cvih_it->idx() ) << "Index wrong in ConstVertexIHalfedgeIter step 4";
|
EXPECT_EQ(10, cvih_it->idx() ) << "Index wrong in ConstVertexIHalfedgeIter step 4";
|
||||||
EXPECT_EQ(1, mesh_.face_handle(cvih_it.handle()).idx() ) << "Corresponding face Index wrong in ConstVertexIHalfedgeIter step 4";
|
EXPECT_EQ(1, mesh_.face_handle(*cvih_it).idx() ) << "Corresponding face Index wrong in ConstVertexIHalfedgeIter step 4";
|
||||||
EXPECT_FALSE(cvih_it) << "Iterator still valid in ConstVertexIHalfedgeIter at step 4";
|
EXPECT_FALSE(cvih_it) << "Iterator still valid in ConstVertexIHalfedgeIter at step 4";
|
||||||
EXPECT_TRUE( cvih_it == cvoh_end ) << "Miss matched end iterator";
|
EXPECT_TRUE( cvih_it == cvoh_end ) << "Miss matched end iterator";
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, VertexOIncomingHalfedgeBoundary
|
|||||||
++vih_it ;
|
++vih_it ;
|
||||||
|
|
||||||
EXPECT_EQ(14, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 3";
|
EXPECT_EQ(14, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 3";
|
||||||
EXPECT_EQ(3, mesh_.face_handle(vih_it.handle()).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 3";
|
EXPECT_EQ(3, mesh_.face_handle(*vih_it).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 3";
|
||||||
EXPECT_FALSE(vih_it) << "Iterator still valid in VertexIHalfedgeIter at step 3";
|
EXPECT_FALSE(vih_it) << "Iterator still valid in VertexIHalfedgeIter at step 3";
|
||||||
EXPECT_TRUE( vih_it == vih_end ) << "Miss matched end iterator";
|
EXPECT_TRUE( vih_it == vih_end ) << "Miss matched end iterator";
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, VertexIncomingHalfedgeDereferen
|
|||||||
Mesh::VertexIHalfedgeIter vih_it = mesh_.vih_iter(vhandle[1]);
|
Mesh::VertexIHalfedgeIter vih_it = mesh_.vih_iter(vhandle[1]);
|
||||||
|
|
||||||
// TODO: If called without handle, it won't build
|
// TODO: If called without handle, it won't build
|
||||||
Mesh::EdgeHandle eh = mesh_.edge_handle(vih_it.handle());
|
Mesh::EdgeHandle eh = mesh_.edge_handle(*vih_it);
|
||||||
Mesh::HalfedgeHandle heh = mesh_.halfedge_handle(vih_it);
|
Mesh::HalfedgeHandle heh = mesh_.halfedge_handle(vih_it);
|
||||||
Mesh::VertexHandle vh2 = mesh_.to_vertex_handle(vih_it);
|
Mesh::VertexHandle vh2 = mesh_.to_vertex_handle(vih_it);
|
||||||
|
|
||||||
|
|||||||
@@ -93,31 +93,31 @@ TEST_F(OpenMeshTrimeshCirculatorVertexOHalfEdge, VertexOutgoingHalfedgeWithoutHo
|
|||||||
|
|
||||||
EXPECT_EQ(11, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter begin at initialization";
|
EXPECT_EQ(11, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter begin at initialization";
|
||||||
EXPECT_EQ(11, voh_end->idx() ) << "Index wrong in VertexOHalfedgeIter end at initialization";
|
EXPECT_EQ(11, voh_end->idx() ) << "Index wrong in VertexOHalfedgeIter end at initialization";
|
||||||
EXPECT_EQ(3, mesh_.face_handle(voh_it.handle()).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter begin at initialization";
|
EXPECT_EQ(3, mesh_.face_handle(*voh_it).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter begin at initialization";
|
||||||
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at initialization";
|
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at initialization";
|
||||||
|
|
||||||
++voh_it ;
|
++voh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(6, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 1";
|
EXPECT_EQ(6, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 1";
|
||||||
EXPECT_EQ(1, mesh_.face_handle(voh_it.handle()).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 1";
|
EXPECT_EQ(1, mesh_.face_handle(*voh_it).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 1";
|
||||||
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at step 1";
|
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at step 1";
|
||||||
|
|
||||||
++voh_it ;
|
++voh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(1, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 2";
|
EXPECT_EQ(1, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 2";
|
||||||
EXPECT_EQ(2, mesh_.face_handle(voh_it.handle()).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 2";
|
EXPECT_EQ(2, mesh_.face_handle(*voh_it).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 2";
|
||||||
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at step 2";
|
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at step 2";
|
||||||
|
|
||||||
++voh_it ;
|
++voh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(2, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 3";
|
EXPECT_EQ(2, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 3";
|
||||||
EXPECT_EQ(0, mesh_.face_handle(voh_it.handle()).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 3";
|
EXPECT_EQ(0, mesh_.face_handle(*voh_it).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 3";
|
||||||
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at step 3";
|
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at step 3";
|
||||||
|
|
||||||
++voh_it ;
|
++voh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(11, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 4";
|
EXPECT_EQ(11, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 4";
|
||||||
EXPECT_EQ(3, mesh_.face_handle(voh_it.handle()).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 4";
|
EXPECT_EQ(3, mesh_.face_handle(*voh_it).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 4";
|
||||||
EXPECT_FALSE(voh_it) << "Iterator still valid in VertexOHalfedgeIter at step 4";
|
EXPECT_FALSE(voh_it) << "Iterator still valid in VertexOHalfedgeIter at step 4";
|
||||||
EXPECT_TRUE( voh_it == voh_end ) << "Miss matched end iterator";
|
EXPECT_TRUE( voh_it == voh_end ) << "Miss matched end iterator";
|
||||||
|
|
||||||
@@ -127,31 +127,31 @@ TEST_F(OpenMeshTrimeshCirculatorVertexOHalfEdge, VertexOutgoingHalfedgeWithoutHo
|
|||||||
|
|
||||||
EXPECT_EQ(11, cvoh_it->idx() ) << "Index wrong in ConstVertexOHalfedgeIter begin at initialization";
|
EXPECT_EQ(11, cvoh_it->idx() ) << "Index wrong in ConstVertexOHalfedgeIter begin at initialization";
|
||||||
EXPECT_EQ(11, cvoh_end->idx() ) << "Index wrong in ConstVertexOHalfedgeIter end at initialization";
|
EXPECT_EQ(11, cvoh_end->idx() ) << "Index wrong in ConstVertexOHalfedgeIter end at initialization";
|
||||||
EXPECT_EQ(3, mesh_.face_handle(cvoh_it.handle()).idx() ) << "Corresponding face Index wrong in ConstVertexOHalfedgeIter begin at initialization";
|
EXPECT_EQ(3, mesh_.face_handle(*cvoh_it).idx() ) << "Corresponding face Index wrong in ConstVertexOHalfedgeIter begin at initialization";
|
||||||
EXPECT_TRUE(cvoh_it) << "Iterator invalid in ConstVertexOHalfedgeIter at initialization";
|
EXPECT_TRUE(cvoh_it) << "Iterator invalid in ConstVertexOHalfedgeIter at initialization";
|
||||||
|
|
||||||
++cvoh_it ;
|
++cvoh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(6, cvoh_it->idx() ) << "Index wrong in ConstVertexOHalfedgeIter step 1";
|
EXPECT_EQ(6, cvoh_it->idx() ) << "Index wrong in ConstVertexOHalfedgeIter step 1";
|
||||||
EXPECT_EQ(1, mesh_.face_handle(cvoh_it.handle()).idx() ) << "Corresponding face Index wrong in ConstVertexOHalfedgeIter step 1";
|
EXPECT_EQ(1, mesh_.face_handle(*cvoh_it).idx() ) << "Corresponding face Index wrong in ConstVertexOHalfedgeIter step 1";
|
||||||
EXPECT_TRUE(cvoh_it) << "Iterator invalid in ConstVertexOHalfedgeIter at step 1";
|
EXPECT_TRUE(cvoh_it) << "Iterator invalid in ConstVertexOHalfedgeIter at step 1";
|
||||||
|
|
||||||
++cvoh_it ;
|
++cvoh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(1, cvoh_it->idx() ) << "Index wrong in ConstVertexOHalfedgeIter step 2";
|
EXPECT_EQ(1, cvoh_it->idx() ) << "Index wrong in ConstVertexOHalfedgeIter step 2";
|
||||||
EXPECT_EQ(2, mesh_.face_handle(cvoh_it.handle()).idx() ) << "Corresponding face Index wrong in ConstVertexOHalfedgeIter step 2";
|
EXPECT_EQ(2, mesh_.face_handle(*cvoh_it).idx() ) << "Corresponding face Index wrong in ConstVertexOHalfedgeIter step 2";
|
||||||
EXPECT_TRUE(cvoh_it) << "Iterator invalid in ConstVertexOHalfedgeIter at step 2";
|
EXPECT_TRUE(cvoh_it) << "Iterator invalid in ConstVertexOHalfedgeIter at step 2";
|
||||||
|
|
||||||
++cvoh_it ;
|
++cvoh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(2, cvoh_it->idx() ) << "Index wrong in ConstVertexOHalfedgeIter step 3";
|
EXPECT_EQ(2, cvoh_it->idx() ) << "Index wrong in ConstVertexOHalfedgeIter step 3";
|
||||||
EXPECT_EQ(0, mesh_.face_handle(cvoh_it.handle()).idx() ) << "Corresponding face Index wrong in ConstVertexOHalfedgeIter step 3";
|
EXPECT_EQ(0, mesh_.face_handle(*cvoh_it).idx() ) << "Corresponding face Index wrong in ConstVertexOHalfedgeIter step 3";
|
||||||
EXPECT_TRUE(cvoh_it) << "Iterator invalid in ConstVertexOHalfedgeIter at step 3";
|
EXPECT_TRUE(cvoh_it) << "Iterator invalid in ConstVertexOHalfedgeIter at step 3";
|
||||||
|
|
||||||
++cvoh_it ;
|
++cvoh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(11, cvoh_it->idx() ) << "Index wrong in ConstVertexOHalfedgeIter step 4";
|
EXPECT_EQ(11, cvoh_it->idx() ) << "Index wrong in ConstVertexOHalfedgeIter step 4";
|
||||||
EXPECT_EQ(3, mesh_.face_handle(cvoh_it.handle()).idx() ) << "Corresponding face Index wrong in ConstVertexOHalfedgeIter step 4";
|
EXPECT_EQ(3, mesh_.face_handle(*cvoh_it).idx() ) << "Corresponding face Index wrong in ConstVertexOHalfedgeIter step 4";
|
||||||
EXPECT_FALSE(cvoh_it) << "Iterator still valid in ConstVertexOHalfedgeIter at step 4";
|
EXPECT_FALSE(cvoh_it) << "Iterator still valid in ConstVertexOHalfedgeIter at step 4";
|
||||||
EXPECT_TRUE( cvoh_it == cvoh_end ) << "Miss matched end iterator";
|
EXPECT_TRUE( cvoh_it == cvoh_end ) << "Miss matched end iterator";
|
||||||
|
|
||||||
@@ -219,25 +219,25 @@ TEST_F(OpenMeshTrimeshCirculatorVertexOHalfEdge, VertexOutgoingHalfedgeBoundaryI
|
|||||||
|
|
||||||
EXPECT_EQ(15, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter begin at initialization";
|
EXPECT_EQ(15, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter begin at initialization";
|
||||||
EXPECT_EQ(15, voh_end->idx() ) << "Index wrong in VertexOHalfedgeIter end at initialization";
|
EXPECT_EQ(15, voh_end->idx() ) << "Index wrong in VertexOHalfedgeIter end at initialization";
|
||||||
EXPECT_EQ(-1, mesh_.face_handle(voh_it.handle()).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter begin at initialization";
|
EXPECT_EQ(-1, mesh_.face_handle(*voh_it).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter begin at initialization";
|
||||||
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at initialization";
|
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at initialization";
|
||||||
|
|
||||||
++voh_it ;
|
++voh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(3, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 1";
|
EXPECT_EQ(3, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 1";
|
||||||
EXPECT_EQ(3, mesh_.face_handle(voh_it.handle()).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 1";
|
EXPECT_EQ(3, mesh_.face_handle(*voh_it).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 1";
|
||||||
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at step 1";
|
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at step 1";
|
||||||
|
|
||||||
++voh_it ;
|
++voh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(4, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 2";
|
EXPECT_EQ(4, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 2";
|
||||||
EXPECT_EQ(0, mesh_.face_handle(voh_it.handle()).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 2";
|
EXPECT_EQ(0, mesh_.face_handle(*voh_it).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 2";
|
||||||
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at step 2";
|
EXPECT_TRUE(voh_it) << "Iterator invalid in VertexOHalfedgeIter at step 2";
|
||||||
|
|
||||||
++voh_it ;
|
++voh_it ;
|
||||||
|
|
||||||
EXPECT_EQ(15, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 3";
|
EXPECT_EQ(15, voh_it->idx() ) << "Index wrong in VertexOHalfedgeIter step 3";
|
||||||
EXPECT_EQ(-1, mesh_.face_handle(voh_it.handle()).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 3";
|
EXPECT_EQ(-1, mesh_.face_handle(*voh_it).idx() ) << "Corresponding face Index wrong in VertexOHalfedgeIter step 3";
|
||||||
EXPECT_FALSE(voh_it) << "Iterator still valid in VertexOHalfedgeIter at step 3";
|
EXPECT_FALSE(voh_it) << "Iterator still valid in VertexOHalfedgeIter at step 3";
|
||||||
EXPECT_TRUE( voh_it == voh_end ) << "Miss matched end iterator";
|
EXPECT_TRUE( voh_it == voh_end ) << "Miss matched end iterator";
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ TEST_F(OpenMeshTrimeshCirculatorVertexOHalfEdge, VertexOutgoingHalfedgeDereferen
|
|||||||
Mesh::VertexOHalfedgeIter voh_it = mesh_.voh_iter(vhandle[1]);
|
Mesh::VertexOHalfedgeIter voh_it = mesh_.voh_iter(vhandle[1]);
|
||||||
|
|
||||||
// TODO: If called without handle, it won't build
|
// TODO: If called without handle, it won't build
|
||||||
Mesh::EdgeHandle eh = mesh_.edge_handle(voh_it.handle());
|
Mesh::EdgeHandle eh = mesh_.edge_handle(*voh_it);
|
||||||
Mesh::HalfedgeHandle heh = mesh_.halfedge_handle(voh_it);
|
Mesh::HalfedgeHandle heh = mesh_.halfedge_handle(voh_it);
|
||||||
Mesh::VertexHandle vh2 = mesh_.to_vertex_handle(voh_it);
|
Mesh::VertexHandle vh2 = mesh_.to_vertex_handle(voh_it);
|
||||||
|
|
||||||
|
|||||||
@@ -316,15 +316,15 @@ TEST_F(OpenMeshTriMeshGarbageCollection, TrackedGarbageCollection) {
|
|||||||
//==================================================
|
//==================================================
|
||||||
std::vector<Mesh::VertexHandle> vertexHandles;
|
std::vector<Mesh::VertexHandle> vertexHandles;
|
||||||
for ( Mesh::VertexIter v_it = mesh_.vertices_begin(); v_it != mesh_.vertices_end(); ++v_it)
|
for ( Mesh::VertexIter v_it = mesh_.vertices_begin(); v_it != mesh_.vertices_end(); ++v_it)
|
||||||
vertexHandles.push_back(v_it.handle());
|
vertexHandles.push_back(*v_it);
|
||||||
|
|
||||||
std::vector<Mesh::HalfedgeHandle> halfedgeHandles;
|
std::vector<Mesh::HalfedgeHandle> halfedgeHandles;
|
||||||
for ( Mesh::HalfedgeIter he_it = mesh_.halfedges_begin(); he_it != mesh_.halfedges_end(); ++he_it)
|
for ( Mesh::HalfedgeIter he_it = mesh_.halfedges_begin(); he_it != mesh_.halfedges_end(); ++he_it)
|
||||||
halfedgeHandles.push_back(he_it.handle());
|
halfedgeHandles.push_back(*he_it);
|
||||||
|
|
||||||
std::vector<Mesh::FaceHandle> faceHandles;
|
std::vector<Mesh::FaceHandle> faceHandles;
|
||||||
for ( Mesh::FaceIter f_it = mesh_.faces_begin(); f_it != mesh_.faces_end(); ++f_it)
|
for ( Mesh::FaceIter f_it = mesh_.faces_begin(); f_it != mesh_.faces_end(); ++f_it)
|
||||||
faceHandles.push_back(f_it.handle());
|
faceHandles.push_back(*f_it);
|
||||||
|
|
||||||
//==================================================
|
//==================================================
|
||||||
// Create vectors containing pointers current handles
|
// Create vectors containing pointers current handles
|
||||||
|
|||||||
Reference in New Issue
Block a user