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

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

intro newnt et ntfrascci (partiel) cmv 30/9/99

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