Next changeset
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@907 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -101,7 +101,7 @@ void DecimaterT<Mesh>::heap_vertex(VertexHandle _vh) {
|
||||
|
||||
// find best target in one ring
|
||||
typename Mesh::VertexOHalfedgeIter voh_it(mesh_, _vh);
|
||||
for (; voh_it; ++voh_it) {
|
||||
for (; voh_it.is_valid(); ++voh_it) {
|
||||
heh = *voh_it;
|
||||
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) {
|
||||
heap_->reset_heap_position(v_it.handle());
|
||||
if (!mesh_.status(v_it).deleted())
|
||||
heap_vertex(v_it.handle());
|
||||
if (!mesh_.status(*v_it).deleted())
|
||||
heap_vertex(*v_it);
|
||||
}
|
||||
|
||||
// process heap
|
||||
@@ -189,7 +189,7 @@ size_t DecimaterT<Mesh>::decimate(size_t _n_collapses) {
|
||||
// store support (= one ring of *vp)
|
||||
vv_it = mesh_.vv_iter(ci.v0);
|
||||
support.clear();
|
||||
for (; vv_it; ++vv_it)
|
||||
for (; vv_it.is_valid(); ++vv_it)
|
||||
support.push_back(*vv_it);
|
||||
|
||||
// perform collapse
|
||||
@@ -198,9 +198,9 @@ size_t DecimaterT<Mesh>::decimate(size_t _n_collapses) {
|
||||
|
||||
// update triangle normals
|
||||
vf_it = mesh_.vf_iter(ci.v1);
|
||||
for (; vf_it; ++vf_it)
|
||||
if (!mesh_.status(vf_it).deleted())
|
||||
mesh_.set_normal(vf_it, mesh_.calc_face_normal(vf_it.handle()));
|
||||
for (; vf_it.is_valid(); ++vf_it)
|
||||
if (!mesh_.status(*vf_it).deleted())
|
||||
mesh_.set_normal(*vf_it, mesh_.calc_face_normal(*vf_it));
|
||||
|
||||
// post-process collapse
|
||||
this->postprocess_collapse(ci);
|
||||
|
||||
@@ -112,7 +112,7 @@ void ModAspectRatioT<MeshT>::preprocess_collapse(const CollapseInfo& _ci) {
|
||||
typename Mesh::FaceHandle fh;
|
||||
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;
|
||||
if (fh != _ci.fl && fh != _ci.fr) {
|
||||
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;
|
||||
p3 = &mesh_.point(v3);
|
||||
|
||||
while (vv_it) {
|
||||
while (vv_it.is_valid()) {
|
||||
v2 = v3;
|
||||
p2 = p3;
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ collapse_priority(const CollapseInfo& _ci)
|
||||
|
||||
// collect all points to be tested
|
||||
// collect all faces to be tested against
|
||||
for (vf_it=mesh_.vf_iter(_ci.v0); vf_it; ++vf_it) {
|
||||
for (vf_it=mesh_.vf_iter(_ci.v0); vf_it.is_valid(); ++vf_it) {
|
||||
fh = *vf_it;
|
||||
|
||||
if (fh != _ci.fl && fh != _ci.fr)
|
||||
@@ -289,7 +289,7 @@ postprocess_collapse(const CollapseInfo& _ci)
|
||||
faces.reserve(20);
|
||||
|
||||
// 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;
|
||||
faces.push_back(fh);
|
||||
|
||||
|
||||
@@ -82,8 +82,8 @@ class ModIndependentSetsT: public ModBaseT<MeshT> {
|
||||
|
||||
Base::mesh().status(_ci.v1).set_locked(true);
|
||||
vv_it = Base::mesh().vv_iter(_ci.v1);
|
||||
for (; vv_it; ++vv_it)
|
||||
Base::mesh().status(vv_it).set_locked(true);
|
||||
for (; vv_it.is_valid(); ++vv_it)
|
||||
Base::mesh().status(*vv_it).set_locked(true);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
if (_ci.v0vl.is_valid()) fhl = mesh_.face_handle(_ci.v0vl);
|
||||
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;
|
||||
if (fh != _ci.fl && fh != _ci.fr) {
|
||||
NormalCone nc = mesh_.property(normal_cones_, fh);
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
void postprocess_collapse(const CollapseInfo& _ci) {
|
||||
// account for changed normals
|
||||
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).
|
||||
merge(NormalCone(mesh_.normal(vf_it)));
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
typename Mesh::FaceHandle fh;
|
||||
typename Mesh::Scalar c(1.0);
|
||||
|
||||
for (; vf_it; ++vf_it)
|
||||
for (; vf_it.is_valid(); ++vf_it)
|
||||
{
|
||||
fh = *vf_it;
|
||||
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)));
|
||||
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;
|
||||
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)));
|
||||
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;
|
||||
fhB = fhC;
|
||||
|
||||
Reference in New Issue
Block a user