Skip to content
Snippets Groups Projects
Commit ca578da2 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

use old parser physical labels in tree too

parent 47284d20
Branches
Tags
No related merge requests found
...@@ -496,12 +496,14 @@ static void _add_region(GRegion *gr, Fl_Tree *tree, std::string path) ...@@ -496,12 +496,14 @@ static void _add_region(GRegion *gr, Fl_Tree *tree, std::string path)
} }
static void _add_physical_group(int dim, int num, std::vector<GEntity*> &ge, static void _add_physical_group(int dim, int num, std::vector<GEntity*> &ge,
std::map<int, std::string> &oldLabels,
Fl_Tree *tree, std::string path) Fl_Tree *tree, std::string path)
{ {
if(ge.empty()) return; if(ge.empty()) return;
std::string name; std::string name = ge[0]->model()->getPhysicalName(dim, num);
if(ge[0]->model()->getPhysicalName(dim, num).size()) if(name.empty() && oldLabels.count(num)) name = oldLabels[num];
name += std::string(" <<") + ge[0]->model()->getPhysicalName(dim, num) + ">>"; if(name.size()) name = std::string(" <<") + name + ">>";
Fl_Tree_Item *n; Fl_Tree_Item *n;
std::ostringstream group; std::ostringstream group;
group << path; group << path;
...@@ -591,10 +593,17 @@ static void _rebuild_tree_browser(bool force) ...@@ -591,10 +593,17 @@ static void _rebuild_tree_browser(bool force)
std::map<int, std::vector<GEntity*> > groups[4]; std::map<int, std::vector<GEntity*> > groups[4];
m->getPhysicalGroups(groups); m->getPhysicalGroups(groups);
std::map<int, std::string> oldLabels;
#if !defined(HAVE_NO_PARSER)
for(std::map<std::string, std::vector<double> >::iterator it = gmsh_yysymbols.begin();
it != gmsh_yysymbols.end(); ++it)
for(unsigned int i = 0; i < it->second.size(); i++)
oldLabels[(int)it->second[i]] = it->first;
#endif
for(int i = 3; i >= 0; i--) for(int i = 3; i >= 0; i--)
for(std::map<int, std::vector<GEntity*> >::iterator it = groups[i].begin(); for(std::map<int, std::vector<GEntity*> >::iterator it = groups[i].begin();
it != groups[i].end(); it++) it != groups[i].end(); it++)
_add_physical_group(i, it->first, it->second, _add_physical_group(i, it->first, it->second, oldLabels,
FlGui::instance()->visibility->tree, physical); FlGui::instance()->visibility->tree, physical);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment