Logo ROOT   6.14/05
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 #include "TObject.h"
18 #include "TAttText.h"
19 #include "TAttLine.h"
20 #include "TAttFill.h"
21 #include "TAttMarker.h"
22 #include "TString.h"
23 
24 class TLegendEntry : public TObject, public TAttText, public TAttLine,
25  public TAttFill, public TAttMarker {
26 public:
27  TLegendEntry();
28  TLegendEntry(const TObject *obj, const char *label = 0, Option_t *option="lpf" );
29  TLegendEntry( const TLegendEntry &entry );
30  virtual ~TLegendEntry();
31  virtual void Copy( TObject &obj ) const;
32  virtual const char *GetLabel() const { return fLabel.Data(); }
33  virtual TObject *GetObject() const { return fObject; }
34  virtual Option_t *GetOption() const { return fOption.Data(); }
35  virtual void Print( Option_t *option = "" ) const;
36  virtual void SaveEntry( std::ostream &out, const char *name );
37  virtual void SetLabel( const char *label = "" ) { fLabel = label; } // *MENU*
38  virtual void SetObject(TObject* obj );
39  virtual void SetObject( const char *objectName ); // *MENU*
40  virtual void SetOption( Option_t *option="lpf" ) { fOption = option; } // *MENU*
41 
42 protected:
43  TObject *fObject; ///< pointer to object being represented by this entry
44  TString fLabel; ///< Text associated with the entry, will become latex
45  TString fOption; ///< Options associated with this entry
46 
47 private:
48  TLegendEntry& operator=(const TLegendEntry&); // Not implemented
49 
50  ClassDef(TLegendEntry,1) // Storage class for one entry of a TLegend
51 };
52 
53 #endif
const char Option_t
Definition: RtypesCore.h:62
Storage class for one entry of a TLegend.
Definition: TLegendEntry.h:24
Basic string class.
Definition: TString.h:131
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:19
virtual void SetObject(TObject *obj)
(re)set the obj pointed to by this entry
Fill Area Attributes class.
Definition: TAttFill.h:19
#define ClassDef(name, id)
Definition: Rtypes.h:320
TLegendEntry()
TLegendEntry do-nothing default constructor.
virtual Option_t * GetOption() const
Definition: TLegendEntry.h:34
TString fLabel
Text associated with the entry, will become latex.
Definition: TLegendEntry.h:44
virtual void SetLabel(const char *label="")
Definition: TLegendEntry.h:37
virtual void Print(Option_t *option="") const
dump this TLegendEntry to std::cout
Text Attributes class.
Definition: TAttText.h:18
virtual TObject * GetObject() const
Definition: TLegendEntry.h:33
virtual void SetOption(Option_t *option="lpf")
Definition: TLegendEntry.h:40
virtual const char * GetLabel() const
Definition: TLegendEntry.h:32
virtual ~TLegendEntry()
TLegendEntry default destructor.
Mother of all ROOT objects.
Definition: TObject.h:37
TObject * fObject
pointer to object being represented by this entry
Definition: TLegendEntry.h:43
TString fOption
Options associated with this entry.
Definition: TLegendEntry.h:45
virtual void Copy(TObject &obj) const
copy this TLegendEntry into obj
TLegendEntry & operator=(const TLegendEntry &)
Line Attributes class.
Definition: TAttLine.h:18
char name[80]
Definition: TGX11.cxx:109
const char * Data() const
Definition: TString.h:364