Next changeset
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@907 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -349,8 +349,8 @@ public:
|
|||||||
// Mark edges of failed face as non-two-manifold
|
// Mark edges of failed face as non-two-manifold
|
||||||
if (mesh_.has_edge_status()) {
|
if (mesh_.has_edge_status()) {
|
||||||
typename Mesh::FaceEdgeIter fe_it = mesh_.fe_iter(fh);
|
typename Mesh::FaceEdgeIter fe_it = mesh_.fe_iter(fh);
|
||||||
for(; fe_it; ++fe_it) {
|
for(; fe_it.is_valid(); ++fe_it) {
|
||||||
mesh_.status(fe_it).set_fixed_nonmanifold(true);
|
mesh_.status(*fe_it).set_fixed_nonmanifold(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ PolyConnectivity::find_halfedge(VertexHandle _start_vh, VertexHandle _end_vh ) c
|
|||||||
{
|
{
|
||||||
assert(_start_vh.is_valid() && _end_vh.is_valid());
|
assert(_start_vh.is_valid() && _end_vh.is_valid());
|
||||||
|
|
||||||
for (ConstVertexVertexIter vvIt=cvv_iter(_start_vh); vvIt; ++vvIt)
|
for (ConstVertexVertexIter vvIt=cvv_iter(_start_vh); vvIt.is_valid(); ++vvIt)
|
||||||
if (vvIt.handle() == _end_vh)
|
if (*vvIt == _end_vh)
|
||||||
return vvIt.current_halfedge_handle();
|
return vvIt.current_halfedge_handle();
|
||||||
|
|
||||||
return InvalidHalfedgeHandle;
|
return InvalidHalfedgeHandle;
|
||||||
@@ -67,14 +67,14 @@ PolyConnectivity::find_halfedge(VertexHandle _start_vh, VertexHandle _end_vh ) c
|
|||||||
|
|
||||||
bool PolyConnectivity::is_boundary(FaceHandle _fh, bool _check_vertex) const
|
bool PolyConnectivity::is_boundary(FaceHandle _fh, bool _check_vertex) const
|
||||||
{
|
{
|
||||||
for (ConstFaceEdgeIter cfeit = cfe_iter( _fh ); cfeit; ++cfeit)
|
for (ConstFaceEdgeIter cfeit = cfe_iter( _fh ); cfeit.is_valid(); ++cfeit)
|
||||||
if (is_boundary( cfeit.handle() ) )
|
if (is_boundary( *cfeit ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (_check_vertex)
|
if (_check_vertex)
|
||||||
{
|
{
|
||||||
for (ConstFaceVertexIter cfvit = cfv_iter( _fh ); cfvit; ++cfvit)
|
for (ConstFaceVertexIter cfvit = cfv_iter( _fh ); cfvit.is_valid(); ++cfvit)
|
||||||
if (is_boundary( cfvit.handle() ) )
|
if (is_boundary( *cfvit ) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -89,9 +89,9 @@ bool PolyConnectivity::is_manifold(VertexHandle _vh) const
|
|||||||
boundary halfedge, the vertex is non-manifold. */
|
boundary halfedge, the vertex is non-manifold. */
|
||||||
|
|
||||||
ConstVertexOHalfedgeIter vh_it(*this, _vh);
|
ConstVertexOHalfedgeIter vh_it(*this, _vh);
|
||||||
if (vh_it)
|
if (vh_it.is_valid())
|
||||||
for (++vh_it; vh_it; ++vh_it)
|
for (++vh_it; vh_it.is_valid(); ++vh_it)
|
||||||
if (is_boundary(vh_it.handle()))
|
if (is_boundary(*vh_it))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -99,11 +99,11 @@ bool PolyConnectivity::is_manifold(VertexHandle _vh) const
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void PolyConnectivity::adjust_outgoing_halfedge(VertexHandle _vh)
|
void PolyConnectivity::adjust_outgoing_halfedge(VertexHandle _vh)
|
||||||
{
|
{
|
||||||
for (ConstVertexOHalfedgeIter vh_it=cvoh_iter(_vh); vh_it; ++vh_it)
|
for (ConstVertexOHalfedgeIter vh_it=cvoh_iter(_vh); vh_it.is_valid(); ++vh_it)
|
||||||
{
|
{
|
||||||
if (is_boundary(vh_it.handle()))
|
if (is_boundary(*vh_it))
|
||||||
{
|
{
|
||||||
set_halfedge_handle(_vh, vh_it.handle());
|
set_halfedge_handle(_vh, *vh_it);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -388,19 +388,19 @@ bool PolyConnectivity::is_collapse_ok(HalfedgeHandle v0v1)
|
|||||||
|
|
||||||
VertexVertexIter vv_it;
|
VertexVertexIter vv_it;
|
||||||
// test intersection of the one-rings of v0 and v1
|
// test intersection of the one-rings of v0 and v1
|
||||||
for (vv_it = vv_iter(v0); vv_it; ++vv_it)
|
for (vv_it = vv_iter(v0); vv_it.is_valid(); ++vv_it)
|
||||||
{
|
{
|
||||||
status(vv_it).set_tagged(false);
|
status(*vv_it).set_tagged(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (vv_it = vv_iter(v1); vv_it; ++vv_it)
|
for (vv_it = vv_iter(v1); vv_it.is_valid(); ++vv_it)
|
||||||
{
|
{
|
||||||
status(vv_it).set_tagged(true);
|
status(*vv_it).set_tagged(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (vv_it = vv_iter(v0); vv_it; ++vv_it)
|
for (vv_it = vv_iter(v0); vv_it.is_valid(); ++vv_it)
|
||||||
{
|
{
|
||||||
if (status(vv_it).tagged() &&
|
if (status(*vv_it).tagged() &&
|
||||||
!(*vv_it == v_01_n && v0v1_triangle) &&
|
!(*vv_it == v_01_n && v0v1_triangle) &&
|
||||||
!(*vv_it == v_10_n && v1v0_triangle)
|
!(*vv_it == v_10_n && v1v0_triangle)
|
||||||
)
|
)
|
||||||
@@ -440,7 +440,7 @@ bool PolyConnectivity::is_collapse_ok(HalfedgeHandle v0v1)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status(vv_it).tagged() && v_01_n == v_10_n && v0v1_triangle && v1v0_triangle)
|
if (status(*vv_it).tagged() && v_01_n == v_10_n && v0v1_triangle && v1v0_triangle)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -456,8 +456,8 @@ void PolyConnectivity::delete_vertex(VertexHandle _vh, bool _delete_isolated_ver
|
|||||||
// store incident faces
|
// store incident faces
|
||||||
std::vector<FaceHandle> face_handles;
|
std::vector<FaceHandle> face_handles;
|
||||||
face_handles.reserve(8);
|
face_handles.reserve(8);
|
||||||
for (VFIter vf_it(vf_iter(_vh)); vf_it; ++vf_it)
|
for (VFIter vf_it(vf_iter(_vh)); vf_it.is_valid(); ++vf_it)
|
||||||
face_handles.push_back(vf_it.handle());
|
face_handles.push_back(*vf_it);
|
||||||
|
|
||||||
|
|
||||||
// delete collected faces
|
// delete collected faces
|
||||||
@@ -524,9 +524,9 @@ void PolyConnectivity::delete_face(FaceHandle _fh, bool _delete_isolated_vertice
|
|||||||
// 2) collect all boundary halfedges, set them deleted
|
// 2) collect all boundary halfedges, set them deleted
|
||||||
// 3) store vertex handles
|
// 3) store vertex handles
|
||||||
HalfedgeHandle hh;
|
HalfedgeHandle hh;
|
||||||
for (FaceHalfedgeIter fh_it(fh_iter(_fh)); fh_it; ++fh_it)
|
for (FaceHalfedgeIter fh_it(fh_iter(_fh)); fh_it.is_valid(); ++fh_it)
|
||||||
{
|
{
|
||||||
hh = fh_it.handle();
|
hh = *fh_it;
|
||||||
|
|
||||||
set_boundary(hh);//set_face_handle(hh, InvalidFaceHandle);
|
set_boundary(hh);//set_face_handle(hh, InvalidFaceHandle);
|
||||||
|
|
||||||
@@ -745,8 +745,8 @@ void PolyConnectivity::collapse_edge(HalfedgeHandle _hh)
|
|||||||
|
|
||||||
|
|
||||||
// halfedge -> vertex
|
// halfedge -> vertex
|
||||||
for (VertexIHalfedgeIter vih_it(vih_iter(vo)); vih_it; ++vih_it)
|
for (VertexIHalfedgeIter vih_it(vih_iter(vo)); vih_it.is_valid(); ++vih_it)
|
||||||
set_vertex_handle(vih_it.handle(), vh);
|
set_vertex_handle(*vih_it, vh);
|
||||||
|
|
||||||
|
|
||||||
// halfedge -> halfedge
|
// halfedge -> halfedge
|
||||||
@@ -844,11 +844,11 @@ bool PolyConnectivity::is_simple_link(EdgeHandle _eh) const
|
|||||||
bool PolyConnectivity::is_simply_connected(FaceHandle _fh) const
|
bool PolyConnectivity::is_simply_connected(FaceHandle _fh) const
|
||||||
{
|
{
|
||||||
std::set<FaceHandle> nb_fhs;
|
std::set<FaceHandle> nb_fhs;
|
||||||
for (ConstFaceFaceIter cff_it = cff_iter(_fh); cff_it; ++cff_it)
|
for (ConstFaceFaceIter cff_it = cff_iter(_fh); cff_it.is_valid(); ++cff_it)
|
||||||
{
|
{
|
||||||
if (nb_fhs.find(cff_it) == nb_fhs.end())
|
if (nb_fhs.find(*cff_it) == nb_fhs.end())
|
||||||
{
|
{
|
||||||
nb_fhs.insert(cff_it);
|
nb_fhs.insert(*cff_it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{//there is more than one link
|
{//there is more than one link
|
||||||
@@ -910,9 +910,9 @@ PolyConnectivity::remove_edge(EdgeHandle _eh)
|
|||||||
{//rem_fh is the face at heh1
|
{//rem_fh is the face at heh1
|
||||||
set_halfedge_handle(rem_fh, prev_heh0);
|
set_halfedge_handle(rem_fh, prev_heh0);
|
||||||
}
|
}
|
||||||
for (FaceHalfedgeIter fh_it = fh_iter(rem_fh); fh_it; ++fh_it)
|
for (FaceHalfedgeIter fh_it = fh_iter(rem_fh); fh_it.is_valid(); ++fh_it)
|
||||||
{//set the face handle of the halfedges of del_fh to point to rem_fh
|
{//set the face handle of the halfedges of del_fh to point to rem_fh
|
||||||
set_face_handle(fh_it, rem_fh);
|
set_face_handle(*fh_it, rem_fh);
|
||||||
}
|
}
|
||||||
|
|
||||||
status(_eh).set_deleted(true);
|
status(_eh).set_deleted(true);
|
||||||
@@ -952,9 +952,9 @@ void PolyConnectivity::reinsert_edge(EdgeHandle _eh)
|
|||||||
set_next_halfedge_handle(prev_heh1, heh1);
|
set_next_halfedge_handle(prev_heh1, heh1);
|
||||||
set_prev_halfedge_handle(next_heh1, heh1);
|
set_prev_halfedge_handle(next_heh1, heh1);
|
||||||
|
|
||||||
for (FaceHalfedgeIter fh_it = fh_iter(del_fh); fh_it; ++fh_it)
|
for (FaceHalfedgeIter fh_it = fh_iter(del_fh); fh_it.is_valid(); ++fh_it)
|
||||||
{//reassign halfedges to del_fh
|
{//reassign halfedges to del_fh
|
||||||
set_face_handle(fh_it, del_fh);
|
set_face_handle(*fh_it, del_fh);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (face_handle(halfedge_handle(rem_fh)) == del_fh)
|
if (face_handle(halfedge_handle(rem_fh)) == del_fh)
|
||||||
@@ -992,9 +992,9 @@ PolyConnectivity::insert_edge(HalfedgeHandle _prev_heh, HalfedgeHandle _next_heh
|
|||||||
//now set the face handles - the new face is assigned to heh0
|
//now set the face handles - the new face is assigned to heh0
|
||||||
FaceHandle new_fh = new_face();
|
FaceHandle new_fh = new_face();
|
||||||
set_halfedge_handle(new_fh, heh0);
|
set_halfedge_handle(new_fh, heh0);
|
||||||
for (FaceHalfedgeIter fh_it = fh_iter(new_fh); fh_it; ++fh_it)
|
for (FaceHalfedgeIter fh_it = fh_iter(new_fh); fh_it.is_valid(); ++fh_it)
|
||||||
{
|
{
|
||||||
set_face_handle(fh_it, new_fh);
|
set_face_handle(*fh_it, new_fh);
|
||||||
}
|
}
|
||||||
FaceHandle old_fh = face_handle(next_prev_heh);
|
FaceHandle old_fh = face_handle(next_prev_heh);
|
||||||
set_face_handle(heh1, old_fh);
|
set_face_handle(heh1, old_fh);
|
||||||
@@ -1061,7 +1061,7 @@ void PolyConnectivity::triangulate()
|
|||||||
*/
|
*/
|
||||||
FaceIter f_it(faces_begin()), f_end(faces_end());
|
FaceIter f_it(faces_begin()), f_end(faces_end());
|
||||||
for (; f_it!=f_end; ++f_it)
|
for (; f_it!=f_end; ++f_it)
|
||||||
triangulate(f_it);
|
triangulate(*f_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -1114,15 +1114,15 @@ void PolyConnectivity::split_copy(FaceHandle fh, VertexHandle vh) {
|
|||||||
split(fh, vh);
|
split(fh, vh);
|
||||||
|
|
||||||
// Copy the property of the original face to all new faces
|
// Copy the property of the original face to all new faces
|
||||||
for(VertexFaceIter vf_it = vf_iter(vh); vf_it; ++vf_it)
|
for(VertexFaceIter vf_it = vf_iter(vh); vf_it.is_valid(); ++vf_it)
|
||||||
copy_all_properties(fh, vf_it);
|
copy_all_properties(fh, *vf_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
uint PolyConnectivity::valence(VertexHandle _vh) const
|
uint PolyConnectivity::valence(VertexHandle _vh) const
|
||||||
{
|
{
|
||||||
uint count(0);
|
uint count(0);
|
||||||
for (ConstVertexVertexIter vv_it=cvv_iter(_vh); vv_it; ++vv_it)
|
for (ConstVertexVertexIter vv_it=cvv_iter(_vh); vv_it.is_valid(); ++vv_it)
|
||||||
++count;
|
++count;
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
@@ -1131,7 +1131,7 @@ uint PolyConnectivity::valence(VertexHandle _vh) const
|
|||||||
uint PolyConnectivity::valence(FaceHandle _fh) const
|
uint PolyConnectivity::valence(FaceHandle _fh) const
|
||||||
{
|
{
|
||||||
uint count(0);
|
uint count(0);
|
||||||
for (ConstFaceVertexIter fv_it=cfv_iter(_fh); fv_it; ++fv_it)
|
for (ConstFaceVertexIter fv_it=cfv_iter(_fh); fv_it.is_valid(); ++fv_it)
|
||||||
++count;
|
++count;
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,10 +96,10 @@ calc_face_normal(FaceHandle _fh) const
|
|||||||
assert(this->halfedge_handle(_fh).is_valid());
|
assert(this->halfedge_handle(_fh).is_valid());
|
||||||
ConstFaceVertexIter fv_it(this->cfv_iter(_fh));
|
ConstFaceVertexIter fv_it(this->cfv_iter(_fh));
|
||||||
|
|
||||||
Point p0 = this->point(fv_it);
|
Point p0 = this->point(*fv_it);
|
||||||
Point p0i = p0; //save point of vertex 0
|
Point p0i = p0; //save point of vertex 0
|
||||||
++fv_it;
|
++fv_it;
|
||||||
Point p1 = this->point(fv_it);
|
Point p1 = this->point(*fv_it);
|
||||||
Point p1i = p1; //save point of vertex 1
|
Point p1i = p1; //save point of vertex 1
|
||||||
++fv_it;
|
++fv_it;
|
||||||
Point p2;
|
Point p2;
|
||||||
@@ -108,7 +108,7 @@ calc_face_normal(FaceHandle _fh) const
|
|||||||
Normal n(0,0,0);
|
Normal n(0,0,0);
|
||||||
for(; fv_it.is_valid(); ++fv_it)
|
for(; fv_it.is_valid(); ++fv_it)
|
||||||
{
|
{
|
||||||
p2 = this->point(fv_it);
|
p2 = this->point(*fv_it);
|
||||||
n += vector_cast<Normal>(calc_face_normal(p0, p1, p2));
|
n += vector_cast<Normal>(calc_face_normal(p0, p1, p2));
|
||||||
p0 = p1;
|
p0 = p1;
|
||||||
p1 = p2;
|
p1 = p2;
|
||||||
@@ -331,7 +331,7 @@ void PolyMeshT<Kernel>::
|
|||||||
calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const
|
calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const
|
||||||
{
|
{
|
||||||
_n.vectorize(0.0);
|
_n.vectorize(0.0);
|
||||||
for (ConstVertexFaceIter vf_it=this->cvf_iter(_vh); vf_it; ++vf_it)
|
for (ConstVertexFaceIter vf_it=this->cvf_iter(_vh); vf_it.is_valid(); ++vf_it)
|
||||||
_n += this->normal(*vf_it);
|
_n += this->normal(*vf_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,14 +153,14 @@ bool TriConnectivity::is_collapse_ok(HalfedgeHandle v0v1)
|
|||||||
VertexVertexIter vv_it;
|
VertexVertexIter vv_it;
|
||||||
|
|
||||||
// test intersection of the one-rings of v0 and v1
|
// test intersection of the one-rings of v0 and v1
|
||||||
for (vv_it = vv_iter(v0); vv_it; ++vv_it)
|
for (vv_it = vv_iter(v0); vv_it.is_valid(); ++vv_it)
|
||||||
status(vv_it).set_tagged(false);
|
status(*vv_it).set_tagged(false);
|
||||||
|
|
||||||
for (vv_it = vv_iter(v1); vv_it; ++vv_it)
|
for (vv_it = vv_iter(v1); vv_it.is_valid(); ++vv_it)
|
||||||
status(vv_it).set_tagged(true);
|
status(*vv_it).set_tagged(true);
|
||||||
|
|
||||||
for (vv_it = vv_iter(v0); vv_it; ++vv_it)
|
for (vv_it = vv_iter(v0); vv_it.is_valid(); ++vv_it)
|
||||||
if (status(vv_it).tagged() && *vv_it != vl && *vv_it != vr)
|
if (status(*vv_it).tagged() && *vv_it != vl && *vv_it != vr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
@@ -279,8 +279,8 @@ TriConnectivity::insert_edge(VertexHandle _vh, HalfedgeHandle _h0, HalfedgeHandl
|
|||||||
|
|
||||||
|
|
||||||
// halfedge -> vertex
|
// halfedge -> vertex
|
||||||
for (VertexIHalfedgeIter vih_it(vih_iter(v0)); vih_it; ++vih_it)
|
for (VertexIHalfedgeIter vih_it(vih_iter(v0)); vih_it.is_valid(); ++vih_it)
|
||||||
set_vertex_handle(vih_it.handle(), v0);
|
set_vertex_handle(*vih_it, v0);
|
||||||
|
|
||||||
|
|
||||||
// halfedge -> face
|
// halfedge -> face
|
||||||
@@ -323,8 +323,8 @@ bool TriConnectivity::is_flip_ok(EdgeHandle _eh) const
|
|||||||
if (ah == bh) // this is generally a bad sign !!!
|
if (ah == bh) // this is generally a bad sign !!!
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (ConstVertexVertexIter vvi(*this, ah); vvi; ++vvi)
|
for (ConstVertexVertexIter vvi(*this, ah); vvi.is_valid(); ++vvi)
|
||||||
if (vvi.handle() == bh)
|
if (*vvi == bh)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -487,8 +487,8 @@ void TriConnectivity::split_copy(EdgeHandle _eh, VertexHandle _vh)
|
|||||||
|
|
||||||
// Copy the properties of the original edge to all neighbor edges that
|
// Copy the properties of the original edge to all neighbor edges that
|
||||||
// have been created
|
// have been created
|
||||||
for(VEIter ve_it = ve_iter(_vh); ve_it; ++ve_it)
|
for(VEIter ve_it = ve_iter(_vh); ve_it.is_valid(); ++ve_it)
|
||||||
copy_all_properties(_eh, ve_it);
|
copy_all_properties(_eh, *ve_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
}// namespace OpenMesh
|
}// namespace OpenMesh
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ calc_face_normal(FaceHandle _fh) const
|
|||||||
assert(this->halfedge_handle(_fh).is_valid());
|
assert(this->halfedge_handle(_fh).is_valid());
|
||||||
ConstFaceVertexIter fv_it(this->cfv_iter(_fh));
|
ConstFaceVertexIter fv_it(this->cfv_iter(_fh));
|
||||||
|
|
||||||
const Point& p0(this->point(fv_it)); ++fv_it;
|
const Point& p0(this->point(*fv_it)); ++fv_it;
|
||||||
const Point& p1(this->point(fv_it)); ++fv_it;
|
const Point& p1(this->point(*fv_it)); ++fv_it;
|
||||||
const Point& p2(this->point(fv_it));
|
const Point& p2(this->point(*fv_it));
|
||||||
|
|
||||||
return PolyMesh::calc_face_normal(p0, p1, p2);
|
return PolyMesh::calc_face_normal(p0, p1, p2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ void DecimaterT<Mesh>::heap_vertex(VertexHandle _vh) {
|
|||||||
|
|
||||||
// find best target in one ring
|
// find best target in one ring
|
||||||
typename Mesh::VertexOHalfedgeIter voh_it(mesh_, _vh);
|
typename Mesh::VertexOHalfedgeIter voh_it(mesh_, _vh);
|
||||||
for (; voh_it; ++voh_it) {
|
for (; voh_it.is_valid(); ++voh_it) {
|
||||||
heh = *voh_it;
|
heh = *voh_it;
|
||||||
CollapseInfo ci(mesh_, heh);
|
CollapseInfo ci(mesh_, heh);
|
||||||
|
|
||||||
@@ -168,8 +168,8 @@ size_t DecimaterT<Mesh>::decimate(size_t _n_collapses) {
|
|||||||
|
|
||||||
for (v_it = mesh_.vertices_begin(); v_it != v_end; ++v_it) {
|
for (v_it = mesh_.vertices_begin(); v_it != v_end; ++v_it) {
|
||||||
heap_->reset_heap_position(v_it.handle());
|
heap_->reset_heap_position(v_it.handle());
|
||||||
if (!mesh_.status(v_it).deleted())
|
if (!mesh_.status(*v_it).deleted())
|
||||||
heap_vertex(v_it.handle());
|
heap_vertex(*v_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
// process heap
|
// process heap
|
||||||
@@ -189,7 +189,7 @@ size_t DecimaterT<Mesh>::decimate(size_t _n_collapses) {
|
|||||||
// store support (= one ring of *vp)
|
// store support (= one ring of *vp)
|
||||||
vv_it = mesh_.vv_iter(ci.v0);
|
vv_it = mesh_.vv_iter(ci.v0);
|
||||||
support.clear();
|
support.clear();
|
||||||
for (; vv_it; ++vv_it)
|
for (; vv_it.is_valid(); ++vv_it)
|
||||||
support.push_back(*vv_it);
|
support.push_back(*vv_it);
|
||||||
|
|
||||||
// perform collapse
|
// perform collapse
|
||||||
@@ -198,9 +198,9 @@ size_t DecimaterT<Mesh>::decimate(size_t _n_collapses) {
|
|||||||
|
|
||||||
// update triangle normals
|
// update triangle normals
|
||||||
vf_it = mesh_.vf_iter(ci.v1);
|
vf_it = mesh_.vf_iter(ci.v1);
|
||||||
for (; vf_it; ++vf_it)
|
for (; vf_it.is_valid(); ++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);
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ void ModAspectRatioT<MeshT>::preprocess_collapse(const CollapseInfo& _ci) {
|
|||||||
typename Mesh::FaceHandle fh;
|
typename Mesh::FaceHandle fh;
|
||||||
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.is_valid(); ++vf_it) {
|
||||||
fh = *vf_it;
|
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));
|
||||||
@@ -137,7 +137,7 @@ float ModAspectRatioT<MeshT>::collapse_priority(const CollapseInfo& _ci) {
|
|||||||
v3 = *vv_it;
|
v3 = *vv_it;
|
||||||
p3 = &mesh_.point(v3);
|
p3 = &mesh_.point(v3);
|
||||||
|
|
||||||
while (vv_it) {
|
while (vv_it.is_valid()) {
|
||||||
v2 = v3;
|
v2 = v3;
|
||||||
p2 = p3;
|
p2 = p3;
|
||||||
|
|
||||||
|
|||||||
@@ -215,7 +215,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.is_valid(); ++vf_it) {
|
||||||
fh = *vf_it;
|
fh = *vf_it;
|
||||||
|
|
||||||
if (fh != _ci.fl && fh != _ci.fr)
|
if (fh != _ci.fl && fh != _ci.fr)
|
||||||
@@ -289,7 +289,7 @@ postprocess_collapse(const CollapseInfo& _ci)
|
|||||||
faces.reserve(20);
|
faces.reserve(20);
|
||||||
|
|
||||||
// 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.is_valid(); ++vf_it) {
|
||||||
fh = *vf_it;
|
fh = *vf_it;
|
||||||
faces.push_back(fh);
|
faces.push_back(fh);
|
||||||
|
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ class ModIndependentSetsT: public ModBaseT<MeshT> {
|
|||||||
|
|
||||||
Base::mesh().status(_ci.v1).set_locked(true);
|
Base::mesh().status(_ci.v1).set_locked(true);
|
||||||
vv_it = Base::mesh().vv_iter(_ci.v1);
|
vv_it = Base::mesh().vv_iter(_ci.v1);
|
||||||
for (; vv_it; ++vv_it)
|
for (; vv_it.is_valid(); ++vv_it)
|
||||||
Base::mesh().status(vv_it).set_locked(true);
|
Base::mesh().status(*vv_it).set_locked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public:
|
|||||||
if (_ci.v0vl.is_valid()) fhl = mesh_.face_handle(_ci.v0vl);
|
if (_ci.v0vl.is_valid()) fhl = mesh_.face_handle(_ci.v0vl);
|
||||||
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.is_valid(); ++vf_it) {
|
||||||
fh = *vf_it;
|
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);
|
||||||
@@ -207,7 +207,7 @@ public:
|
|||||||
void postprocess_collapse(const CollapseInfo& _ci) {
|
void postprocess_collapse(const CollapseInfo& _ci) {
|
||||||
// account for changed normals
|
// account for changed normals
|
||||||
typename Mesh::VertexFaceIter vf_it(mesh_, _ci.v1);
|
typename Mesh::VertexFaceIter vf_it(mesh_, _ci.v1);
|
||||||
for (; vf_it; ++vf_it)
|
for (; vf_it.is_valid(); ++vf_it)
|
||||||
mesh_.property(normal_cones_, vf_it).
|
mesh_.property(normal_cones_, vf_it).
|
||||||
merge(NormalCone(mesh_.normal(vf_it)));
|
merge(NormalCone(mesh_.normal(vf_it)));
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public:
|
|||||||
typename Mesh::FaceHandle fh;
|
typename Mesh::FaceHandle fh;
|
||||||
typename Mesh::Scalar c(1.0);
|
typename Mesh::Scalar c(1.0);
|
||||||
|
|
||||||
for (; vf_it; ++vf_it)
|
for (; vf_it.is_valid(); ++vf_it)
|
||||||
{
|
{
|
||||||
fh = *vf_it;
|
fh = *vf_it;
|
||||||
if (fh != _ci.fl && fh != _ci.fr)
|
if (fh != _ci.fl && fh != _ci.fr)
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class ModRoundnessT : public ModBaseT<MeshT>
|
|||||||
C = vector_cast<Vec3f>(Base::mesh().point( Base::mesh().to_vertex_handle(voh_it)));
|
C = vector_cast<Vec3f>(Base::mesh().point( Base::mesh().to_vertex_handle(voh_it)));
|
||||||
fhC = Base::mesh().face_handle( *voh_it );
|
fhC = Base::mesh().face_handle( *voh_it );
|
||||||
|
|
||||||
for (++voh_it; voh_it; ++voh_it)
|
for (++voh_it; voh_it.is_valid(); ++voh_it)
|
||||||
{
|
{
|
||||||
B = C;
|
B = C;
|
||||||
fhB = fhC;
|
fhB = fhC;
|
||||||
@@ -153,7 +153,7 @@ class ModRoundnessT : public ModBaseT<MeshT>
|
|||||||
C = vector_cast<Vec3f>(Base::mesh().point( Base::mesh().to_vertex_handle(voh_it)));
|
C = vector_cast<Vec3f>(Base::mesh().point( Base::mesh().to_vertex_handle(voh_it)));
|
||||||
fhC = Base::mesh().face_handle( *voh_it );
|
fhC = Base::mesh().face_handle( *voh_it );
|
||||||
|
|
||||||
for (++voh_it; voh_it && (priority==Base::LEGAL_COLLAPSE); ++voh_it)
|
for (++voh_it; voh_it.is_valid() && (priority==Base::LEGAL_COLLAPSE); ++voh_it)
|
||||||
{
|
{
|
||||||
B = C;
|
B = C;
|
||||||
fhB = fhC;
|
fhB = fhC;
|
||||||
|
|||||||
@@ -100,11 +100,11 @@ 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.is_valid(); ++vit, ++degree)
|
||||||
centerPoint += primal.point(*vit);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
//for each vertex in the primal, add a face in the dual
|
//for each vertex in the primal, add a face in the dual
|
||||||
@@ -114,8 +114,8 @@ PolyMesh_ArrayKernelT<MeshTraits>* MeshDual (PolyMesh_ArrayKernelT<MeshTraits> &
|
|||||||
if(!primal.is_boundary(*vit))
|
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.is_valid(); ++fit)
|
||||||
face_vhandles.push_back(primal.property(primalToDual, fit));
|
face_vhandles.push_back(primal.property(primalToDual, *fit));
|
||||||
dual->add_face(face_vhandles);
|
dual->add_face(face_vhandles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,21 +108,21 @@ compute_new_positions_C0()
|
|||||||
{
|
{
|
||||||
// compute umbrella
|
// compute umbrella
|
||||||
u = zero;
|
u = zero;
|
||||||
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it)
|
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it.is_valid(); ++vv_it)
|
||||||
{
|
{
|
||||||
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
||||||
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(vv_it)) * w;
|
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(*vv_it)) * w;
|
||||||
}
|
}
|
||||||
u *= this->weight(v_it);
|
u *= this->weight(v_it);
|
||||||
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
|
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(*v_it));
|
||||||
|
|
||||||
// damping
|
// damping
|
||||||
u *= 0.5;
|
u *= 0.5;
|
||||||
|
|
||||||
// store new position
|
// store new position
|
||||||
p = vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
|
p = vector_cast<typename Mesh::Normal>(Base::mesh_.point(*v_it));
|
||||||
p += u;
|
p += u;
|
||||||
this->set_new_position(v_it, p);
|
this->set_new_position(*v_it, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,10 +146,10 @@ compute_new_positions_C1()
|
|||||||
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)
|
||||||
{
|
{
|
||||||
u = zero;
|
u = zero;
|
||||||
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it)
|
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it.is_valid(); ++vv_it)
|
||||||
{
|
{
|
||||||
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
||||||
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(vv_it))*w;
|
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(*vv_it))*w;
|
||||||
}
|
}
|
||||||
u *= this->weight(v_it);
|
u *= this->weight(v_it);
|
||||||
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
|
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
|
||||||
@@ -165,11 +165,11 @@ compute_new_positions_C1()
|
|||||||
{
|
{
|
||||||
uu = zero;
|
uu = zero;
|
||||||
diag = 0.0;
|
diag = 0.0;
|
||||||
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it)
|
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it.is_valid(); ++vv_it)
|
||||||
{
|
{
|
||||||
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
||||||
uu -= Base::mesh_.property(umbrellas_, vv_it);
|
uu -= Base::mesh_.property(umbrellas_, *vv_it);
|
||||||
diag += (w * this->weight(vv_it) + 1.0) * w;
|
diag += (w * this->weight(*vv_it) + 1.0) * w;
|
||||||
}
|
}
|
||||||
uu *= this->weight(v_it);
|
uu *= this->weight(v_it);
|
||||||
diag *= this->weight(v_it);
|
diag *= this->weight(v_it);
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ set_active_vertices()
|
|||||||
active = active && !mesh_.status(v_it).feature();
|
active = active && !mesh_.status(v_it).feature();
|
||||||
|
|
||||||
typename Mesh::VertexOHalfedgeIter voh_it(mesh_,v_it);
|
typename Mesh::VertexOHalfedgeIter voh_it(mesh_,v_it);
|
||||||
for ( ; voh_it ; ++voh_it ) {
|
for ( ; voh_it.is_valid() ; ++voh_it ) {
|
||||||
|
|
||||||
// If the edge is a feature edge, skip the current vertex while smoothing
|
// If the edge is a feature edge, skip the current vertex while smoothing
|
||||||
if ( mesh_.status(mesh_.edge_handle(*voh_it)).feature() )
|
if ( mesh_.status(mesh_.edge_handle(*voh_it)).feature() )
|
||||||
@@ -201,8 +201,8 @@ set_active_vertices()
|
|||||||
|
|
||||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||||
if (mesh_.is_boundary(v_it))
|
if (mesh_.is_boundary(v_it))
|
||||||
for (vv_it=mesh_.vv_iter(v_it); vv_it; ++vv_it)
|
for (vv_it=mesh_.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
|
||||||
mesh_.property(is_active_, vv_it) = false;
|
mesh_.property(is_active_, *vv_it) = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -213,26 +213,26 @@ set_active_vertices()
|
|||||||
|
|
||||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||||
{
|
{
|
||||||
mesh_.status(v_it).set_tagged(false);
|
mesh_.status(*v_it).set_tagged(false);
|
||||||
mesh_.status(v_it).set_tagged2(false);
|
mesh_.status(*v_it).set_tagged2(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||||
if (mesh_.is_boundary(v_it))
|
if (mesh_.is_boundary(*v_it))
|
||||||
for (vv_it=mesh_.vv_iter(v_it); vv_it; ++vv_it)
|
for (vv_it=mesh_.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
|
||||||
mesh_.status(v_it).set_tagged(true);
|
mesh_.status(*v_it).set_tagged(true);
|
||||||
|
|
||||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||||
if (mesh_.status(v_it).tagged())
|
if (mesh_.status(*v_it).tagged())
|
||||||
for (vv_it=mesh_.vv_iter(v_it); vv_it; ++vv_it)
|
for (vv_it=mesh_.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
|
||||||
mesh_.status(v_it).set_tagged2(true);
|
mesh_.status(*v_it).set_tagged2(true);
|
||||||
|
|
||||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||||
{
|
{
|
||||||
if (mesh_.status(v_it).tagged2())
|
if (mesh_.status(*v_it).tagged2())
|
||||||
mesh_.property(is_active_, vv_it) = false;
|
mesh_.property(is_active_, *vv_it) = false;
|
||||||
mesh_.status(v_it).set_tagged(false);
|
mesh_.status(*v_it).set_tagged(false);
|
||||||
mesh_.status(v_it).set_tagged2(false);
|
mesh_.status(*v_it).set_tagged2(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -674,7 +674,7 @@ void
|
|||||||
Tvv4<M>::split_edge(typename M::HalfedgeHandle &_hh,
|
Tvv4<M>::split_edge(typename M::HalfedgeHandle &_hh,
|
||||||
typename M::VertexHandle &_vh,
|
typename M::VertexHandle &_vh,
|
||||||
state_t _target_state)
|
state_t _target_state)
|
||||||
{
|
{
|
||||||
typename M::HalfedgeHandle temp_hh;
|
typename M::HalfedgeHandle temp_hh;
|
||||||
|
|
||||||
if (Base::mesh_.FH(Base::mesh_.OHEH(_hh)).is_valid())
|
if (Base::mesh_.FH(Base::mesh_.OHEH(_hh)).is_valid())
|
||||||
@@ -683,22 +683,22 @@ Tvv4<M>::split_edge(typename M::HalfedgeHandle &_hh,
|
|||||||
{
|
{
|
||||||
if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(_hh))).red_halfedge().is_valid())
|
if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(_hh))).red_halfedge().is_valid())
|
||||||
{
|
{
|
||||||
temp_hh = MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(_hh))).red_halfedge();
|
temp_hh = MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(_hh))).red_halfedge();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// two cases for divided, but not visited face
|
// two cases for divided, but not visited face
|
||||||
if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.PHEH(Base::mesh_.OHEH(_hh))))).state()
|
if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.PHEH(Base::mesh_.OHEH(_hh))))).state()
|
||||||
== MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(_hh))).state())
|
== MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(_hh))).state())
|
||||||
{
|
{
|
||||||
temp_hh = Base::mesh_.PHEH(Base::mesh_.OHEH(_hh));
|
temp_hh = Base::mesh_.PHEH(Base::mesh_.OHEH(_hh));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(Base::mesh_.OHEH(_hh))))).state()
|
else if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(Base::mesh_.OHEH(_hh))))).state()
|
||||||
== MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(_hh))).state())
|
== MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(_hh))).state())
|
||||||
{
|
{
|
||||||
temp_hh = Base::mesh_.NHEH(Base::mesh_.OHEH(_hh));
|
temp_hh = Base::mesh_.NHEH(Base::mesh_.OHEH(_hh));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -817,7 +817,7 @@ void VF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
|
|||||||
|
|
||||||
this->update(_fh, _target_state);
|
this->update(_fh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour vertices to level x-1
|
// raise all neighbor vertices to level x-1
|
||||||
typename M::FaceVertexIter fv_it;
|
typename M::FaceVertexIter fv_it;
|
||||||
typename M::VertexHandle vh;
|
typename M::VertexHandle vh;
|
||||||
std::vector<typename M::VertexHandle> vertex_vector;
|
std::vector<typename M::VertexHandle> vertex_vector;
|
||||||
@@ -826,15 +826,15 @@ 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);
|
vertex_vector.push_back(*fv_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!vertex_vector.empty()) {
|
while (!vertex_vector.empty()) {
|
||||||
|
|
||||||
vh = vertex_vector.back();
|
vh = vertex_vector.back();
|
||||||
vertex_vector.pop_back();
|
vertex_vector.pop_back();
|
||||||
|
|
||||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -874,7 +874,7 @@ void FF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
|
|||||||
|
|
||||||
this->update(_fh, _target_state);
|
this->update(_fh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour faces to level x-1
|
// raise all neighbor faces to level x-1
|
||||||
typename M::FaceFaceIter ff_it;
|
typename M::FaceFaceIter ff_it;
|
||||||
typename M::FaceHandle fh;
|
typename M::FaceHandle fh;
|
||||||
std::vector<typename M::FaceHandle> face_vector;
|
std::vector<typename M::FaceHandle> face_vector;
|
||||||
@@ -901,11 +901,11 @@ void FF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
|
|||||||
|
|
||||||
while (!face_vector.empty()) {
|
while (!face_vector.empty()) {
|
||||||
|
|
||||||
fh = face_vector.back();
|
fh = face_vector.back();
|
||||||
face_vector.pop_back();
|
face_vector.pop_back();
|
||||||
|
|
||||||
while (MOBJ(fh).state() < _target_state - 1)
|
while (MOBJ(fh).state() < _target_state - 1)
|
||||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -938,7 +938,7 @@ void FFc<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
|
|||||||
|
|
||||||
this->update(_fh, _target_state);
|
this->update(_fh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour faces to level x-1
|
// raise all neighbor faces to level x-1
|
||||||
typename M::FaceFaceIter ff_it(Base::mesh_.ff_iter(_fh));
|
typename M::FaceFaceIter ff_it(Base::mesh_.ff_iter(_fh));
|
||||||
typename M::FaceHandle fh;
|
typename M::FaceHandle fh;
|
||||||
std::vector<typename M::FaceHandle> face_vector;
|
std::vector<typename M::FaceHandle> face_vector;
|
||||||
@@ -955,7 +955,7 @@ void FFc<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
|
|||||||
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)
|
for (ff_it = Base::mesh_.ff_iter(_fh); ff_it.is_valid(); ++ff_it)
|
||||||
face_vector.push_back(*ff_it);
|
face_vector.push_back(*ff_it);
|
||||||
|
|
||||||
while (!face_vector.empty()) {
|
while (!face_vector.empty()) {
|
||||||
@@ -972,7 +972,7 @@ void FFc<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
|
|||||||
typename M::Point position(0.0, 0.0, 0.0);
|
typename M::Point position(0.0, 0.0, 0.0);
|
||||||
int valence(0);
|
int valence(0);
|
||||||
|
|
||||||
for (ff_it = Base::mesh_.ff_iter(_fh); ff_it; ++ff_it)
|
for (ff_it = Base::mesh_.ff_iter(_fh); ff_it.is_valid(); ++ff_it)
|
||||||
{
|
{
|
||||||
++valence;
|
++valence;
|
||||||
position += Base::mesh_.data(ff_it).position(_target_state - 1);
|
position += Base::mesh_.data(ff_it).position(_target_state - 1);
|
||||||
@@ -1003,7 +1003,7 @@ void FV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
|
|
||||||
this->update(_vh, _target_state);
|
this->update(_vh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour vertices to level x-1
|
// raise all neighbor vertices to level x-1
|
||||||
typename M::VertexFaceIter vf_it(Base::mesh_.vf_iter(_vh));
|
typename M::VertexFaceIter vf_it(Base::mesh_.vf_iter(_vh));
|
||||||
typename M::FaceHandle fh;
|
typename M::FaceHandle fh;
|
||||||
std::vector<typename M::FaceHandle> face_vector;
|
std::vector<typename M::FaceHandle> face_vector;
|
||||||
@@ -1023,7 +1023,7 @@ void FV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
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) {
|
for (vf_it = Base::mesh_.vf_iter(_vh); vf_it.is_valid(); ++vf_it) {
|
||||||
|
|
||||||
face_vector.push_back(*vf_it);
|
face_vector.push_back(*vf_it);
|
||||||
}
|
}
|
||||||
@@ -1042,7 +1042,7 @@ void FV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
typename M::Point position(0.0, 0.0, 0.0);
|
typename M::Point position(0.0, 0.0, 0.0);
|
||||||
int valence(0);
|
int valence(0);
|
||||||
|
|
||||||
for (vf_it = Base::mesh_.vf_iter(_vh); vf_it; ++vf_it) {
|
for (vf_it = Base::mesh_.vf_iter(_vh); vf_it.is_valid(); ++vf_it) {
|
||||||
|
|
||||||
++valence;
|
++valence;
|
||||||
position += Base::mesh_.data(vf_it).position(_target_state - 1);
|
position += Base::mesh_.data(vf_it).position(_target_state - 1);
|
||||||
@@ -1082,69 +1082,69 @@ void FVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
// raise all neighbour faces to level x-1
|
// raise all neighbour faces to level x-1
|
||||||
if (_target_state > 1) {
|
if (_target_state > 1) {
|
||||||
|
|
||||||
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
|
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it.is_valid(); ++voh_it) {
|
||||||
|
|
||||||
if (Base::mesh_.FH(*voh_it).is_valid()) {
|
if (Base::mesh_.FH(*voh_it).is_valid()) {
|
||||||
|
|
||||||
face_vector.push_back(Base::mesh_.FH(*voh_it));
|
face_vector.push_back(Base::mesh_.FH(*voh_it));
|
||||||
|
|
||||||
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
|
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
|
||||||
|
|
||||||
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))));
|
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!face_vector.empty()) {
|
while (!face_vector.empty()) {
|
||||||
|
|
||||||
fh = face_vector.back();
|
fh = face_vector.back();
|
||||||
face_vector.pop_back();
|
face_vector.pop_back();
|
||||||
|
|
||||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
|
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it.is_valid(); ++voh_it) {
|
||||||
|
|
||||||
if (Base::mesh_.FH(*voh_it).is_valid()) {
|
if (Base::mesh_.FH(*voh_it).is_valid()) {
|
||||||
|
|
||||||
face_vector.push_back(Base::mesh_.FH(*voh_it));
|
face_vector.push_back(Base::mesh_.FH(*voh_it));
|
||||||
|
|
||||||
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
|
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
|
||||||
|
|
||||||
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))));
|
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!face_vector.empty()) {
|
while (!face_vector.empty()) {
|
||||||
|
|
||||||
fh = face_vector.back();
|
fh = face_vector.back();
|
||||||
face_vector.pop_back();
|
face_vector.pop_back();
|
||||||
|
|
||||||
while (MOBJ(fh).state() < _target_state - 1)
|
while (MOBJ(fh).state() < _target_state - 1)
|
||||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
|
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it.is_valid(); ++voh_it) {
|
||||||
|
|
||||||
if (Base::mesh_.FH(*voh_it).is_valid()) {
|
if (Base::mesh_.FH(*voh_it).is_valid()) {
|
||||||
|
|
||||||
face_vector.push_back(Base::mesh_.FH(*voh_it));
|
face_vector.push_back(Base::mesh_.FH(*voh_it));
|
||||||
|
|
||||||
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
|
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
|
||||||
|
|
||||||
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))));
|
face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!face_vector.empty()) {
|
while (!face_vector.empty()) {
|
||||||
|
|
||||||
fh = face_vector.back();
|
fh = face_vector.back();
|
||||||
face_vector.pop_back();
|
face_vector.pop_back();
|
||||||
|
|
||||||
while (MOBJ(fh).state() < _target_state - 1)
|
while (MOBJ(fh).state() < _target_state - 1)
|
||||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1168,33 +1168,33 @@ void FVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
|
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it.is_valid(); ++voh_it) {
|
||||||
|
|
||||||
fh = Base::mesh_.FH(*voh_it);
|
fh = Base::mesh_.FH(*voh_it);
|
||||||
if (fh.is_valid())
|
if (fh.is_valid())
|
||||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||||
|
|
||||||
fh = Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)));
|
fh = Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)));
|
||||||
if (fh.is_valid())
|
if (fh.is_valid())
|
||||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||||
|
|
||||||
if (Base::mesh_.FH(*voh_it).is_valid()) {
|
if (Base::mesh_.FH(*voh_it).is_valid()) {
|
||||||
|
|
||||||
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
|
if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) {
|
||||||
|
|
||||||
position += MOBJ(Base::mesh_.FH(*voh_it)).position(_target_state - 1) * c;
|
position += MOBJ(Base::mesh_.FH(*voh_it)).position(_target_state - 1) * c;
|
||||||
|
|
||||||
position += MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)))).position(_target_state - 1) * (1.0 - c);
|
position += MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)))).position(_target_state - 1) * (1.0 - c);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
position += MOBJ(Base::mesh_.FH(*voh_it)).position(_target_state - 1);
|
position += MOBJ(Base::mesh_.FH(*voh_it)).position(_target_state - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
||||||
--valence;
|
--valence;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1247,37 +1247,37 @@ void VV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
{
|
{
|
||||||
this->update(_vh, _target_state);
|
this->update(_vh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour vertices to level x-1
|
// raise all neighbor vertices to level x-1
|
||||||
typename M::VertexVertexIter vv_it(Base::mesh_.vv_iter(_vh));
|
typename M::VertexVertexIter vv_it(Base::mesh_.vv_iter(_vh));
|
||||||
typename M::VertexHandle vh;
|
typename M::VertexHandle vh;
|
||||||
std::vector<typename M::VertexHandle> vertex_vector;
|
std::vector<typename M::VertexHandle> vertex_vector;
|
||||||
|
|
||||||
if (_target_state > 1) {
|
if (_target_state > 1) {
|
||||||
|
|
||||||
for (; vv_it; ++vv_it) {
|
for (; vv_it.is_valid(); ++vv_it) {
|
||||||
|
|
||||||
vertex_vector.push_back(*vv_it);
|
vertex_vector.push_back(*vv_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!vertex_vector.empty()) {
|
while (!vertex_vector.empty()) {
|
||||||
|
|
||||||
vh = vertex_vector.back();
|
vh = vertex_vector.back();
|
||||||
vertex_vector.pop_back();
|
vertex_vector.pop_back();
|
||||||
|
|
||||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; vv_it; ++vv_it) {
|
for (; vv_it.is_valid(); ++vv_it) {
|
||||||
|
|
||||||
vertex_vector.push_back(*vv_it);
|
vertex_vector.push_back(*vv_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!vertex_vector.empty()) {
|
while (!vertex_vector.empty()) {
|
||||||
|
|
||||||
vh = vertex_vector.back();
|
vh = vertex_vector.back();
|
||||||
vertex_vector.pop_back();
|
vertex_vector.pop_back();
|
||||||
|
|
||||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1285,7 +1285,7 @@ void VV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
typename M::Point position(0.0, 0.0, 0.0);
|
typename M::Point position(0.0, 0.0, 0.0);
|
||||||
int valence(0);
|
int valence(0);
|
||||||
|
|
||||||
for (vv_it = Base::mesh_.vv_iter(_vh); vv_it; ++vv_it) {
|
for (vv_it = Base::mesh_.vv_iter(_vh); vv_it.is_valid(); ++vv_it) {
|
||||||
|
|
||||||
++valence;
|
++valence;
|
||||||
|
|
||||||
@@ -1317,37 +1317,37 @@ void VVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
|
|
||||||
this->update(_vh, _target_state);
|
this->update(_vh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour vertices to level x-1
|
// raise all neighbor vertices to level x-1
|
||||||
typename M::VertexVertexIter vv_it(Base::mesh_.vv_iter(_vh));
|
typename M::VertexVertexIter vv_it(Base::mesh_.vv_iter(_vh));
|
||||||
typename M::VertexHandle vh;
|
typename M::VertexHandle vh;
|
||||||
std::vector<typename M::VertexHandle> vertex_vector;
|
std::vector<typename M::VertexHandle> vertex_vector;
|
||||||
|
|
||||||
if (_target_state > 1) {
|
if (_target_state > 1) {
|
||||||
|
|
||||||
for (; vv_it; ++vv_it) {
|
for (; vv_it.is_valid(); ++vv_it) {
|
||||||
|
|
||||||
vertex_vector.push_back(*vv_it);
|
vertex_vector.push_back(*vv_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!vertex_vector.empty()) {
|
while (!vertex_vector.empty()) {
|
||||||
|
|
||||||
vh = vertex_vector.back();
|
vh = vertex_vector.back();
|
||||||
vertex_vector.pop_back();
|
vertex_vector.pop_back();
|
||||||
|
|
||||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; vv_it; ++vv_it) {
|
for (; vv_it.is_valid(); ++vv_it) {
|
||||||
|
|
||||||
vertex_vector.push_back(*vv_it);
|
vertex_vector.push_back(*vv_it);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!vertex_vector.empty()) {
|
while (!vertex_vector.empty()) {
|
||||||
|
|
||||||
vh = vertex_vector.back();
|
vh = vertex_vector.back();
|
||||||
vertex_vector.pop_back();
|
vertex_vector.pop_back();
|
||||||
|
|
||||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1356,7 +1356,7 @@ void VVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
int valence(0);
|
int valence(0);
|
||||||
typename M::Scalar c;
|
typename M::Scalar c;
|
||||||
|
|
||||||
for (vv_it = Base::mesh_.vv_iter(_vh); vv_it; ++vv_it)
|
for (vv_it = Base::mesh_.vv_iter(_vh); vv_it.is_valid(); ++vv_it)
|
||||||
{
|
{
|
||||||
++valence;
|
++valence;
|
||||||
position += Base::mesh_.data(vv_it).position(_target_state - 1);
|
position += Base::mesh_.data(vv_it).position(_target_state - 1);
|
||||||
@@ -1364,7 +1364,7 @@ void VVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
|
|
||||||
position /= valence;
|
position /= valence;
|
||||||
|
|
||||||
// choose coefficcient c
|
// choose coefficient c
|
||||||
c = Base::coeff();
|
c = Base::coeff();
|
||||||
|
|
||||||
position *= (1.0 - c);
|
position *= (1.0 - c);
|
||||||
@@ -1434,10 +1434,10 @@ void VdE<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
|
|||||||
{
|
{
|
||||||
this->update(_eh, _target_state);
|
this->update(_eh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour vertices to level x-1
|
// raise all neighbor vertices to level x-1
|
||||||
typename M::VertexHandle vh;
|
typename M::VertexHandle vh;
|
||||||
typename M::HalfedgeHandle hh1(Base::mesh_.HEH(_eh, 0)),
|
typename M::HalfedgeHandle hh1(Base::mesh_.HEH(_eh, 0)),
|
||||||
hh2(Base::mesh_.HEH(_eh, 1));
|
hh2(Base::mesh_.HEH(_eh, 1));
|
||||||
typename M::FaceHandle fh1, fh2;
|
typename M::FaceHandle fh1, fh2;
|
||||||
|
|
||||||
if (_target_state > 1) {
|
if (_target_state > 1) {
|
||||||
@@ -1447,18 +1447,18 @@ void VdE<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
|
|||||||
|
|
||||||
if (fh1.is_valid()) {
|
if (fh1.is_valid()) {
|
||||||
|
|
||||||
Base::prev_rule()->raise(fh1, _target_state - 1);
|
Base::prev_rule()->raise(fh1, _target_state - 1);
|
||||||
|
|
||||||
vh = Base::mesh_.TVH(Base::mesh_.NHEH(hh1));
|
vh = Base::mesh_.TVH(Base::mesh_.NHEH(hh1));
|
||||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fh2.is_valid()) {
|
if (fh2.is_valid()) {
|
||||||
|
|
||||||
Base::prev_rule()->raise(fh2, _target_state - 1);
|
Base::prev_rule()->raise(fh2, _target_state - 1);
|
||||||
|
|
||||||
vh = Base::mesh_.TVH(Base::mesh_.NHEH(hh2));
|
vh = Base::mesh_.TVH(Base::mesh_.NHEH(hh2));
|
||||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
vh = Base::mesh_.TVH(hh1);
|
vh = Base::mesh_.TVH(hh1);
|
||||||
@@ -1510,7 +1510,7 @@ VdEc<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
|
|||||||
{
|
{
|
||||||
this->update(_eh, _target_state);
|
this->update(_eh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour vertices to level x-1
|
// raise all neighbor vertices to level x-1
|
||||||
typename M::VertexHandle vh;
|
typename M::VertexHandle vh;
|
||||||
typename M::HalfedgeHandle hh1(Base::mesh_.HEH(_eh, 0)),
|
typename M::HalfedgeHandle hh1(Base::mesh_.HEH(_eh, 0)),
|
||||||
hh2(Base::mesh_.HEH(_eh, 1));
|
hh2(Base::mesh_.HEH(_eh, 1));
|
||||||
@@ -1533,10 +1533,10 @@ VdEc<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
|
|||||||
|
|
||||||
while (!vertex_vector.empty()) {
|
while (!vertex_vector.empty()) {
|
||||||
|
|
||||||
vh = vertex_vector.back();
|
vh = vertex_vector.back();
|
||||||
vertex_vector.pop_back();
|
vertex_vector.pop_back();
|
||||||
|
|
||||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
vertex_vector.push_back(Base::mesh_.TVH(hh1));
|
vertex_vector.push_back(Base::mesh_.TVH(hh1));
|
||||||
@@ -1547,10 +1547,10 @@ VdEc<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
|
|||||||
|
|
||||||
while (!vertex_vector.empty()) {
|
while (!vertex_vector.empty()) {
|
||||||
|
|
||||||
vh = vertex_vector.back();
|
vh = vertex_vector.back();
|
||||||
vertex_vector.pop_back();
|
vertex_vector.pop_back();
|
||||||
|
|
||||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1586,14 +1586,14 @@ void EV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
|
|
||||||
this->update(_vh, _target_state);
|
this->update(_vh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour vertices to level x-1
|
// raise all neighbor vertices to level x-1
|
||||||
typename M::VertexEdgeIter ve_it(Base::mesh_.ve_iter(_vh));
|
typename M::VertexEdgeIter ve_it(Base::mesh_.ve_iter(_vh));
|
||||||
typename M::EdgeHandle eh;
|
typename M::EdgeHandle eh;
|
||||||
std::vector<typename M::EdgeHandle> edge_vector;
|
std::vector<typename M::EdgeHandle> edge_vector;
|
||||||
|
|
||||||
if (_target_state > 1) {
|
if (_target_state > 1) {
|
||||||
|
|
||||||
for (; ve_it; ++ve_it) {
|
for (; ve_it.is_valid(); ++ve_it) {
|
||||||
|
|
||||||
edge_vector.push_back(*ve_it);
|
edge_vector.push_back(*ve_it);
|
||||||
}
|
}
|
||||||
@@ -1606,7 +1606,7 @@ void EV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
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) {
|
for (ve_it = Base::mesh_.ve_iter(_vh); ve_it.is_valid(); ++ve_it) {
|
||||||
|
|
||||||
edge_vector.push_back(*ve_it);
|
edge_vector.push_back(*ve_it);
|
||||||
}
|
}
|
||||||
@@ -1625,7 +1625,7 @@ void EV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
typename M::Point position(0.0, 0.0, 0.0);
|
typename M::Point position(0.0, 0.0, 0.0);
|
||||||
int valence(0);
|
int valence(0);
|
||||||
|
|
||||||
for (ve_it = Base::mesh_.ve_iter(_vh); ve_it; ++ve_it) {
|
for (ve_it = Base::mesh_.ve_iter(_vh); ve_it.is_valid(); ++ve_it) {
|
||||||
|
|
||||||
if (Base::mesh_.data(ve_it).final()) {
|
if (Base::mesh_.data(ve_it).final()) {
|
||||||
|
|
||||||
@@ -1671,34 +1671,34 @@ void EVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
|
|
||||||
if (_target_state > 1) {
|
if (_target_state > 1) {
|
||||||
|
|
||||||
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
|
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it.is_valid(); ++voh_it) {
|
||||||
|
|
||||||
face_vector.push_back(Base::mesh_.FH(*voh_it));
|
face_vector.push_back(Base::mesh_.FH(*voh_it));
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!face_vector.empty()) {
|
while (!face_vector.empty()) {
|
||||||
|
|
||||||
fh = face_vector.back();
|
fh = face_vector.back();
|
||||||
face_vector.pop_back();
|
face_vector.pop_back();
|
||||||
|
|
||||||
if (fh.is_valid())
|
if (fh.is_valid())
|
||||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) {
|
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it.is_valid(); ++voh_it) {
|
||||||
|
|
||||||
edge_vector.push_back(Base::mesh_.EH(*voh_it));
|
edge_vector.push_back(Base::mesh_.EH(*voh_it));
|
||||||
|
|
||||||
edge_vector.push_back(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it)));
|
edge_vector.push_back(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it)));
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!edge_vector.empty()) {
|
while (!edge_vector.empty()) {
|
||||||
|
|
||||||
eh = edge_vector.back();
|
eh = edge_vector.back();
|
||||||
edge_vector.pop_back();
|
edge_vector.pop_back();
|
||||||
|
|
||||||
while (MOBJ(eh).state() < _target_state - 1)
|
while (MOBJ(eh).state() < _target_state - 1)
|
||||||
Base::prev_rule()->raise(eh, _target_state - 1);
|
Base::prev_rule()->raise(eh, _target_state - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1712,21 +1712,21 @@ void EVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
|||||||
valence = Base::mesh_.valence(_vh);
|
valence = Base::mesh_.valence(_vh);
|
||||||
c = coeff( valence );
|
c = coeff( valence );
|
||||||
|
|
||||||
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it)
|
for (voh_it = Base::mesh_.voh_iter(_vh); voh_it.is_valid(); ++voh_it)
|
||||||
{
|
{
|
||||||
if (MOBJ(Base::mesh_.EH(*voh_it)).final())
|
if (MOBJ(Base::mesh_.EH(*voh_it)).final())
|
||||||
{
|
{
|
||||||
position += MOBJ(Base::mesh_.EH(*voh_it)).position(_target_state-1)*c;
|
position += MOBJ(Base::mesh_.EH(*voh_it)).position(_target_state-1)*c;
|
||||||
|
|
||||||
if ( Base::mesh_.FH(*voh_it).is_valid() &&
|
if ( Base::mesh_.FH(*voh_it).is_valid() &&
|
||||||
MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).final() &&
|
MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).final() &&
|
||||||
MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).position(_target_state - 1) != zero_point)
|
MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).position(_target_state - 1) != zero_point)
|
||||||
{
|
{
|
||||||
position += MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).position(_target_state-1) * (1.0-c);
|
position += MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).position(_target_state-1) * (1.0-c);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
position += MOBJ(Base::mesh_.EH(*voh_it)).position(_target_state - 1) * (1.0 - c);
|
position += MOBJ(Base::mesh_.EH(*voh_it)).position(_target_state - 1) * (1.0 - c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
--valence;
|
--valence;
|
||||||
@@ -1791,7 +1791,7 @@ EF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
|
|||||||
|
|
||||||
if (_target_state > 1) {
|
if (_target_state > 1) {
|
||||||
|
|
||||||
for (; fe_it; ++fe_it) {
|
for (; fe_it.is_valid(); ++fe_it) {
|
||||||
|
|
||||||
edge_vector.push_back(*fe_it);
|
edge_vector.push_back(*fe_it);
|
||||||
}
|
}
|
||||||
@@ -1804,7 +1804,7 @@ EF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
|
|||||||
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) {
|
for (fe_it = Base::mesh_.fe_iter(_fh); fe_it.is_valid(); ++fe_it) {
|
||||||
|
|
||||||
edge_vector.push_back(*fe_it);
|
edge_vector.push_back(*fe_it);
|
||||||
}
|
}
|
||||||
@@ -1823,7 +1823,7 @@ EF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
|
|||||||
typename M::Point position(0.0, 0.0, 0.0);
|
typename M::Point position(0.0, 0.0, 0.0);
|
||||||
int valence(0);
|
int valence(0);
|
||||||
|
|
||||||
for (fe_it = Base::mesh_.fe_iter(_fh); fe_it; ++fe_it) {
|
for (fe_it = Base::mesh_.fe_iter(_fh); fe_it.is_valid(); ++fe_it) {
|
||||||
|
|
||||||
if (Base::mesh_.data(fe_it).final()) {
|
if (Base::mesh_.data(fe_it).final()) {
|
||||||
|
|
||||||
@@ -1854,7 +1854,7 @@ FE<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state) {
|
|||||||
|
|
||||||
this->update(_eh, _target_state);
|
this->update(_eh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour faces to level x-1
|
// raise all neighbor faces to level x-1
|
||||||
typename M::FaceHandle fh;
|
typename M::FaceHandle fh;
|
||||||
|
|
||||||
if (_target_state > 1) {
|
if (_target_state > 1) {
|
||||||
@@ -1899,7 +1899,7 @@ EdE<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state) {
|
|||||||
|
|
||||||
this->update(_eh, _target_state);
|
this->update(_eh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour faces and edges to level x-1
|
// raise all neighbor faces and edges to level x-1
|
||||||
typename M::HalfedgeHandle hh1, hh2;
|
typename M::HalfedgeHandle hh1, hh2;
|
||||||
typename M::FaceHandle fh;
|
typename M::FaceHandle fh;
|
||||||
typename M::EdgeHandle eh;
|
typename M::EdgeHandle eh;
|
||||||
@@ -1956,7 +1956,7 @@ EdEc<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
|
|||||||
|
|
||||||
this->update(_eh, _target_state);
|
this->update(_eh, _target_state);
|
||||||
|
|
||||||
// raise all neighbour faces and edges to level x-1
|
// raise all neighbor faces and edges to level x-1
|
||||||
typename M::HalfedgeHandle hh1, hh2;
|
typename M::HalfedgeHandle hh1, hh2;
|
||||||
typename M::FaceHandle fh;
|
typename M::FaceHandle fh;
|
||||||
typename M::EdgeHandle eh;
|
typename M::EdgeHandle eh;
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ protected:
|
|||||||
size_t valence=0;
|
size_t valence=0;
|
||||||
|
|
||||||
pos = zero;
|
pos = zero;
|
||||||
for ( vvit = _m.vv_iter(vit); vvit; ++vvit)
|
for ( vvit = _m.vv_iter(vit); vvit.is_valid(); ++vvit)
|
||||||
{
|
{
|
||||||
pos += _m.point( vvit );
|
pos += _m.point( vvit );
|
||||||
++valence;
|
++valence;
|
||||||
@@ -232,12 +232,12 @@ protected:
|
|||||||
{
|
{
|
||||||
if ( (gen%2) && _m.is_boundary(fit))
|
if ( (gen%2) && _m.is_boundary(fit))
|
||||||
{
|
{
|
||||||
boundary_split( _m, fit );
|
boundary_split( _m, *fit );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fvit = _m.fv_iter( fit );
|
fvit = _m.fv_iter( *fit );
|
||||||
pos = _m.point( fvit);
|
pos = _m.point( *fvit);
|
||||||
pos += _m.point(++fvit);
|
pos += _m.point(++fvit);
|
||||||
pos += _m.point(++fvit);
|
pos += _m.point(++fvit);
|
||||||
pos *= _1over3;
|
pos *= _1over3;
|
||||||
|
|||||||
Reference in New Issue
Block a user