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

Last change on this file since 423 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
RevLine 
[165]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
[293]9#include "machdefs.h"
[165]10#include <string>
[295]11#include <list>
12#include <map>
[351]13#include <functional>
[295]14#if defined(__KCC__)
15using std::string ;
16#include <list.h>
17#include <map.h>
[351]18#include <functional.h>
[295]19#endif
[165]20
[171]21#include "pdlmgr.h"
[165]22#include "dlftypes.h"
[330]23#include "anydataobj.h"
[165]24
25class NTuple;
26class Histo;
27class Histo2D;
28class HProf;
[333]29class NamedObjMgr;
[165]30class PIStdImgApp;
[330]31class NObjMgrAdapter;
[165]32
33class Services2NObjMgr {
34public:
[333]35 Services2NObjMgr(NamedObjMgr* omg, string& tmpdir);
[327]36 virtual ~Services2NObjMgr();
[165]37
[295]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
[165]43 inline void SetImgApp(PIStdImgApp* app) {mImgapp = app; }
44
[333]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,
[357]63 string& expcut, string dopt="", string loop="");
[333]64 virtual void DisplayPoints3D(string & nom, string& expx, string& expy, string& expz,
[357]65 string& expcut, string dopt="", string loop="");
[333]66 virtual void DisplayPoints2DW(string & nom, string& expx, string& expy,
[357]67 string& expwt, string& expcut, string dopt="", string loop="");
68// Projection d'expressions dans histogramme, vecteur/matrices (et trace)
[333]69 virtual void ProjectH1(string & nom, string& expx, string& expwt, string& expcut,
[357]70 string& nomh1, string dopt="", string loop="");
[333]71 virtual void ProjectH2(string & nom, string& expx, string& expy, string& expwt,
[357]72 string& expcut, string& nomh2, string dopt="", string loop="");
[333]73 virtual void ProjectHProf(string & nom, string& expx, string& expy, string& expwt,
[357]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="");
[333]84 virtual void FillNT(string & nom, string& expx, string& expy, string& expz,
[357]85 string& expt, string& expcut, string& nomnt, string loop="");
[333]86 virtual void FillGFD(string & nom, string& expx, string& expy, string& expz,
[357]87 string& experr, string& expcut, string& nomgfd, string loop="");
[333]88 virtual void FillNTFrCFile(string & nom, string const & fname,
[357]89 string const & funcname, string & nomnt, string loop="");
[333]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,
[357]95 string& expz, string& expt, string& expcut, string& loop,
[333]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);
[326]100 DlFunction LinkFunctionFromFile(string const & fname, string const & funcname);
[165]101 void CloseDLL();
102
[326]103// Utilitaires divers
[357]104 static void DecodeLoopParameters(string& loop, int& i1, int& i2, int& di);
105 int DecodeDispOption(string& dopt, bool& fgsrgr);
[165]106 string FileName2Name(string const & fn);
[333]107 char* PClassIdToClassName(int cid);
[165]108
[295]109protected:
[165]110 void InitGrAttNames();
111
[295]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
[165]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;
[295]124
[165]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;
[203]132 GrAttNames GrAaxes;
[165]133
[171]134 PDynLinkMgr * dynlink; // shared-lib lib.so
135 string TmpDir; // Pour fichiers temporaires
[165]136
137 PIStdImgApp* mImgapp;
[333]138 NamedObjMgr* mOmg;
[165]139
140};
141
142
143#endif
Note: See TracBrowser for help on using the repository browser.