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 | #if defined(__KCC__)
|
---|
14 | using std::string ;
|
---|
15 | #include <list.h>
|
---|
16 | #include <map.h>
|
---|
17 | #endif
|
---|
18 |
|
---|
19 | #include "pdlmgr.h"
|
---|
20 | #include "dlftypes.h"
|
---|
21 | #include "anydataobj.h"
|
---|
22 |
|
---|
23 | class NTuple;
|
---|
24 | class Histo;
|
---|
25 | class Histo2D;
|
---|
26 | class HProf;
|
---|
27 | class PIStdImgApp;
|
---|
28 | class NObjMgrAdapter;
|
---|
29 |
|
---|
30 | class Services2NObjMgr {
|
---|
31 | public:
|
---|
32 | Services2NObjMgr(PIStdImgApp* app, string& tmpdir);
|
---|
33 | virtual ~Services2NObjMgr();
|
---|
34 |
|
---|
35 | // Pour enregistrer les objets de donnees et leurs adaptateurs
|
---|
36 | void RegisterClass(AnyDataObj* o, NObjMgrAdapter* oa);
|
---|
37 | // Pour recuperer l'adaptateur pour un objet o
|
---|
38 | NObjMgrAdapter* GetAdapter(AnyDataObj* o);
|
---|
39 |
|
---|
40 | inline void SetImgApp(PIStdImgApp* app) {mImgapp = app; }
|
---|
41 |
|
---|
42 | void Nobj_ComputeExpressions(NObjMgrAdapter* obja, string& expx, string& expy, string& expz,
|
---|
43 | string& expwt, string& expcut,
|
---|
44 | NTuple* nt=NULL, Histo* h1=NULL,
|
---|
45 | Histo2D* h2=NULL, HProf* hp=NULL);
|
---|
46 | PlotExprFunc LinkExprFunc(string& vardec, string& expx, string& expy, string& expz,
|
---|
47 | string& wt, string& cut);
|
---|
48 | DlFunction LinkFunctionFromFile(string const & fname, string const & funcname);
|
---|
49 | void CloseDLL();
|
---|
50 |
|
---|
51 | // Trace de fonctions 1-D , 2-D
|
---|
52 | virtual void PlotFunc(string const & expfunc, float xmin, float xmax, int np=100, string dopt="");
|
---|
53 | virtual void PlotFunc2D(string const & expfunc, float xmin, float xmax, float ymin, float ymax,
|
---|
54 | int npx=50, int npy=50, string dopt="");
|
---|
55 | virtual void PlotFuncFrCFile(string const & fname, string const & func, float xmin, float xmax,
|
---|
56 | int np=100, string dopt="");
|
---|
57 | virtual void PlotFunc2DFrCFile(string const & fname, string const & func, float xmin, float xmax,
|
---|
58 | float ymin, float ymax, int npx=50, int npy=50, string dopt="");
|
---|
59 | virtual void PlotFunc(DlFunctionOfX f, float xmin, float xmax, int np=100, string dopt="");
|
---|
60 | virtual void PlotFunc2D(DlFunctionOfXY f, float xmin, float xmax, float ymin, float ymax,
|
---|
61 | int npx=50, int npy=50, string dopt="");
|
---|
62 |
|
---|
63 | // Utilitaires divers
|
---|
64 | string FileName2Name(string const & fn);
|
---|
65 | int DecodeDispOption(string& dopt, bool& fgsrgr);
|
---|
66 |
|
---|
67 | protected:
|
---|
68 | void InitGrAttNames();
|
---|
69 |
|
---|
70 | // Pour enregister les objets et leurs adaptateurs pour NamedObjMgr
|
---|
71 | struct dataobj_adapter {
|
---|
72 | AnyDataObj* obj; NObjMgrAdapter* obja;
|
---|
73 | };
|
---|
74 | typedef list<dataobj_adapter> ObjAdaptList;
|
---|
75 | ObjAdaptList objadaplist;
|
---|
76 |
|
---|
77 | // Variables membre , en public pour le moment
|
---|
78 | struct gratt_item {
|
---|
79 | int a1, a2;
|
---|
80 | };
|
---|
81 | typedef map<string, gratt_item, less<string> > GrAttNames;
|
---|
82 |
|
---|
83 | // Pour les changements d'attributs graphiques / de visualisation
|
---|
84 | GrAttNames GrAcolors;
|
---|
85 | GrAttNames GrAlines;
|
---|
86 | GrAttNames GrAmarkers;
|
---|
87 | GrAttNames GrAfonts;
|
---|
88 | GrAttNames GrAcmap;
|
---|
89 | GrAttNames GrAzoom;
|
---|
90 | GrAttNames GrAaxes;
|
---|
91 |
|
---|
92 | PDynLinkMgr * dynlink; // shared-lib lib.so
|
---|
93 | string TmpDir; // Pour fichiers temporaires
|
---|
94 |
|
---|
95 | PIStdImgApp* mImgapp;
|
---|
96 |
|
---|
97 | };
|
---|
98 |
|
---|
99 |
|
---|
100 | #endif
|
---|