Analysis  version 7.0 - august 2014
GEVPlot.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GEVPlot.hh
3  *
4  * Déclaration de la classe GEVSpectrum, qui référence un
5  * spectre à afficher et ses attributs graphiques.
6  *
7  * 14 septembre 2009
8  * - prise en compte des spectres 3D
9  */
10 //======================================================================
11 
12 
13 #ifndef GEV_PLOT_HH
14 #define GEV_PLOT_HH
15 
16 // includes GanilRun
17 #include "SpectrumList.hh"
18 #include "SpectrumRoot.hh"
19 #include "GEVPlotProperties.hh"
20 
21 // includes ROOT
22 #include <TAttLine.h>
23 #include <TAttFill.h>
24 
25 class GEVPad;
26 
27 //======================================================================
28 /*! \class GEVPlot
29  *
30  * Classe qui fait référence à un spectre avec ses attributs graphiques
31  * pour les interfaces basées sur ROOT.
32  * Cette classe sert à insérer des spectres dans les zones graphiques
33  * (GEVPad) des pages.
34  * La classe hérite de GEVPlotProperties, qui
35  * permettent de mémoriser les attributs graphiques pour le tracé du
36  * spectre, sachant qu'un même spectre peut être affiché dans plusieurs
37  * zones ou pages, avec des attributs différents.
38  */
39 
40 class GEVPlot : public GEVPlotProperties
41 {
42  friend class GEVPad;
43 
44 //----------------------------------------------------------------------
45  /*! \object_doc */
47 //----------------------------------------------------------------------
48 
49  protected:
50 
51  Spectrum * spec_ptr; ///< Pointeur sur le spectre associé0c486b040bc@
52 
53  public:
54 
55 //----------------------------------------------------------------------
56 // CONSTRUCTEUR / AFFECTATION / DESTRUCTEUR
57 
58  // Constructeur
59  GEVPlot ( Spectrum * spec = NULL );
60 
61  // Constructeur de recopie
62  GEVPlot ( const GEVPlot & original );
63 
64  // Destructeur
65  virtual ~GEVPlot ( );
66 
67  // Opérateur d'affectation
68  GEVPlot & operator = ( const GEVPlot & original );
69 
70 //----------------------------------------------------------------------
71  virtual UInt_t GetSpectrumDimension ( ) const;
72  virtual const Spectrum * GetSpectrumPtr ( ) const;
73  virtual Spectrum * GetSpectrumPtr ( );
74 
75  virtual void SetPlotDefaultOptions ( );
76 
77  // lecture/écriture d'un plot dans un fichier
78  virtual bool Write ( FILE * fptr ) const;
79  static GEVPlot * Read ( FILE * fptr, GEVPad *pad );
80 
81 //----------------------------------------------------------------------
82 // pour ROOT...
83  public:
84  /*! Définition à usage de ROOT... */
85  ClassDef(GEVPlot,0);
86 } ;
87 
88 
89 //----------------------------------------------------------------------
90 // METHODES INLINE
91 //----------------------------------------------------------------------
92 
93 /*! Retourne la dimension du spectre associé au tracé./ inline UInt_t GEVPlot::GetSpectrumDimension ( ) const { return ( (spec_ptr == NULL) ? 0 : spec_ptr->Dimension() ); } /*! Retourne le pointeur sur le spectre associé au tracé.*/ inline const Spectrum * GEVPlot::GetSpectrumPtr ( ) const { return ( spec_ptr ); } /*! Retourne le pointeur sur le spectre associé au tracé.*/ inline Spectrum * GEVPlot::GetSpectrumPtr ( ) { return ( spec_ptr ); } //====================================================================== #endif */
94 inline UInt_t GEVPlot::GetSpectrumDimension ( ) const
95  { return ( (spec_ptr == NULL) ? 0 : spec_ptr->Dimension() ); }
96 
97 /*! Retourne le pointeur sur le spectre associé au tracé./ inline const Spectrum * GEVPlot::GetSpectrumPtr ( ) const { return ( spec_ptr ); } /*! Retourne le pointeur sur le spectre associé au tracé.*/ inline Spectrum * GEVPlot::GetSpectrumPtr ( ) { return ( spec_ptr ); } //====================================================================== #endif */
98 inline const Spectrum * GEVPlot::GetSpectrumPtr ( ) const
99  { return ( spec_ptr ); }
100 
101 /*! Retourne le pointeur sur le spectre associé au tracé./ inline Spectrum * GEVPlot::GetSpectrumPtr ( ) { return ( spec_ptr ); } //====================================================================== #endif */
103  { return ( spec_ptr ); }
104 
105 
106 //======================================================================
107 #endif
ClassDef(GEVPlot, 0)
virtual UInt_t GetSpectrumDimension() const
Definition: GEVPlot.hh:94
virtual void SetPlotDefaultOptions()
Definition: GEVPlot.cpp:68
virtual const Spectrum * GetSpectrumPtr() const
Definition: GEVPlot.hh:98
Definition: Spectrum.hh:222
Definition: GEVPlotProperties.hh:38
Definition: GEVPad.hh:62
static GEVPlot * Read(FILE *fptr, GEVPad *pad)
Definition: GEVPlot.cpp:117
virtual ~GEVPlot()
Definition: GEVPlot.cpp:45
Spectrum * spec_ptr
Pointeur sur le spectre associé
Definition: GEVPlot.hh:51
GEVPlot & operator=(const GEVPlot &original)
Definition: GEVPlot.cpp:52
virtual u_int Dimension() const =0
GObject(GEVPlot)
Definition: GEVPlot.hh:40
virtual bool Write(FILE *fptr) const
Definition: GEVPlot.cpp:93
GEVPlot(Spectrum *spec=NULL)
Definition: GEVPlot.cpp:25