Index: trunk/SophyaPI/PIext/nobjmgr.cc
===================================================================
--- trunk/SophyaPI/PIext/nobjmgr.cc	(revision 330)
+++ trunk/SophyaPI/PIext/nobjmgr.cc	(revision 331)
@@ -65,8 +65,16 @@
 // ..................................................................
 // ......  Gestion des objets nommes, variables globales ............
+struct nobj_diritem {
+  int id;
+  int nobj;
+};
+
+typedef map<string, nobj_diritem, less<string> > NObjDirList;
+
 struct nobj_item {
   AnyDataObj* obj;
   NObjMgrAdapter* obja;
   int num;
+  int dirid;
   list<int> wrsid;
   bool operator==(nobj_item const& b) const
@@ -76,8 +84,10 @@
 typedef map<string, nobj_item, less<string> > NObjList;
 
-static NObjList* myObjs;
+static NObjDirList* myDirs = NULL;
+static NObjList* myObjs = NULL;
 static int fgOInit = 0;
 static int myNObj = 0;
-static string* lastobj = NULL;
+static int myDirId = 0;
+static string* currDir;
 
 static PIStdImgApp* myImgApp=NULL;
@@ -101,6 +111,7 @@
 {
 if (fgOInit == 0) { 
+  myDirs = new NObjDirList;
   myObjs = new NObjList;  
-  lastobj = new string(""); 
+  currDir = new string("home");
   char* varenv;
   TmpDir = new string("");
@@ -149,4 +160,29 @@
 {
 return(servnobjm);
+}
+
+/* --Methode-- */
+void NamedObjMgr::CreateDir(string const& dirname)
+{
+}
+
+/* --Methode-- */
+void NamedObjMgr::DeleteDir(string const& dirname)
+{
+}
+
+/* --Methode-- */
+void NamedObjMgr::SetCurrentDir(string const& dirname)
+{
+}
+
+/* --Methode-- */
+void NamedObjMgr::CleanTmpDir()
+{
+}
+
+/* --Methode-- */
+void NamedObjMgr::CleanOldDir()
+{
 }
 
@@ -169,11 +205,9 @@
 // void  RenameObj(string const& nom, string& nomnew)
 //	Change le nom d'un objet dans la liste.
-// string  LastObjName()
-//	Renvoie le nom du dernier objet ajouté à la liste
 //--
 
 
 /* --Methode-- */
-void NamedObjMgr::AddObj(AnyDataObj* obj, string& nom, bool)
+void NamedObjMgr::AddObj(AnyDataObj* obj, string & nom, bool)
 {
 
@@ -200,16 +234,15 @@
   }
 
-(*lastobj) = nom;
 nobj_item no;
 no.obj = obj;
 no.obja = servnobjm->GetAdapter(obj);  // L'adaptateur
 no.num =  myNObj;
-(*myObjs)[(*lastobj)] = no;
+(*myObjs)[nom] = no;
 if (myImgApp)  { 
-  string str = (*lastobj) + "    (T= " + typeid(*obj).name() + ")" ;
+  string str = nom + "    (T= " + typeid(*obj).name() + ")" ;
   (myImgApp->ObjMgrW())->AddObj(str.c_str(), myNObj+1000);
 }
  
-cout << "NamedObjMgr::AddObj()  Object " << (*lastobj) << " ( "  
+cout << "NamedObjMgr::AddObj()  Object " << nom << " ( "  
      << typeid(*obj).name() << " ) added (Total= " << myObjs->size() << ")" << endl;  
 return;
@@ -217,5 +250,15 @@
 
 /* --Methode-- */
-void NamedObjMgr::DelObj(string const& nom, bool fgd)
+void NamedObjMgr::RenameObj(string & nom, string& nomnew)
+{
+AnyDataObj* obj = GetObj(nom);
+if (obj == NULL) return;
+DelObj(nom, false);
+AddObj(obj, nomnew);
+return;
+}
+
+/* --Methode-- */
+void NamedObjMgr::DelObj(string & nom, bool fgd)
 {
 NObjList::iterator it = myObjs->find(nom);
@@ -237,5 +280,10 @@
 
 /* --Methode-- */
-void NamedObjMgr::DelObjects(string const& patt, bool fgd)
+void NamedObjMgr::DelObj_Id(int oid)
+{
+}
+
+/* --Methode-- */
+void NamedObjMgr::DelObjects(string & patt, bool fgd)
 {
 NObjList::iterator it;  
@@ -251,5 +299,5 @@
 
 /* --Methode-- */
-AnyDataObj* NamedObjMgr::GetObj(string const& nom)
+AnyDataObj* NamedObjMgr::GetObj(string & nom)
 {
 NObjList::iterator it = myObjs->find(nom);
@@ -259,5 +307,5 @@
 
 /* --Methode-- */
-NObjMgrAdapter* NamedObjMgr::GetObjAdapter(string const& nom)
+NObjMgrAdapter* NamedObjMgr::GetObjAdapter(string & nom)
 {
 NObjList::iterator it = myObjs->find(nom);
@@ -267,17 +315,29 @@
 
 /* --Methode-- */
-void NamedObjMgr::RenameObj(string const& nom, string& nomnew)
-{
-AnyDataObj* obj = GetObj(nom);
-if (obj == NULL) return;
-DelObj(nom, false);
-AddObj(obj, nomnew);
-return;
-}
-
-/* --Methode-- */
-string NamedObjMgr::LastObjName()
-{
-return((*lastobj));
+void NamedObjMgr::ListObjs(string & patt)
+{
+int k;
+AnyDataObj* obj=NULL;
+string ctyp;
+char strg[256];
+
+cout << "NamedObjMgr::ListObjs() NObjs= " << myObjs->size() << "\n" ;
+NObjList::iterator it;  k = 0;
+for(it = myObjs->begin(); it != myObjs->end(); it++) {
+  obj = (*it).second.obj;
+
+  ctyp = typeid(*obj).name();
+  sprintf(strg, "%2d/ %16s : %s", k, typeid(*obj).name(), ((*it).first).c_str()); 
+  ctyp = strg;
+  cout << ctyp << "\n" ;
+  k++;
+}
+cout << endl;
+return;
+}
+
+/* --Methode-- */
+void NamedObjMgr::GetObjList(string & patt, vector<string> &)
+{
 }
 
@@ -297,5 +357,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::ReadObj(string const & flnm, string nobj)
+void NamedObjMgr::ReadObj(string const & flnm, string & nobj)
 {
 PPersist* obj=NULL;
@@ -387,5 +447,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::ReadFits(string const & flnm, string nobj)
+void NamedObjMgr::ReadFits(string const & flnm, string & nobj)
 {
 bool ok = true;
@@ -415,5 +475,5 @@
 static int key_for_write = 5000;
 /* --Methode-- */
-void NamedObjMgr::SaveObj(string const& nom, POutPersist& s)
+void NamedObjMgr::SaveObj(string & nom, POutPersist& s)
 {
 NObjMgrAdapter* obja=NULL;
@@ -445,5 +505,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::SaveFits(string const& nom, string const & flnm)
+void NamedObjMgr::SaveFits(string& nom, string const & flnm)
 {
 NObjMgrAdapter* obja=NULL;
@@ -455,29 +515,7 @@
 
 
-/* --Methode-- */
-void NamedObjMgr::ListObjs()
-{
-int k;
-AnyDataObj* obj=NULL;
-string ctyp;
-char strg[256];
-
-cout << "NamedObjMgr::ListObjs() NObjs= " << myObjs->size() << "\n" ;
-NObjList::iterator it;  k = 0;
-for(it = myObjs->begin(); it != myObjs->end(); it++) {
-  obj = (*it).second.obj;
-
-  ctyp = typeid(*obj).name();
-  sprintf(strg, "%2d/ %16s : %s", k, typeid(*obj).name(), ((*it).first).c_str()); 
-  ctyp = strg;
-  cout << ctyp << "\n" ;
-  k++;
-}
-cout << endl;
-return;
-}
-
-/* --Methode-- */
-void NamedObjMgr::PrintObj(string const& nom)
+
+/* --Methode-- */
+void NamedObjMgr::PrintObj(string& nom)
 {
 NObjMgrAdapter* obja=NULL;
@@ -493,5 +531,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::DisplayObj(string const& nom, string dopt) 
+void NamedObjMgr::DisplayObj(string& nom, string dopt) 
 {
 NObjMgrAdapter* obja=NULL;
@@ -535,5 +573,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::DisplayImage(string const& nom, string dopt)
+void NamedObjMgr::DisplayImage(string& nom, string dopt)
 {
 NObjMgrAdapter* obja=NULL;
@@ -567,5 +605,5 @@
 }
 /* --Methode-- */
-void NamedObjMgr::DisplaySurf3D(string const& nom, string dopt)
+void NamedObjMgr::DisplaySurf3D(string& nom, string dopt)
 {
 NObjMgrAdapter* obja=NULL;
@@ -608,5 +646,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::DisplayNT(string const& nom, string& nmx, string& nmy, string& nmz,
+void NamedObjMgr::DisplayNT(string& nom, string& nmx, string& nmy, string& nmz,
                             string& erx, string& ery, string& erz, string dopt)
 {
@@ -657,5 +695,5 @@
 
 /* --Methode-- cmv 13/10/98 */
-void NamedObjMgr::DisplayGFD(string const& nom, string& numvarx, string& numvary, string& err, string dopt)
+void NamedObjMgr::DisplayGFD(string& nom, string& numvarx, string& numvary, string& err, string dopt)
 //	Pour le display 2D ou 3D d'un ``GeneralFitData''.
 //|  nom = nom de l'objet GeneralFitData a representer.
@@ -719,5 +757,5 @@
 
 /* --Methode-- 
-void NamedObjMgr::DisplayImage(string const& nom, string dopt)
+void NamedObjMgr::DisplayImage(string& nom, string dopt)
 {
   cout << "NamedObjMgr::DisplayImage() a faire ! " << endl;
@@ -743,5 +781,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::DisplayPoints2D(string const& nom,  string& expx, string& expy,
+void NamedObjMgr::DisplayPoints2D(string& nom,  string& expx, string& expy,
                                   string& experrx, string& experry,
                                   string& expcut, string dopt)
@@ -787,5 +825,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::DisplayPoints3D(string const& nom,  string& expx, string& expy, string& expz,
+void NamedObjMgr::DisplayPoints3D(string& nom,  string& expx, string& expy, string& expz,
                                   string& expcut, string dopt)
 {
@@ -829,5 +867,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::ProjectH1(string const& nom, string& expx, string& expwt, string& expcut, string& nomh1, string dopt)
+void NamedObjMgr::ProjectH1(string& nom, string& expx, string& expwt, string& expcut, string& nomh1, string dopt)
 {
 NObjMgrAdapter* obja=NULL;
@@ -877,5 +915,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::ProjectH2(string const& nom, string& expx, string& expy, string& expwt, string& expcut, 
+void NamedObjMgr::ProjectH2(string& nom, string& expx, string& expy, string& expwt, string& expcut, 
                             string& nomh2, string dopt)
 {
@@ -928,5 +966,5 @@
 
 /* --Methode-- cmv 13/10/98 */
-void NamedObjMgr::ProjectHProf(string const& nom, string& expx, string& expy, string& expwt, string& expcut, 
+void NamedObjMgr::ProjectHProf(string& nom, string& expx, string& expy, string& expwt, string& expcut, 
                               string& nomprof, string dopt)
 //	Pour remplir un ``GeneralFitData'' a partir de divers objets:
@@ -988,5 +1026,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::FillVect(string const& nom, string& expx, string& expcut, string& nomvec, string dopt)
+void NamedObjMgr::FillVect(string& nom, string& expx, string& expcut, string& nomvec, string dopt)
 {
 NObjMgrAdapter* obja=NULL;
@@ -1029,5 +1067,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::FillNT(string const& nom, string& expx, string& expy, string& expz, string& expt, 
+void NamedObjMgr::FillNT(string& nom, string& expx, string& expy, string& expz, string& expt, 
                          string& expcut, string& nomnt)
 {
@@ -1066,5 +1104,5 @@
 
 /* --Methode-- cmv 13/10/98 */
-void NamedObjMgr::FillGFD(string const& nom, string& expx, string& expy, string& expz,
+void NamedObjMgr::FillGFD(string& nom, string& expx, string& expy, string& expz,
                           string& experr, string& expcut, string& nomgfd)
 //	Pour remplir un ``GeneralFitData'' a partir de divers objets:
@@ -1246,5 +1284,5 @@
 
 /* --Methode-- cmv 13/10/98 */
-void  NamedObjMgr:: Fit12D(string const& nom, string& func,
+void  NamedObjMgr:: Fit12D(string& nom, string& func,
                           string par,string step,string min,string max,
                           string opt)
