From fb40c36270d57e432c2307a2e6868b2bd4b12ced Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 5 Nov 2008 07:19:19 +0000 Subject: [PATCH] cleanup --- Geo/GEdgeLoop.cpp | 10 --------- Geo/GEdgeLoop.h | 1 - Geo/GFace.cpp | 39 ----------------------------------- Geo/GFace.h | 3 --- Mesh/meshGFaceTransfinite.cpp | 9 +++----- 5 files changed, 3 insertions(+), 59 deletions(-) diff --git a/Geo/GEdgeLoop.cpp b/Geo/GEdgeLoop.cpp index c130525932..0bd91a142b 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 621f1ad593..e086c7b202 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 dd043cf2dd..a36735c2ae 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 dd578ae850..d58780d47b 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 1d8bd18987..b1fcc3b934 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){ -- GitLab