source: Sophya/trunk/SophyaPI/PIext/nobjmgr.h@ 3222

Last change on this file since 3222 was 2999, checked in by ansari, 19 years ago

1/ Ajout methode Services2NObjMgr::DisplayPoints3DW() et commande plot3dw
2/ Ajout et utilisation methode de verification de nom NamedObjMgr::CheckName()
3/ Changement methode NObjMgrAdapter::GetInfoString() et son utilisation
a travers la methdoe PIACmd::GetVarApp() pour acces de type $objname
4/ Ajout methode NObjMgrAdapter::PerformOperation() , implemente pour
adaptateur TMatrix<T> et TArray<T> pour extraction de ligne/colonne
(des matrices) et plan (slice) des TArray pour Rank()>3 Et mise en place
de la commande objaoper pour appel a PerformOperation()
5/ Petites corrections pour ntline2var vec2var

Reza 2 Juillet 2006

File size: 5.3 KB
Line 
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
9#include "machdefs.h"
10
11#include <fstream>
12#include <string>
13#include <vector>
14
15#include "anydataobj.h"
16#include "ppersist.h"
17#include "dvlist.h"
18#include "dlftypes.h"
19
20
21class NObjMgrAdapter;
22class PIStdImgApp;
23class Services2NObjMgr;
24
25class NamedObjMgr {
26public:
27// Constructeur et destructeur
28 NamedObjMgr(bool fgimgapp=false);
29 virtual ~NamedObjMgr();
30
31 virtual void SetImgApp(PIStdImgApp* app);
32 virtual void SetVerbose(bool fg=false);
33
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();
40
41// Gestion des repertoires (Repertoire d'objets en memoire)
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);
48 virtual void GetCurrentDir(string & dirname);
49 virtual void ListDirs(string & patt);
50 virtual void GetDirList(string & patt, vector<string>& );
51 virtual void CleanDir(string & dirname);
52
53// Pour ajouter, supprimer et acceder aux objets
54 virtual bool AddObj(AnyDataObj* obj, string & nom, bool crd=false);
55 virtual bool AddObj(AnyDataObj& obj, string & nom, bool crd=false);
56 virtual bool RenameObj(string & nom, string& nomnew);
57 virtual bool DelObj(string & nom, bool fgd=true);
58 virtual void DelObjects(string & patt, bool fgd=true);
59 virtual bool DelObj_Id(int oid);
60 virtual AnyDataObj* GetObj(string & nom);
61// Acces a l'adaptateur
62 virtual NObjMgrAdapter* GetObjAdapter(string & nom);
63// Liste des objets
64 virtual void ListObjs(string & patt);
65 virtual void GetObjList(string & patt, vector<string>& );
66// Methode CopyObj() a virer probablement (Reza 30/8/200 obsolete ?)
67 virtual bool CopyObj(string & nom, string& nomcp);
68
69// Lecture et sauvegarde des objets sur fichier
70 virtual void ReadObj(PInPersist& s, int num=-1);
71 virtual void ReadObj(string const & nomppf, string & nobj);
72 virtual void ReadObj(vector<string> & flnm_objname);
73 virtual void ReadAll(string const & nomppf);
74 virtual void SaveObj(string & nom, POutPersist& s, bool keeppath=false);
75 virtual void SaveObjects(string & patt, string const& nomppf);
76 virtual void SaveListObjects(vector<string> &liste);
77 virtual void SaveAll(string const& nomppf);
78
79// Info sur les objets
80 virtual void PrintObj(string & nom, int lev=0);
81
82// Affichage des objets
83 virtual void DisplayObj(string & nom, string dopt="");
84 virtual void DisplayImage(string & nom, string dopt="", bool fgimagnav=false);
85 virtual void DisplaySurf3D(string & nom, string dopt="");
86 virtual void DisplayNT(string & nom, string& nmx, string& nmy, string& nmz,
87 string& erx, string& ery, string& erz, string& wt,
88 string& label, string dopt="", bool fg3d=false);
89 virtual void DisplayGFD(string & nom, string& numvarx, string& numvary,
90 string& err, string dopt="");
91
92 virtual void DisplayVector(string & nomvx, string& nomvy, string dopt="");
93
94
95// Acces au PIApplication et a la classe de service
96 virtual PIStdImgApp* GetImgApp();
97 virtual Services2NObjMgr* GetServiceObj();
98 virtual string const& GetTmpDir();
99 virtual void SetTmpDir(string const& tmpdir);
100
101// Ajoute un identificateur d'objet widget/drawer/fenetre pour l'objet nom
102// Ces identificateurs servent lors de la destruction de l'objet nom
103 virtual void AddWRsId(string & nom, int wrsid);
104// Pour utilisation par ObjMgrWind
105 virtual void UpdateObjMgrWindow(int did);
106
107// Pour completer le nom de l'objet avec le nom du repertoire
108 static void RemoveSpacesFromName(string & nom);
109 static bool CheckDirName(string & nom);
110 static int ParseObjectName(string & nom, string & nomrep, string & nomobj);
111// return true if name is valid
112 static bool CheckName(string const & nom);
113
114protected:
115 // Les methodes _P sont celles SANS ZSync() - pour un usage interne par NamedObjMgr
116 virtual bool CreateDir_P(string & dirname);
117 virtual void CleanDir_P(string & dirname);
118 virtual bool AddObj_P(AnyDataObj* obj, string & nom, bool crd);
119 virtual bool RenameObj_P(string & nom, string& nomnew);
120 virtual bool DelObj_P(string & nom, bool fgd=true);
121 virtual AnyDataObj* GetObj_P(string & nom);
122 virtual NObjMgrAdapter* GetObjAdapter_P(string & nom);
123 virtual void ReadObj_P(PInPersist& s, int num=-1);
124 virtual void SaveObj_P(string & nom, POutPersist& s, bool keeppath=false);
125
126 virtual void AddWRsId_P(string & nom, int wrsid);
127 virtual void UpdateObjMgrWindow_P(int did);
128
129 bool _fgimgapp; // true -> cree par PIStdImgApp / pour gestion de thread
130};
131
132
133#endif
Note: See TracBrowser for help on using the repository browser.