From 1534547f172240f855345033727c7c61b37c786f Mon Sep 17 00:00:00 2001
From: Francois Henrotte <francois.henrotte@ulg.ac.be>
Date: Tue, 5 Jun 2012 09:54:11 +0000
Subject: [PATCH] new model

---
 Fltk/onelabWindow.cpp | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp
index 6a0ad4b8b0..6472a8b357 100644
--- a/Fltk/onelabWindow.cpp
+++ b/Fltk/onelabWindow.cpp
@@ -801,10 +801,13 @@ void onelab_cb(Fl_Widget *w, void *data)
 
   do{ // enter loop
 
-    // the Gmsh client is special: it always gets executed first. (A
-    // special-puropose meta-model allows more flexibility: but in the simple
-    // GUI we can assume this)
-    runGmshClient(action);
+    //check whether the client is a onelab Metamodel
+    std::vector<onelab::number> n;
+    onelab::server::instance()->get(n,"HasGmsh");
+    bool metamodel = (n.size() && n[0].getValue());
+
+    // If the client is a NOT a metamodel Gmsh gets executed
+    if(!metamodel) runGmshClient(action);
 
     if(action == "compute")
       FlGui::instance()->onelab->checkForErrors("Gmsh");
@@ -828,6 +831,10 @@ void onelab_cb(Fl_Widget *w, void *data)
       if(FlGui::instance()->onelab->stop()) break;
     }
 
+    // update geometry in Gmsh window which might have been by the metamodel
+    //if(metamodel)
+    runGmshClient("check"); 
+
     if(action != "initialize"){
       updateOnelabGraphs();
       FlGui::instance()->onelab->rebuildTree();
-- 
GitLab