diff --git a/Geo/GEdgeLoop.cpp b/Geo/GEdgeLoop.cpp index c1305259322426d0345808f0ba9d7e5029d59b70..0bd91a142bbf3ae9c4fe0af97a34c37443e97b70 100644 --- a/Geo/GEdgeLoop.cpp +++ b/Geo/GEdgeLoop.cpp @@ -116,13 +116,3 @@ GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire) } } - -GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire, const std::list<int> &dir) -{ - std::list<GEdge*>::const_iterator it = cwire.begin(); - std::list<int>::const_iterator itdir = dir.begin(); - for ( ; it != cwire.end() ; ++it,++itdir){ - loop.push_back(GEdgeSigned(*itdir,*it)); - } -} - diff --git a/Geo/GEdgeLoop.h b/Geo/GEdgeLoop.h index 621f1ad5934de30a6b9f43ce8120b9b9fdf303df..e086c7b202ccc8e5696c1938bd9a578f79245ab7 100644 --- a/Geo/GEdgeLoop.h +++ b/Geo/GEdgeLoop.h @@ -33,7 +33,6 @@ class GEdgeLoop typedef std::list<GEdgeSigned>::iterator iter; typedef std::list<GEdgeSigned>::const_iterator citer; GEdgeLoop(const std::list<GEdge*> &); - GEdgeLoop(const std::list<GEdge*> &, const std::list<int> &dir); inline iter begin() { return loop.begin(); } inline iter end() { return loop.end(); } inline citer begin() const { return loop.begin(); } diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp index dd043cf2dd5bfa6e733e352576e6405cd2ff0a39..a36735c2aec2495c3072acec3ff38f852fc4d03d 100644 --- a/Geo/GFace.cpp +++ b/Geo/GFace.cpp @@ -146,45 +146,6 @@ std::list<GVertex*> GFace::vertices() const return ret; } -std::vector<std::pair<GEdge*, int> > GFace::sortedEdges() const -{ - std::vector<std::pair<GEdge*, int> > sorted; - - if(l_dirs.size() == l_edges.size()){ - std::vector<std::pair<GEdge*, int> > tmp; - std::list<GEdge*>::const_iterator ite = l_edges.begin(); - std::list<int>::const_iterator itd = l_dirs.begin(); - while(ite != l_edges.end()){ - tmp.push_back(std::pair<GEdge*, int>(*ite, *itd)); - ite++; itd++; - } - if(tmp.size()){ - sorted.push_back(tmp.front()); - tmp.erase(tmp.begin()); - int check = 0; - while(sorted.size() < l_edges.size()){ - if(++check > l_edges.size()){ - Msg::Warning("Aborting sorted edge computation"); - break; - } - GVertex *v1 = (sorted.back().second > 0) ? sorted.back().first->getEndVertex() : - sorted.back().first->getBeginVertex(); - for(std::vector<std::pair<GEdge*, int> >::iterator it = tmp.begin(); - it != tmp.end(); it++){ - GVertex *v2 = (it->second > 0) ? it->first->getBeginVertex() : - it->first->getEndVertex(); - if(v1 == v2){ - sorted.push_back(*it); - tmp.erase(it); - break; - } - } - } - } - } - return sorted; -} - void GFace::setVisibility(char val, bool recursive) { GEntity::setVisibility(val); diff --git a/Geo/GFace.h b/Geo/GFace.h index dd578ae85057050ad48a92be76ac738dc8f878e0..d58780d47b9b21d7265cb6fa0676ba39499dcd8f 100644 --- a/Geo/GFace.h +++ b/Geo/GFace.h @@ -73,9 +73,6 @@ class GFace : public GEntity // edges that bound the face virtual std::list<GEdge*> edges() const { return l_edges; } - // edges that bound the face, sorted in a loop, with orientation - virtual std::vector<std::pair<GEdge*, int> > sortedEdges() const; - // edges that are embedded in the face virtual std::list<GEdge*> embeddedEdges() const { return embedded_edges; } diff --git a/Mesh/meshGFaceTransfinite.cpp b/Mesh/meshGFaceTransfinite.cpp index 1d8bd18987ec3c514e8f3a0285607593f0f57643..b1fcc3b93482ed0a9a0c4d33dac29b707f69ef1b 100644 --- a/Mesh/meshGFaceTransfinite.cpp +++ b/Mesh/meshGFaceTransfinite.cpp @@ -52,12 +52,9 @@ int MeshTransfiniteSurface(GFace *gf) } else{ // try to find the corners automatically - std::vector<std::pair<GEdge*, int> > bnd = gf->sortedEdges(); - for(unsigned int i = 0; i < bnd.size(); i++) - if(bnd[i].second > 0) - corners.push_back(bnd[i].first->getBeginVertex()->mesh_vertices[0]); - else - corners.push_back(bnd[i].first->getEndVertex()->mesh_vertices[0]); + GEdgeLoop el(gf->edges()); + for(GEdgeLoop::iter it = el.begin(); it != el.end(); it++) + corners.push_back(it->getBeginVertex()->mesh_vertices[0]); } if(corners.size () != 3 && corners.size () != 4){