| [165] | 1 | // This may look like C code, but it is really -*- C++ -*- | 
|---|
|  | 2 | // Classe de gestion d objets nommes pour piapp | 
|---|
|  | 3 | // Reza      Aout 97 , Juillet,Aout 98 | 
|---|
|  | 4 | // CEA-DAPNIA      LAL-IN2P3/CNRS | 
|---|
|  | 5 |  | 
|---|
|  | 6 | #ifndef NOBJMGR_H_SEEN | 
|---|
|  | 7 | #define NOBJMGR_H_SEEN | 
|---|
|  | 8 |  | 
|---|
| [331] | 9 | #include "machdefs.h" | 
|---|
| [1164] | 10 |  | 
|---|
|  | 11 | #include <fstream.h> | 
|---|
|  | 12 | #include <string> | 
|---|
|  | 13 | #include <vector> | 
|---|
|  | 14 |  | 
|---|
| [331] | 15 | #include "anydataobj.h" | 
|---|
| [495] | 16 | #include "ppersist.h" | 
|---|
| [1164] | 17 | #include "dvlist.h" | 
|---|
| [165] | 18 | #include "dlftypes.h" | 
|---|
|  | 19 |  | 
|---|
| [331] | 20 |  | 
|---|
| [295] | 21 | class NObjMgrAdapter; | 
|---|
| [165] | 22 | class PIStdImgApp; | 
|---|
|  | 23 | class Services2NObjMgr; | 
|---|
|  | 24 |  | 
|---|
|  | 25 | class NamedObjMgr { | 
|---|
|  | 26 | public: | 
|---|
| [295] | 27 | // Constructeur et destructeur | 
|---|
| [165] | 28 | NamedObjMgr(); | 
|---|
|  | 29 | virtual               ~NamedObjMgr(); | 
|---|
|  | 30 |  | 
|---|
|  | 31 | virtual void          SetImgApp(PIStdImgApp* app); | 
|---|
| [449] | 32 | virtual void          SetVerbose(bool fg=false); | 
|---|
| [165] | 33 |  | 
|---|
| [1164] | 34 | // Gestion des variables globales (dans un DVList) | 
|---|
|  | 35 | virtual bool          SetVar(string const & key, string const & val); | 
|---|
|  | 36 | virtual bool          HasVar(string const & key); | 
|---|
|  | 37 | virtual bool          DeleteVar(string const & key); | 
|---|
|  | 38 | virtual string        GetVar(string const & key); | 
|---|
|  | 39 | virtual DVList&       GetVarList(); | 
|---|
| [165] | 40 |  | 
|---|
| [1164] | 41 | // Gestion des repertoires (Repertoire d'objets en memoire) | 
|---|
| [344] | 42 | virtual bool          CreateDir(string & dirname); | 
|---|
|  | 43 | virtual bool          DeleteDir(string & dirname); | 
|---|
|  | 44 | virtual void          LockDir(string & dirname); | 
|---|
|  | 45 | virtual void          UnlockDir(string & dirname); | 
|---|
|  | 46 | virtual void          SetKeepOldDirAtt(string & dirname, bool keepold=false); | 
|---|
|  | 47 | virtual bool          SetCurrentDir(string & dirname); | 
|---|
| [333] | 48 | virtual void          GetCurrentDir(string & dirname); | 
|---|
|  | 49 | virtual void          ListDirs(string & patt); | 
|---|
|  | 50 | virtual void          GetDirList(string & patt, vector<string>& ); | 
|---|
| [368] | 51 | virtual void          CleanDir(string & dirname); | 
|---|
| [165] | 52 |  | 
|---|
| [331] | 53 | //  Pour ajouter, supprimer et acceder aux objets | 
|---|
| [344] | 54 | virtual bool          AddObj(AnyDataObj* obj, string & nom, bool crd=false); | 
|---|
|  | 55 | virtual bool          RenameObj(string & nom, string& nomnew); | 
|---|
|  | 56 | virtual bool          DelObj(string & nom, bool fgd=true); | 
|---|
| [331] | 57 | virtual void          DelObjects(string & patt, bool fgd=true); | 
|---|
| [344] | 58 | virtual bool          DelObj_Id(int oid); | 
|---|
| [331] | 59 | virtual AnyDataObj*   GetObj(string & nom); | 
|---|
| [1164] | 60 | // Acces a l'adaptateur | 
|---|
|  | 61 | virtual NObjMgrAdapter*       GetObjAdapter(string & nom); | 
|---|
|  | 62 | // Liste des objets | 
|---|
| [331] | 63 | virtual void          ListObjs(string & patt); | 
|---|
|  | 64 | virtual void          GetObjList(string & patt, vector<string>& ); | 
|---|
| [1164] | 65 | // Methode CopyObj() a virer probablement (Reza 30/8/200 obsolete ?) | 
|---|
| [1165] | 66 | virtual bool          CopyObj(string & nom, string& nomcp); | 
|---|
| [331] | 67 |  | 
|---|
| [165] | 68 | //  Lecture et sauvegarde des objets sur fichier | 
|---|
|  | 69 | virtual void          ReadObj(PInPersist& s, int num=-1); | 
|---|
| [331] | 70 | virtual void          ReadObj(string const & nomppf, string & nobj); | 
|---|
| [165] | 71 | virtual void          ReadAll(string const & nomppf); | 
|---|
| [331] | 72 | virtual void          ReadFits(string const & flnm, string & nobj); | 
|---|
| [333] | 73 | virtual void          SaveObj(string & nom, POutPersist& s, bool keeppath=false); | 
|---|
|  | 74 | virtual void          SaveObjects(string & patt, string const& nomppf); | 
|---|
| [165] | 75 | virtual void          SaveAll(string const& nomppf); | 
|---|
| [331] | 76 | virtual void          SaveFits(string & nom, string const & flnm); | 
|---|
| [165] | 77 |  | 
|---|
|  | 78 | // Info sur les objets | 
|---|
| [331] | 79 | virtual void          PrintObj(string & nom); | 
|---|
| [165] | 80 |  | 
|---|
|  | 81 | //  Affichage des objets | 
|---|
| [331] | 82 | virtual void          DisplayObj(string & nom, string dopt=""); | 
|---|
|  | 83 | virtual void          DisplayImage(string & nom, string dopt=""); | 
|---|
|  | 84 | virtual void          DisplaySurf3D(string & nom, string dopt=""); | 
|---|
|  | 85 | virtual void          DisplayNT(string & nom, string& nmx, string& nmy, string& nmz, | 
|---|
| [486] | 86 | string& erx, string& ery, string& erz, string& wt, | 
|---|
|  | 87 | string& label, string dopt="", bool fg3d=false); | 
|---|
| [333] | 88 | virtual void          DisplayGFD(string & nom, string& numvarx, string& numvary, | 
|---|
|  | 89 | string& err, string dopt=""); | 
|---|
| [165] | 90 |  | 
|---|
|  | 91 | virtual void          SetGraphicAttributes(string gratt=""); | 
|---|
|  | 92 | virtual void          SetGraphicWinZone(int nzx, int nzy, bool fcr=false); | 
|---|
|  | 93 |  | 
|---|
|  | 94 |  | 
|---|
|  | 95 | // Acces au PIApplication et a la classe de service | 
|---|
|  | 96 | virtual PIStdImgApp*          GetImgApp(); | 
|---|
|  | 97 | virtual Services2NObjMgr*     GetServiceObj(); | 
|---|
| [295] | 98 |  | 
|---|
| [333] | 99 | virtual void          AddWRsId(string & nom, int wrsid); | 
|---|
|  | 100 | // Pour utilisation par ObjMgrWind | 
|---|
|  | 101 | virtual void          UpdateObjMgrWindow(int did); | 
|---|
| [1207] | 102 |  | 
|---|
|  | 103 | // Pour completer le nom de l'objet avec le nom du repertoire | 
|---|
|  | 104 | static void RemoveSpacesFromName(string & nom); | 
|---|
|  | 105 | static bool CheckDirName(string & nom); | 
|---|
|  | 106 | static int  ParseObjectName(string & nom, string & nomrep, string & nomobj); | 
|---|
| [165] | 107 | }; | 
|---|
|  | 108 |  | 
|---|
|  | 109 |  | 
|---|
|  | 110 | #endif | 
|---|