Logo ROOT   6.07/09
Reference Guide
TLegendEntry.h
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Matthew.Adam.Dobbs 06/09/99
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 //--------------------------------------------------------------------------
12 
13 #ifndef ROOT_TLegendEntry
14 #define ROOT_TLegendEntry
15 
16 
17 #ifndef ROOT_TObject
18 #include "TObject.h"
19 #endif
20 #ifndef ROOT_TAttText
21 #include "TAttText.h"
22 #endif
23 #ifndef ROOT_TAttLine
24 #include "TAttLine.h"
25 #endif
26 #ifndef ROOT_TAttFill
27 #include "TAttFill.h"
28 #endif
29 #ifndef ROOT_TAttMarker
30 #include "TAttMarker.h"
31 #endif
32 #ifndef ROOT_TString
33 #include "TString.h"
34 #endif
35 
36 class TLegendEntry : public TObject, public TAttText, public TAttLine,
37  public TAttFill, public TAttMarker {
38 public:
39  TLegendEntry();
40  TLegendEntry(const TObject *obj, const char *label = 0, Option_t *option="lpf" );
41  TLegendEntry( const TLegendEntry &entry );
42  virtual ~TLegendEntry();
43  virtual void Copy( TObject &obj ) const;
44  virtual const char *GetLabel() const { return fLabel.Data(); }
45  virtual TObject *GetObject() const { return fObject; }
46  virtual Option_t *GetOption() const { return fOption.Data(); }
47  virtual void Print( Option_t *option = "" ) const;
48  virtual void SaveEntry( std::ostream &out, const char *name );
49  virtual void SetLabel( const char *label = "" ) { fLabel = label; } // *MENU*
50  virtual void SetObject(TObject* obj );
51  virtual void SetObject( const char *objectName ); // *MENU*
52  virtual void SetOption( Option_t *option="lpf" ) { fOption = option; } // *MENU*
53 
54 protected:
55  TObject *fObject; ///< pointer to object being represented by this entry
56  TString fLabel; ///< Text associated with the entry, will become latex
57  TString fOption; ///< Options associated with this entry
58 
59 private:
60  TLegendEntry& operator=(const TLegendEntry&); // Not implemented
61 
62  ClassDef(TLegendEntry,1) // Storage class for one entry of a TLegend
63 };
64 
65 #endif
const char Option_t
Definition: RtypesCore.h:62
Storage class for one entry of a TLegend.
Definition: TLegendEntry.h:36
Basic string class.
Definition: TString.h:137
virtual void SaveEntry(std::ostream &out, const char *name)
Save this TLegendEntry as C++ statements on output stream out to be used with the SaveAs ...
Marker Attributes class.
Definition: TAttMarker.h:24
const char * Data() const
Definition: TString.h:349
virtual void SetObject(TObject *obj)
(re)set the obj pointed to by this entry
Fill Area Attributes class.
Definition: TAttFill.h:24
#define ClassDef(name, id)
Definition: Rtypes.h:254
TLegendEntry()
TLegendEntry do-nothing default constructor.
TString fLabel
Text associated with the entry, will become latex.
Definition: TLegendEntry.h:56
virtual void SetLabel(const char *label="")
Definition: TLegendEntry.h:49
Text Attributes class.
Definition: TAttText.h:24
virtual void SetOption(Option_t *option="lpf")
Definition: TLegendEntry.h:52
virtual TObject * GetObject() const
Definition: TLegendEntry.h:45
virtual void Print(Option_t *option="") const
dump this TLegendEntry to std::cout
virtual ~TLegendEntry()
TLegendEntry default destructor.
virtual Option_t * GetOption() const
Definition: TLegendEntry.h:46
Mother of all ROOT objects.
Definition: TObject.h:44
TObject * fObject
pointer to object being represented by this entry
Definition: TLegendEntry.h:55
TString fOption
Options associated with this entry.
Definition: TLegendEntry.h:57
virtual const char * GetLabel() const
Definition: TLegendEntry.h:44
virtual void Copy(TObject &obj) const
copy this TLegendEntry into obj
TLegendEntry & operator=(const TLegendEntry &)
Line Attributes class.
Definition: TAttLine.h:24
char name[80]
Definition: TGX11.cxx:109