source: Sophya/trunk/SophyaPI/PIext/servnobjm.h@ 1276

Last change on this file since 1276 was 1276, checked in by ercodmgr, 25 years ago

Amelioration de la syntaxe de l'interpreteur, gestion de quotes, ligne suite
Commande linkff2 (2eme groupe de link, pour utilisation par CxxExecutor
Amelioration de la gestion de TMPDIR

Reza 2/11/2000

File size: 6.6 KB
Line 
1// This may look like C code, but it is really -*- C++ -*-
2// Classe de services destinee a NamedObjMgr pour piapp
3// Reza Aout 98
4// CEA-DAPNIA LAL-IN2P3/CNRS
5
6#ifndef SERVNOBJM_H_SEEN
7#define SERVNOBJM_H_SEEN
8
9#include "machdefs.h"
10#include <string>
11#include <list>
12#include <map>
13#include <functional>
14
15#include "pdlmgr.h"
16#include "dlftypes.h"
17#include "anydataobj.h"
18
19#ifdef SANS_EVOLPLANCK
20class NTuple;
21class Histo;
22class Histo2D;
23class HProf;
24#else
25namespace SOPHYA {
26class NTuple;
27class Histo;
28class Histo2D;
29class HProf;
30}
31#endif
32
33class NamedObjMgr;
34class PIStdImgApp;
35class NObjMgrAdapter;
36
37class Services2NObjMgr {
38public:
39 Services2NObjMgr(NamedObjMgr* omg, string& tmpdir);
40 virtual ~Services2NObjMgr();
41
42// Pour enregistrer les objets de donnees et leurs adaptateurs
43 void RegisterClass(AnyDataObj* o, NObjMgrAdapter* oa);
44// Pour recuperer l'adaptateur pour un objet o
45 NObjMgrAdapter* GetAdapter(AnyDataObj* o);
46
47 inline void SetImgApp(PIStdImgApp* app) {mImgapp = app; }
48 void SetTmpDir(string const & tmpdir);
49
50// Trace de fonctions 1-D , 2-D
51 virtual void PlotFunc(string const & expfunc, string & nom, double xmin, double xmax,
52 int np=100, string dopt="");
53 virtual void PlotFunc2D(string const & expfunc, string & nom, double xmin, double xmax,
54 double ymin, double ymax, int npx=50, int npy=50, string dopt="");
55 virtual void PlotFuncFrCFile(string const & fname, string const & func, string & nom,
56 double xmin, double xmax, int np=100, string dopt="");
57 virtual void PlotFunc2DFrCFile(string const & fname, string const & func, string & nom,
58 double xmin, double xmax, double ymin, double ymax,
59 int npx=50, int npy=50, string dopt="");
60 virtual void PlotFunc(DlFunctionOfX f, string & nom, double xmin, double xmax,
61 int np=100, string dopt="");
62 virtual void PlotFunc2D(DlFunctionOfXY f, string & nom, double xmin, double xmax,
63 double ymin, double ymax, int npx=50, int npy=50, string dopt="");
64
65// Trace d'expression de NTuple, et d'autres objets
66 virtual void DisplayPoints2D(string & nom, string& expx, string& expy,
67 string& experrx, string& experry,
68 string& expcut, string dopt="", string loop="");
69 virtual void DisplayPoints3D(string & nom, string& expx, string& expy, string& expz,
70 string& expcut, string dopt="", string loop="");
71 virtual void DisplayPoints2DW(string & nom, string& expx, string& expy,
72 string& expwt, string& expcut, string dopt="", string loop="");
73// Projection d'expressions dans histogramme, vecteur/matrices (et trace)
74 virtual void ProjectH1(string & nom, string& expx, string& expwt, string& expcut,
75 string& nomh1, string dopt="", string loop="");
76 virtual void ProjectH2(string & nom, string& expx, string& expy, string& expwt,
77 string& expcut, string& nomh2, string dopt="", string loop="");
78 virtual void ProjectHProf(string & nom, string& expx, string& expy, string& expwt,
79 string& expcut, string& nomprof, string dopt="", string loop="");
80
81// Remplissage de vecteurs, ntuples, GFD
82 virtual void FillVect(string & nom, string& expx, string& expv, string& expcut,
83 string& nomvec, string dopt="", string loop="");
84 virtual void FillMatx(string & nom, string& expx, string& expy, string& expv,
85 string& expcut, string& nommtx, string dopt="", string loop="");
86
87 virtual void ExpressionToVector(string & nom, string& expx, string& expcut,
88 string& nomvec, string dopt="", string loop="");
89 virtual void NtFromASCIIFile(string& nom,string& filename,double def_val=0.);
90 virtual void FillNT(string & nom, string& expx, string& expy, string& expz,
91 string& expt, string& expcut, string& nomnt, string loop="");
92 virtual void FillGFD(string & nom, string& expx, string& expy, string& expz,
93 string& experr, string& expcut, string& nomgfd, string loop="");
94 virtual void FillGFDfrVec(string nomgfd,string namx,string namy,string namz,string name);
95 virtual void FillNTFrCFile(string & nom, string const & fname,
96 string const & funcname, string & nomnt, string loop="");
97 virtual void PrepareNTExpressionCFile(string & nomobj, string const & fname,
98 string const & funcname);
99
100// Calcul d'expressions d'interface NTuple pour les objets
101 void ComputeExpressions(NObjMgrAdapter* obja, string& expx, string& expy,
102 string& expz, string& expt, string& expcut, string& loop,
103 NTuple* nt=NULL, Histo* h1=NULL,
104 Histo2D* h2=NULL, HProf* hp=NULL);
105 PlotExprFunc LinkExprFunc(string& vardec, string& expx, string& expy,
106 string& expz, string& expt, string& cut);
107 DlFunction LinkFunctionFromFile(string const & fname, string const & funcname);
108 void CloseDLL();
109
110// Utilitaires divers
111 static void DecodeLoopParameters(string& loop, int& i1, int& i2, int& di);
112 int DecodeDispOption(string& dopt, bool& fgsrgr);
113 static bool GetStatsOption(string& dopt);
114 static void SetDefaultStatsOption(bool opt);
115 string FileName2Name(string const & fn);
116 char* PClassIdToClassName(int cid);
117
118protected:
119 void InitGrAttNames();
120
121// Pour enregister les objets et leurs adaptateurs pour NamedObjMgr
122 struct dataobj_adapter {
123 AnyDataObj* obj; NObjMgrAdapter* obja;
124 };
125 typedef list<dataobj_adapter> ObjAdaptList;
126 ObjAdaptList objadaplist;
127
128// Variables membre , en public pour le moment
129 struct gratt_item {
130 int a1, a2;
131 };
132 typedef map<string, gratt_item, less<string> > GrAttNames;
133
134// Pour les changements d'attributs graphiques / de visualisation
135 GrAttNames GrAcolors;
136 GrAttNames GrAlines;
137 GrAttNames GrAmarkers;
138 GrAttNames GrAfonts;
139 GrAttNames GrAcmap;
140 GrAttNames GrAzoom;
141 GrAttNames GrAaxes;
142
143 PDynLinkMgr * dynlink; // shared-lib lib.so
144 string TmpDir; // Pour fichiers temporaires
145
146 PIStdImgApp* mImgapp;
147 NamedObjMgr* mOmg;
148
149};
150
151
152#endif
Note: See TracBrowser for help on using the repository browser.