source: Sophya/trunk/SophyaPI/PIext/pintuple.h@ 4077

Last change on this file since 4077 was 4071, checked in by ansari, 13 years ago

Trace en coordonnees polaires (2D avec barres d'erreur) classe PINTuple

et introduction des attributs graphiques polarplot, polaraxes ...

Reza, 9 Mai 2012

File size: 3.3 KB
Line 
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
11class PINTuple : public PIDrawer {
12public:
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 virtual void SelectPolar(const char* pangle, const char* pradius, double angconv=1., double angoff=0.);
27
28 inline void ConnectPoints(bool fg=false) { connectPts = fg; }
29
30 // Gestion de la representation de poids
31 inline void UseSizeScale(bool fg=true, int nbins=5)
32 { mrkSzScale = fg; if (nbins>0) nWbins = nbins; }
33 inline void UseColorScale(bool fg=true) { colorScale = fg; }
34
35 inline bool GetSizeScale(int& nbins)
36 { nbins = nWbins; return mrkSzScale; }
37 inline bool GetColScale() { return colorScale; }
38
39 inline void SetStats(bool fg=true) { stats = fg; }
40 inline void SetStatPosOffset(double ofx=-0.01, double ofy=-0.01)
41 {spoX=ofx; spoY=ofy; }
42
43 virtual void AppendTextInfo(string& info, double xmin, double ymin, double xmax, double ymax);
44
45// Methode de decodage des options
46 virtual int DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
47 virtual int OptionToString(vector<string> & opt) const;
48// Texte d'aide des options disponibles
49 virtual void GetOptionsHelpInfo(string& info);
50
51// Renvoie une distance au point x,y
52 virtual double GetDistanceToPoint(double x, double y);
53
54protected:
55 NTupleInterface* mNT;
56 bool mAdDO;
57 int xK, yK; // Index du nom de variable en X/Y (ou rayon/angle) ds le ntuple
58 int xebK, yebK; // Index du nom de variable en ErrBarX/Y ds le ntuple
59 int wK; // Index du nom de variable poids
60 int lK; // Index du nom de variable label (affiche en texte)
61 int cnK; // Index du nom de variable couleur (par nom de couleur)
62 int ciK; // Index du nom de variable couleur (par index de couleur)
63 double wMin, wMax; // Valeurs de poids min/max
64 bool mrkSzScale; // true -> Taille de markers variable suivant poids
65 int nWbins; // Nombre de bins taille de marker variable
66 bool colorScale; // true -> Couleur de marker variable suivant poids
67 bool polarPlot; // true -> polar plot
68 double angConvFactor; // Facteur de conversion de l'angle en radian
69 double angOffset; // Offset de l'angle (en radian) apres conversion
70 bool stats; // true -> indication du nb de points
71 bool connectPts; // true -> les points sont relies par une ligne
72 double spoX, spoY; // Stat pos offset par rapport a position defaut
73 long NptDraw; // nombre de points effectivement dessines dans la fenetre
74};
75
76#endif
77
78
79
80
Note: See TracBrowser for help on using the repository browser.