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;
|
||||
|
||||
@@ -100,11 +100,11 @@ PolyMesh_ArrayKernelT<MeshTraits>* MeshDual (PolyMesh_ArrayKernelT<MeshTraits> &
|
||||
{
|
||||
typename PolyMesh_ArrayKernelT<MeshTraits>::Point centerPoint(0,0,0);
|
||||
unsigned int degree= 0;
|
||||
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstFaceVertexIter vit=primal.cfv_iter(fit); vit; ++vit, ++degree)
|
||||
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstFaceVertexIter vit=primal.cfv_iter(fit); vit.is_valid(); ++vit, ++degree)
|
||||
centerPoint += primal.point(*vit);
|
||||
assert(degree!=0);
|
||||
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
|
||||
@@ -114,8 +114,8 @@ PolyMesh_ArrayKernelT<MeshTraits>* MeshDual (PolyMesh_ArrayKernelT<MeshTraits> &
|
||||
if(!primal.is_boundary(*vit))
|
||||
{
|
||||
face_vhandles.clear();
|
||||
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstVertexFaceIter fit=primal.cvf_iter(vit); fit; ++fit)
|
||||
face_vhandles.push_back(primal.property(primalToDual, fit));
|
||||
for(typename PolyMesh_ArrayKernelT<MeshTraits>::ConstVertexFaceIter fit=primal.cvf_iter(vit); fit.is_valid(); ++fit)
|
||||
face_vhandles.push_back(primal.property(primalToDual, *fit));
|
||||
dual->add_face(face_vhandles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,21 +108,21 @@ compute_new_positions_C0()
|
||||
{
|
||||
// compute umbrella
|
||||
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()));
|
||||
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 -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
|
||||
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(*v_it));
|
||||
|
||||
// damping
|
||||
u *= 0.5;
|
||||
|
||||
// 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;
|
||||
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)
|
||||
{
|
||||
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()));
|
||||
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 += vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
|
||||
@@ -165,11 +165,11 @@ compute_new_positions_C1()
|
||||
{
|
||||
uu = zero;
|
||||
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()));
|
||||
uu -= Base::mesh_.property(umbrellas_, vv_it);
|
||||
diag += (w * this->weight(vv_it) + 1.0) * w;
|
||||
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
||||
uu -= Base::mesh_.property(umbrellas_, *vv_it);
|
||||
diag += (w * this->weight(*vv_it) + 1.0) * w;
|
||||
}
|
||||
uu *= this->weight(v_it);
|
||||
diag *= this->weight(v_it);
|
||||
|
||||
@@ -172,7 +172,7 @@ set_active_vertices()
|
||||
active = active && !mesh_.status(v_it).feature();
|
||||
|
||||
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 ( 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)
|
||||
if (mesh_.is_boundary(v_it))
|
||||
for (vv_it=mesh_.vv_iter(v_it); vv_it; ++vv_it)
|
||||
mesh_.property(is_active_, vv_it) = false;
|
||||
for (vv_it=mesh_.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
|
||||
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)
|
||||
{
|
||||
mesh_.status(v_it).set_tagged(false);
|
||||
mesh_.status(v_it).set_tagged2(false);
|
||||
mesh_.status(*v_it).set_tagged(false);
|
||||
mesh_.status(*v_it).set_tagged2(false);
|
||||
}
|
||||
|
||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||
if (mesh_.is_boundary(v_it))
|
||||
for (vv_it=mesh_.vv_iter(v_it); vv_it; ++vv_it)
|
||||
mesh_.status(v_it).set_tagged(true);
|
||||
if (mesh_.is_boundary(*v_it))
|
||||
for (vv_it=mesh_.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
|
||||
mesh_.status(*v_it).set_tagged(true);
|
||||
|
||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||
if (mesh_.status(v_it).tagged())
|
||||
for (vv_it=mesh_.vv_iter(v_it); vv_it; ++vv_it)
|
||||
mesh_.status(v_it).set_tagged2(true);
|
||||
if (mesh_.status(*v_it).tagged())
|
||||
for (vv_it=mesh_.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
|
||||
mesh_.status(*v_it).set_tagged2(true);
|
||||
|
||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||
{
|
||||
if (mesh_.status(v_it).tagged2())
|
||||
mesh_.property(is_active_, vv_it) = false;
|
||||
mesh_.status(v_it).set_tagged(false);
|
||||
mesh_.status(v_it).set_tagged2(false);
|
||||
if (mesh_.status(*v_it).tagged2())
|
||||
mesh_.property(is_active_, *vv_it) = false;
|
||||
mesh_.status(*v_it).set_tagged(false);
|
||||
mesh_.status(*v_it).set_tagged2(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,7 +674,7 @@ void
|
||||
Tvv4<M>::split_edge(typename M::HalfedgeHandle &_hh,
|
||||
typename M::VertexHandle &_vh,
|
||||
state_t _target_state)
|
||||
{
|
||||
{
|
||||
typename M::HalfedgeHandle temp_hh;
|
||||
|
||||
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())
|
||||
{
|
||||
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
|
||||
{
|
||||
// two cases for divided, but not visited face
|
||||
if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.PHEH(Base::mesh_.OHEH(_hh))))).state()
|
||||
// two cases for divided, but not visited face
|
||||
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())
|
||||
{
|
||||
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()
|
||||
== MOBJ(Base::mesh_.FH(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())
|
||||
{
|
||||
temp_hh = Base::mesh_.NHEH(Base::mesh_.OHEH(_hh));
|
||||
}
|
||||
temp_hh = Base::mesh_.NHEH(Base::mesh_.OHEH(_hh));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -706,10 +706,10 @@ Tvv4<M>::split_edge(typename M::HalfedgeHandle &_hh,
|
||||
}
|
||||
else
|
||||
temp_hh = Base::mesh_.InvalidHalfedgeHandle;
|
||||
|
||||
|
||||
// split edge
|
||||
Base::mesh_.split(Base::mesh_.EH(_hh), _vh);
|
||||
|
||||
|
||||
if (Base::mesh_.FVH(_hh) == _vh)
|
||||
{
|
||||
MOBJ(Base::mesh_.EH(Base::mesh_.PHEH(Base::mesh_.OHEH(Base::mesh_.PHEH(_hh))))).set_state(MOBJ(Base::mesh_.EH(_hh)).state());
|
||||
@@ -817,7 +817,7 @@ void VF<M>::raise(typename M::FaceHandle& _fh, state_t _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::VertexHandle vh;
|
||||
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) {
|
||||
|
||||
vertex_vector.push_back(*fv_it);
|
||||
vertex_vector.push_back(*fv_it);
|
||||
}
|
||||
|
||||
while (!vertex_vector.empty()) {
|
||||
|
||||
vh = vertex_vector.back();
|
||||
vertex_vector.pop_back();
|
||||
vh = vertex_vector.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);
|
||||
|
||||
// raise all neighbour faces to level x-1
|
||||
// raise all neighbor faces to level x-1
|
||||
typename M::FaceFaceIter ff_it;
|
||||
typename M::FaceHandle fh;
|
||||
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()) {
|
||||
|
||||
fh = face_vector.back();
|
||||
face_vector.pop_back();
|
||||
fh = face_vector.back();
|
||||
face_vector.pop_back();
|
||||
|
||||
while (MOBJ(fh).state() < _target_state - 1)
|
||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||
while (MOBJ(fh).state() < _target_state - 1)
|
||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -938,7 +938,7 @@ void FFc<M>::raise(typename M::FaceHandle& _fh, state_t _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::FaceHandle fh;
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
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;
|
||||
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);
|
||||
|
||||
// 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::FaceHandle fh;
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -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);
|
||||
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;
|
||||
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
|
||||
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()) {
|
||||
|
||||
fh = face_vector.back();
|
||||
face_vector.pop_back();
|
||||
fh = face_vector.back();
|
||||
face_vector.pop_back();
|
||||
|
||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||
}
|
||||
|
||||
for (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()) {
|
||||
|
||||
fh = face_vector.back();
|
||||
face_vector.pop_back();
|
||||
fh = face_vector.back();
|
||||
face_vector.pop_back();
|
||||
|
||||
while (MOBJ(fh).state() < _target_state - 1)
|
||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||
while (MOBJ(fh).state() < _target_state - 1)
|
||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||
}
|
||||
|
||||
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()) {
|
||||
|
||||
fh = face_vector.back();
|
||||
face_vector.pop_back();
|
||||
fh = face_vector.back();
|
||||
face_vector.pop_back();
|
||||
|
||||
while (MOBJ(fh).state() < _target_state - 1)
|
||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||
while (MOBJ(fh).state() < _target_state - 1)
|
||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1168,43 +1168,43 @@ void FVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
||||
#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);
|
||||
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)));
|
||||
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(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);
|
||||
}
|
||||
else {
|
||||
position += MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)))).position(_target_state - 1) * (1.0 - c);
|
||||
}
|
||||
else {
|
||||
|
||||
position += MOBJ(Base::mesh_.FH(*voh_it)).position(_target_state - 1);
|
||||
}
|
||||
position += MOBJ(Base::mesh_.FH(*voh_it)).position(_target_state - 1);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
--valence;
|
||||
--valence;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
position /= valence;
|
||||
|
||||
MOBJ(_vh).set_position(_target_state, position);
|
||||
MOBJ(_vh).inc_state();
|
||||
|
||||
assert(MOBJ(_vh).state() == _target_state);
|
||||
|
||||
|
||||
// check if last rule
|
||||
if (Base::number() == Base::n_rules() - 1) {
|
||||
|
||||
@@ -1247,37 +1247,37 @@ void VV<M>::raise(typename M::VertexHandle& _vh, state_t _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::VertexHandle vh;
|
||||
std::vector<typename M::VertexHandle> vertex_vector;
|
||||
|
||||
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()) {
|
||||
|
||||
vh = vertex_vector.back();
|
||||
vertex_vector.pop_back();
|
||||
vh = vertex_vector.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()) {
|
||||
|
||||
vh = vertex_vector.back();
|
||||
vertex_vector.pop_back();
|
||||
vh = vertex_vector.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);
|
||||
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;
|
||||
|
||||
@@ -1317,37 +1317,37 @@ void VVc<M>::raise(typename M::VertexHandle& _vh, state_t _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::VertexHandle vh;
|
||||
std::vector<typename M::VertexHandle> vertex_vector;
|
||||
|
||||
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()) {
|
||||
|
||||
vh = vertex_vector.back();
|
||||
vertex_vector.pop_back();
|
||||
vh = vertex_vector.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()) {
|
||||
|
||||
vh = vertex_vector.back();
|
||||
vertex_vector.pop_back();
|
||||
vh = vertex_vector.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);
|
||||
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;
|
||||
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;
|
||||
|
||||
// choose coefficcient c
|
||||
// choose coefficient c
|
||||
c = Base::coeff();
|
||||
|
||||
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);
|
||||
|
||||
// raise all neighbour vertices to level x-1
|
||||
// raise all neighbor vertices to level x-1
|
||||
typename M::VertexHandle vh;
|
||||
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;
|
||||
|
||||
if (_target_state > 1) {
|
||||
@@ -1447,20 +1447,20 @@ void VdE<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
|
||||
|
||||
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));
|
||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||
vh = Base::mesh_.TVH(Base::mesh_.NHEH(hh1));
|
||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||
}
|
||||
|
||||
|
||||
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));
|
||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||
vh = Base::mesh_.TVH(Base::mesh_.NHEH(hh2));
|
||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||
}
|
||||
|
||||
|
||||
vh = Base::mesh_.TVH(hh1);
|
||||
Base::prev_rule()->raise(vh, _target_state - 1);
|
||||
|
||||
@@ -1510,7 +1510,7 @@ VdEc<M>::raise(typename M::EdgeHandle& _eh, state_t _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::HalfedgeHandle hh1(Base::mesh_.HEH(_eh, 0)),
|
||||
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()) {
|
||||
|
||||
vh = vertex_vector.back();
|
||||
vertex_vector.pop_back();
|
||||
vh = vertex_vector.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));
|
||||
@@ -1547,10 +1547,10 @@ VdEc<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
|
||||
|
||||
while (!vertex_vector.empty()) {
|
||||
|
||||
vh = vertex_vector.back();
|
||||
vertex_vector.pop_back();
|
||||
vh = vertex_vector.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);
|
||||
|
||||
// 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::EdgeHandle eh;
|
||||
std::vector<typename M::EdgeHandle> edge_vector;
|
||||
|
||||
if (_target_state > 1) {
|
||||
|
||||
for (; ve_it; ++ve_it) {
|
||||
for (; ve_it.is_valid(); ++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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -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);
|
||||
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()) {
|
||||
|
||||
@@ -1671,34 +1671,34 @@ void EVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
||||
|
||||
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()) {
|
||||
|
||||
fh = face_vector.back();
|
||||
face_vector.pop_back();
|
||||
fh = face_vector.back();
|
||||
face_vector.pop_back();
|
||||
|
||||
if (fh.is_valid())
|
||||
Base::prev_rule()->raise(fh, _target_state - 1);
|
||||
if (fh.is_valid())
|
||||
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()) {
|
||||
|
||||
eh = edge_vector.back();
|
||||
edge_vector.pop_back();
|
||||
eh = edge_vector.back();
|
||||
edge_vector.pop_back();
|
||||
|
||||
while (MOBJ(eh).state() < _target_state - 1)
|
||||
Base::prev_rule()->raise(eh, _target_state - 1);
|
||||
while (MOBJ(eh).state() < _target_state - 1)
|
||||
Base::prev_rule()->raise(eh, _target_state - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1712,21 +1712,21 @@ void EVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
|
||||
valence = Base::mesh_.valence(_vh);
|
||||
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())
|
||||
{
|
||||
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() &&
|
||||
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))).final() &&
|
||||
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);
|
||||
}
|
||||
else {
|
||||
position += MOBJ(Base::mesh_.EH(*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 {
|
||||
position += MOBJ(Base::mesh_.EH(*voh_it)).position(_target_state - 1) * (1.0 - c);
|
||||
}
|
||||
}
|
||||
else {
|
||||
--valence;
|
||||
@@ -1791,7 +1791,7 @@ EF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
|
||||
|
||||
if (_target_state > 1) {
|
||||
|
||||
for (; fe_it; ++fe_it) {
|
||||
for (; fe_it.is_valid(); ++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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -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);
|
||||
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()) {
|
||||
|
||||
@@ -1854,7 +1854,7 @@ FE<M>::raise(typename M::EdgeHandle& _eh, state_t _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;
|
||||
|
||||
if (_target_state > 1) {
|
||||
@@ -1899,7 +1899,7 @@ EdE<M>::raise(typename M::EdgeHandle& _eh, state_t _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::FaceHandle fh;
|
||||
typename M::EdgeHandle eh;
|
||||
@@ -1956,7 +1956,7 @@ EdEc<M>::raise(typename M::EdgeHandle& _eh, state_t _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::FaceHandle fh;
|
||||
typename M::EdgeHandle eh;
|
||||
|
||||
@@ -215,7 +215,7 @@ protected:
|
||||
size_t valence=0;
|
||||
|
||||
pos = zero;
|
||||
for ( vvit = _m.vv_iter(vit); vvit; ++vvit)
|
||||
for ( vvit = _m.vv_iter(vit); vvit.is_valid(); ++vvit)
|
||||
{
|
||||
pos += _m.point( vvit );
|
||||
++valence;
|
||||
@@ -232,12 +232,12 @@ protected:
|
||||
{
|
||||
if ( (gen%2) && _m.is_boundary(fit))
|
||||
{
|
||||
boundary_split( _m, fit );
|
||||
boundary_split( _m, *fit );
|
||||
}
|
||||
else
|
||||
{
|
||||
fvit = _m.fv_iter( fit );
|
||||
pos = _m.point( fvit);
|
||||
fvit = _m.fv_iter( *fit );
|
||||
pos = _m.point( *fvit);
|
||||
pos += _m.point(++fvit);
|
||||
pos += _m.point(++fvit);
|
||||
pos *= _1over3;
|
||||
|
||||
Reference in New Issue
Block a user