Skip to content
Snippets Groups Projects

new iterators and circulators

Merged Edwin Özdemir requested to merge Plugin-Remesher-updated into master
1 file
+ 14
14
Compare changes
  • Side-by-side
  • Inline
+ 14
14
@@ -175,17 +175,17 @@ void RemesherPlugin::computeInitValues() {
mesh->update_face_normals();
for(TriMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
for(auto e_it : mesh->edges()) {
TriMesh::HalfedgeHandle he = mesh->halfedge_handle(*e_it, 0);
OpenMesh::SmartHalfedgeHandle he = e_it.h0();
ACG::Vec3d vec_e = mesh->point(mesh->to_vertex_handle(he)) - mesh->point(mesh->from_vertex_handle(he));
ACG::Vec3d vec_e = mesh->point(he.to()) - mesh->point(he.from());
mean_edge += vec_e.length();
// Estimate feature angle
TriMesh::FaceHandle fh1 = mesh->face_handle(he);
TriMesh::FaceHandle fh2 = mesh->face_handle(mesh->opposite_halfedge_handle(he));
TriMesh::FaceHandle fh1 = he.face();
TriMesh::FaceHandle fh2 = he.opp().face();
// Boundary halfedge?
if ( !fh1.is_valid() || !fh2.is_valid() )
@@ -209,17 +209,17 @@ void RemesherPlugin::computeInitValues() {
mesh->update_face_normals();
for(PolyMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
for(auto e_it : mesh->edges()) {
PolyMesh::HalfedgeHandle he = mesh->halfedge_handle(*e_it, 0);
OpenMesh::SmartHalfedgeHandle he = e_it.h0();
ACG::Vec3d vec_e = mesh->point(mesh->to_vertex_handle(he)) - mesh->point(mesh->from_vertex_handle(he));
ACG::Vec3d vec_e = mesh->point(he.to()) - mesh->point(he.from());
mean_edge += vec_e.length();
// Estimate feature angle
PolyMesh::FaceHandle fh1 = mesh->face_handle(he);
PolyMesh::FaceHandle fh2 = mesh->face_handle(mesh->opposite_halfedge_handle(he));
PolyMesh::FaceHandle fh1 = he.face();
PolyMesh::FaceHandle fh2 = he.opp().face();
// Boundary halfedge?
if ( !fh1.is_valid() || !fh2.is_valid() )
@@ -384,10 +384,10 @@ void RemesherPlugin::uniformRemeshing(){
// Set incident vertices to feature edges to be feature vertices
TriMesh* mesh = PluginFunctions::triMesh(o_it->id());
if(!mesh) continue;
for(TriMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
if(mesh->status(*e_it).feature()) {
mesh->status(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0))).set_feature(true);
mesh->status(mesh->from_vertex_handle(mesh->halfedge_handle(*e_it, 0))).set_feature(true);
for(auto e_it : mesh->edges()) {
if(mesh->status(e_it).feature()) {
mesh->status(e_it.h0().to()).set_feature(true);
mesh->status(e_it.h0().from()).set_feature(true);
}
}
Loading