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

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

Deplacement des methodes d'ajustement dans nouvelle classe Reza 6/8/99

File size: 6.3 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="", string loop="");
64 virtual void DisplayPoints3D(string & nom, string& expx, string& expy, string& expz,
65 string& expcut, string dopt="", string loop="");
66 virtual void DisplayPoints2DW(string & nom, string& expx, string& expy,
67 string& expwt, string& expcut, string dopt="", string loop="");
68// Projection d'expressions dans histogramme, vecteur/matrices (et trace)
69 virtual void ProjectH1(string & nom, string& expx, string& expwt, string& expcut,
70 string& nomh1, string dopt="", string loop="");
71 virtual void ProjectH2(string & nom, string& expx, string& expy, string& expwt,
72 string& expcut, string& nomh2, string dopt="", string loop="");
73 virtual void ProjectHProf(string & nom, string& expx, string& expy, string& expwt,
74 string& expcut, string& nomprof, string dopt="", string loop="");
75
76// Remplissage de vecteurs, ntuples, GFD
77 virtual void FillVect(string & nom, string& expx, string& expv, string& expcut,
78 string& nomvec, string dopt="", string loop="");
79 virtual void FillMatx(string & nom, string& expx, string& expy, string& expv,
80 string& expcut, string& nommtx, string dopt="", string loop="");
81
82 virtual void ExpressionToVector(string & nom, string& expx, string& expcut,
83 string& nomvec, string dopt="", string loop="");
84 virtual void FillNT(string & nom, string& expx, string& expy, string& expz,
85 string& expt, string& expcut, string& nomnt, string loop="");
86 virtual void FillGFD(string & nom, string& expx, string& expy, string& expz,
87 string& experr, string& expcut, string& nomgfd, string loop="");
88 virtual void FillNTFrCFile(string & nom, string const & fname,
89 string const & funcname, string & nomnt, string loop="");
90 virtual void PrepareNTExpressionCFile(string & nomobj, string const & fname,
91 string const & funcname);
92
93// Calcul d'expressions d'interface NTuple pour les objets
94 void ComputeExpressions(NObjMgrAdapter* obja, string& expx, string& expy,
95 string& expz, string& expt, string& expcut, string& loop,
96 NTuple* nt=NULL, Histo* h1=NULL,
97 Histo2D* h2=NULL, HProf* hp=NULL);
98 PlotExprFunc LinkExprFunc(string& vardec, string& expx, string& expy,
99 string& expz, string& expt, string& cut);
100 DlFunction LinkFunctionFromFile(string const & fname, string const & funcname);
101 void CloseDLL();
102
103// Utilitaires divers
104 static void DecodeLoopParameters(string& loop, int& i1, int& i2, int& di);
105 int DecodeDispOption(string& dopt, bool& fgsrgr);
106 string FileName2Name(string const & fn);
107 char* PClassIdToClassName(int cid);
108
109protected:
110 void InitGrAttNames();
111
112// Pour enregister les objets et leurs adaptateurs pour NamedObjMgr
113 struct dataobj_adapter {
114 AnyDataObj* obj; NObjMgrAdapter* obja;
115 };
116 typedef list<dataobj_adapter> ObjAdaptList;
117 ObjAdaptList objadaplist;
118
119// Variables membre , en public pour le moment
120 struct gratt_item {
121 int a1, a2;
122 };
123 typedef map<string, gratt_item, less<string> > GrAttNames;
124
125// Pour les changements d'attributs graphiques / de visualisation
126 GrAttNames GrAcolors;
127 GrAttNames GrAlines;
128 GrAttNames GrAmarkers;
129 GrAttNames GrAfonts;
130 GrAttNames GrAcmap;
131 GrAttNames GrAzoom;
132 GrAttNames GrAaxes;
133
134 PDynLinkMgr * dynlink; // shared-lib lib.so
135 string TmpDir; // Pour fichiers temporaires
136
137 PIStdImgApp* mImgapp;
138 NamedObjMgr* mOmg;
139
140};
141
142
143#endif
Note: See TracBrowser for help on using the repository browser.