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

Last change on this file since 351 was 351, checked in by ercodmgr, 26 years ago

Portage KCC (il faut functional pour less<>) Reza 5/8/99

File size: 5.9 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#if defined(__KCC__)
15using std::string ;
16#include <list.h>
17#include <map.h>
18#include <functional.h>
19#endif
20
21#include "pdlmgr.h"
22#include "dlftypes.h"
23#include "anydataobj.h"
24
25class NTuple;
26class Histo;
27class Histo2D;
28class HProf;
29class NamedObjMgr;
30class PIStdImgApp;
31class NObjMgrAdapter;
32
33class Services2NObjMgr {
34public:
35 Services2NObjMgr(NamedObjMgr* omg, string& tmpdir);
36 virtual ~Services2NObjMgr();
37
38// Pour enregistrer les objets de donnees et leurs adaptateurs
39 void RegisterClass(AnyDataObj* o, NObjMgrAdapter* oa);
40// Pour recuperer l'adaptateur pour un objet o
41 NObjMgrAdapter* GetAdapter(AnyDataObj* o);
42
43 inline void SetImgApp(PIStdImgApp* app) {mImgapp = app; }
44
45// Trace de fonctions 1-D , 2-D
46 virtual void PlotFunc(string const & expfunc, string & nom, double xmin, double xmax,
47 int np=100, string dopt="");
48 virtual void PlotFunc2D(string const & expfunc, string & nom, double xmin, double xmax,
49 double ymin, double ymax, int npx=50, int npy=50, string dopt="");
50 virtual void PlotFuncFrCFile(string const & fname, string const & func, string & nom,
51 double xmin, double xmax, int np=100, string dopt="");
52 virtual void PlotFunc2DFrCFile(string const & fname, string const & func, string & nom,
53 double xmin, double xmax, double ymin, double ymax,
54 int npx=50, int npy=50, string dopt="");
55 virtual void PlotFunc(DlFunctionOfX f, string & nom, double xmin, double xmax,
56 int np=100, string dopt="");
57 virtual void PlotFunc2D(DlFunctionOfXY f, string & nom, double xmin, double xmax,
58 double ymin, double ymax, int npx=50, int npy=50, string dopt="");
59
60// Trace d'expression de NTuple, et d'autres objets
61 virtual void DisplayPoints2D(string & nom, string& expx, string& expy,
62 string& experrx, string& experry,
63 string& expcut, string dopt="");
64 virtual void DisplayPoints3D(string & nom, string& expx, string& expy, string& expz,
65 string& expcut, string dopt="");
66 virtual void DisplayPoints2DW(string & nom, string& expx, string& expy,
67 string& expwt, string& expcut, string dopt="");
68// Projection d'expressions dans histogramme (et trace)
69 virtual void ProjectH1(string & nom, string& expx, string& expwt, string& expcut,
70 string& nomh1, string dopt="");
71 virtual void ProjectH2(string & nom, string& expx, string& expy, string& expwt,
72 string& expcut, string& nomh2, string dopt="");
73 virtual void ProjectHProf(string & nom, string& expx, string& expy, string& expwt,
74 string& expcut, string& nomprof, string dopt="");
75// Projection d'expression dans vecteurs et dans n-tuple
76 virtual void FillVect(string & nom, string& expx, string& expcut,
77 string& nomvec, string dopt="");
78 virtual void FillNT(string & nom, string& expx, string& expy, string& expz,
79 string& expt, string& expcut, string& nomnt);
80 virtual void FillGFD(string & nom, string& expx, string& expy, string& expz,
81 string& experr, string& expcut, string& nomgfd);
82 virtual void FillNTFrCFile(string & nom, string const & fname,
83 string const & funcname, string & nomnt,
84 int nl1=-1, int nl2=-1);
85 virtual void PrepareNTExpressionCFile(string & nomobj, string const & fname,
86 string const & funcname);
87
88// Methodes de fit - CMV , deux methodes H1 H2 ou 1 seule ??) ...
89 virtual void Fit12D(string & nom, string& func,
90 string par,string step,string min,string max,string opt);
91
92// Calcul d'expressions d'interface NTuple pour les objets
93 void ComputeExpressions(NObjMgrAdapter* obja, string& expx, string& expy,
94 string& expz, string& expt, string& expcut,
95 NTuple* nt=NULL, Histo* h1=NULL,
96 Histo2D* h2=NULL, HProf* hp=NULL);
97 PlotExprFunc LinkExprFunc(string& vardec, string& expx, string& expy,
98 string& expz, string& expt, string& cut);
99 DlFunction LinkFunctionFromFile(string const & fname, string const & funcname);
100 void CloseDLL();
101
102// Utilitaires divers
103 string FileName2Name(string const & fn);
104 int DecodeDispOption(string& dopt, bool& fgsrgr);
105 char* PClassIdToClassName(int cid);
106
107protected:
108 void InitGrAttNames();
109
110// Pour enregister les objets et leurs adaptateurs pour NamedObjMgr
111 struct dataobj_adapter {
112 AnyDataObj* obj; NObjMgrAdapter* obja;
113 };
114 typedef list<dataobj_adapter> ObjAdaptList;
115 ObjAdaptList objadaplist;
116
117// Variables membre , en public pour le moment
118 struct gratt_item {
119 int a1, a2;
120 };
121 typedef map<string, gratt_item, less<string> > GrAttNames;
122
123// Pour les changements d'attributs graphiques / de visualisation
124 GrAttNames GrAcolors;
125 GrAttNames GrAlines;
126 GrAttNames GrAmarkers;
127 GrAttNames GrAfonts;
128 GrAttNames GrAcmap;
129 GrAttNames GrAzoom;
130 GrAttNames GrAaxes;
131
132 PDynLinkMgr * dynlink; // shared-lib lib.so
133 string TmpDir; // Pour fichiers temporaires
134
135 PIStdImgApp* mImgapp;
136 NamedObjMgr* mOmg;
137
138};
139
140
141#endif
Note: See TracBrowser for help on using the repository browser.