| 1 | // This may look like C code, but it is really -*- C++ -*-
 | 
|---|
| 2 | // Module PI : Peida Interactive  PINTuple et PINTupleWdg
 | 
|---|
| 3 | // Traceur d objet de type NTupleInterface
 | 
|---|
| 4 | 
 | 
|---|
| 5 | #ifndef PINTUPLE_H
 | 
|---|
| 6 | #define PINTUPLE_H
 | 
|---|
| 7 | 
 | 
|---|
| 8 | #include "ntupintf.h"
 | 
|---|
| 9 | #include "pidrawer.h"
 | 
|---|
| 10 | 
 | 
|---|
| 11 | class PINTuple : public PIDrawer {
 | 
|---|
| 12 | public:
 | 
|---|
| 13 |                      PINTuple(NTupleInterface* nt, bool ad);
 | 
|---|
| 14 |   virtual           ~PINTuple();
 | 
|---|
| 15 |   
 | 
|---|
| 16 | 
 | 
|---|
| 17 |   virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
 | 
|---|
| 18 |   virtual void       UpdateLimits();
 | 
|---|
| 19 |   
 | 
|---|
| 20 |   virtual void       SelectXY(const char* px, const char* py);
 | 
|---|
| 21 |   virtual void       SelectWt(const char* pw=NULL);
 | 
|---|
| 22 |   virtual void       SelectErrBar(const char* erbx=NULL, const char* erby=NULL);
 | 
|---|
| 23 |   virtual void       SelectLabel(const char* plabel=NULL);
 | 
|---|
| 24 |   virtual void       SelectColorByName(const char* pcolnm=NULL);
 | 
|---|
| 25 |   virtual void       SelectColorByIndex(const char* pcolidx=NULL);
 | 
|---|
| 26 | 
 | 
|---|
| 27 |   inline  void       ConnectPoints(bool fg=false) { connectPts = fg; }
 | 
|---|
| 28 | 
 | 
|---|
| 29 |   // Gestion de la representation de poids
 | 
|---|
| 30 |   inline  void       UseSizeScale(bool fg=true, int nbins=5)
 | 
|---|
| 31 |     { mrkSzScale = fg; if (nbins>0) nWbins = nbins; }
 | 
|---|
| 32 |   inline  void       UseColorScale(bool fg=true) { colorScale = fg; }
 | 
|---|
| 33 | 
 | 
|---|
| 34 |   inline  bool       GetSizeScale(int& nbins) 
 | 
|---|
| 35 |     { nbins = nWbins; return mrkSzScale; }
 | 
|---|
| 36 |   inline  bool       GetColScale() { return colorScale; }
 | 
|---|
| 37 | 
 | 
|---|
| 38 |   inline  void       SetStats(bool fg=true) { stats = fg; }
 | 
|---|
| 39 |   inline  void       SetStatPosOffset(double ofx=-0.01, double ofy=-0.01) 
 | 
|---|
| 40 |           {spoX=ofx; spoY=ofy; }
 | 
|---|
| 41 | 
 | 
|---|
| 42 |   virtual void       AppendTextInfo(string& info, double xmin, double ymin, double xmax, double ymax);
 | 
|---|
| 43 | 
 | 
|---|
| 44 | //   Methode de decodage des options
 | 
|---|
| 45 |   virtual int        DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
 | 
|---|
| 46 |   virtual int        OptionToString(vector<string> & opt) const;
 | 
|---|
| 47 | //   Texte d'aide des options disponibles
 | 
|---|
| 48 |   virtual void       GetOptionsHelpInfo(string& info);
 | 
|---|
| 49 | 
 | 
|---|
| 50 | // Renvoie une distance au point x,y
 | 
|---|
| 51 |   virtual double     GetDistanceToPoint(double x, double y);
 | 
|---|
| 52 |        
 | 
|---|
| 53 | protected:
 | 
|---|
| 54 |   NTupleInterface* mNT;
 | 
|---|
| 55 |   bool mAdDO;
 | 
|---|
| 56 |   int xK, yK;          // Index du nom de variable en X/Y ds le ntuple
 | 
|---|
| 57 |   int xebK, yebK;      // Index du nom de variable en ErrBarX/Y ds le ntuple
 | 
|---|
| 58 |   int wK;              // Index du nom de variable poids
 | 
|---|
| 59 |   int lK;              // Index du nom de variable label (affiche en texte)
 | 
|---|
| 60 |   int cnK;             // Index du nom de variable couleur (par nom de couleur)
 | 
|---|
| 61 |   int ciK;             // Index du nom de variable couleur (par index de couleur)
 | 
|---|
| 62 |   double wMin, wMax;   // Valeurs de poids min/max
 | 
|---|
| 63 |   bool mrkSzScale;     // true -> Taille de markers variable suivant poids
 | 
|---|
| 64 |   int nWbins;          // Nombre de bins taille de marker variable
 | 
|---|
| 65 |   bool colorScale;     // true -> Couleur de marker variable suivant poids
 | 
|---|
| 66 |   bool stats;               // true -> indication du nb de points
 | 
|---|
| 67 |   bool connectPts;          // true -> les points sont relies par une ligne
 | 
|---|
| 68 |   double spoX, spoY; // Stat pos offset par rapport a position defaut
 | 
|---|
| 69 |   long NptDraw; // nombre de points effectivement dessines dans la fenetre
 | 
|---|
| 70 | };
 | 
|---|
| 71 | 
 | 
|---|
| 72 | #endif
 | 
|---|
| 73 | 
 | 
|---|
| 74 | 
 | 
|---|
| 75 | 
 | 
|---|
| 76 | 
 | 
|---|