From 975c2277bdce9bdf2ea7a9de9909b8a4e9becfb0 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 29 Mar 2008 22:58:45 +0000
Subject: [PATCH] *** empty log message ***

---
 Fltk/GUI.cpp               |  4 +++-
 Post/PViewDataGModelIO.cpp | 15 +++++++++++----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp
index 11bb9f24e4..956160d5e2 100644
--- a/Fltk/GUI.cpp
+++ b/Fltk/GUI.cpp
@@ -1,4 +1,4 @@
-// $Id: GUI.cpp,v 1.670 2008-03-29 10:19:36 geuzaine Exp $
+// $Id: GUI.cpp,v 1.671 2008-03-29 22:58:45 geuzaine Exp $
 //
 // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 //
@@ -1314,8 +1314,10 @@ void GUI::set_context(Context_Item * menu_asked, int flag)
                   (Fl_Callback *) view_save_txt_cb, (void *)nb, 0);
         p[j]->add("Save As/Gmsh Mesh...", 0, 
                   (Fl_Callback *) view_save_msh_cb, (void *)nb, 0);
+#if defined(HAVE_MED)
         p[j]->add("Save As/MED file...", 0, 
                   (Fl_Callback *) view_save_med_cb, (void *)nb, 0);
+#endif
         p[j]->add("Apply As Background Mesh", 0, 
                   (Fl_Callback *) view_applybgmesh_cb, (void *)nb, FL_MENU_DIVIDER);
         p[j]->add("Options...", 'o', 
diff --git a/Post/PViewDataGModelIO.cpp b/Post/PViewDataGModelIO.cpp
index 9bf52ea898..58344c178c 100644
--- a/Post/PViewDataGModelIO.cpp
+++ b/Post/PViewDataGModelIO.cpp
@@ -1,4 +1,4 @@
-// $Id: PViewDataGModelIO.cpp,v 1.18 2008-03-29 22:46:01 geuzaine Exp $
+// $Id: PViewDataGModelIO.cpp,v 1.19 2008-03-29 22:58:45 geuzaine Exp $
 //
 // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 //
@@ -275,8 +275,10 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
       }
 
       if(ent == MED_NOEUD){
-	std::vector<med_int> nodeTags(numVal);
-	if(MEDnumLire(fid, meshName, &nodeTags[0], numVal, MED_NOEUD, MED_NONE) < 0)
+	med_int numNodes = MEDnEntMaa(fid, meshName, MED_COOR, MED_NOEUD, 
+				      MED_NONE, (med_connectivite)0);
+	std::vector<med_int> nodeTags(numNodes);
+	if(MEDnumLire(fid, meshName, &nodeTags[0], numNodes, MED_NOEUD, MED_NONE) < 0)
 	  nodeTags.clear();
 	for(unsigned int i = 0; i < profile.size(); i++){
 	  int num = nodeTags.empty() ? profile[i] : nodeTags[profile[i] - 1];
@@ -284,7 +286,12 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
 	}
       }
       else{
-	// TODO!
+	// TODO... PS: since MED index elements by subgroups of
+	// elements of the same type, we need to define an order of
+	// element types in stepData and STICK WITH IT! We need a
+	// single routine to compute element order and indices, which
+	// can also map to element numbers (+ deal with special case
+	// for points)
       }
 
     }
-- 
GitLab