ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 //////////////////////////////////////////////////////////////////////////
18 // //
19 // TLegendEntry //
20 // Matthew.Adam.Dobbs@Cern.CH, September 1999 //
21 // Storage class for one entry of a TLegend //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #ifndef ROOT_TObject
26 #include "TObject.h"
27 #endif
28 #ifndef ROOT_TAttText
29 #include "TAttText.h"
30 #endif
31 #ifndef ROOT_TAttLine
32 #include "TAttLine.h"
33 #endif
34 #ifndef ROOT_TAttFill
35 #include "TAttFill.h"
36 #endif
37 #ifndef ROOT_TAttMarker
38 #include "TAttMarker.h"
39 #endif
40 #ifndef ROOT_TString
41 #include "TString.h"
42 #endif
43 
44 class TLegendEntry : public TObject, public TAttText, public TAttLine,
45  public TAttFill, public TAttMarker {
46 public:
47  TLegendEntry();
48  TLegendEntry(const TObject *obj, const char *label = 0, Option_t *option="lpf" );
50  virtual ~TLegendEntry();
51  virtual void Copy( TObject &obj ) const;
52  virtual const char *GetLabel() const { return fLabel.Data(); }
53  virtual TObject *GetObject() const { return fObject; }
54  virtual Option_t *GetOption() const { return fOption.Data(); }
55  virtual void Print( Option_t *option = "" ) const;
56  virtual void SaveEntry( std::ostream &out, const char *name );
57  virtual void SetLabel( const char *label = "" ) { fLabel = label; } // *MENU*
58  virtual void SetObject(TObject* obj );
59  virtual void SetObject( const char *objectName ); // *MENU*
60  virtual void SetOption( Option_t *option="lpf" ) { fOption = option; } // *MENU*
61 
62 protected:
63  TObject *fObject; // pointer to object being represented by this entry
64  TString fLabel; // Text associated with the entry, will become latex
65  TString fOption; // Options associated with this entry
66 
67 private:
68  TLegendEntry& operator=(const TLegendEntry&); // Not implemented
69 
70  ClassDef(TLegendEntry,1) // Storage class for one entry of a TLegend
71 };
72 
73 #endif
const char Option_t
Definition: RtypesCore.h:62
Storage class for one entry of a TLegend.
Definition: TLegendEntry.h:44
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:32
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:32
ClassDef(TAttLine, 2)
TString fLabel
Definition: TLegendEntry.h:64
char * out
Definition: TBase64.cxx:29
virtual void SetLabel(const char *label="")
Definition: TLegendEntry.h:57
Text Attributes class.
Definition: TAttText.h:32
virtual void SetOption(Option_t *option="lpf")
Definition: TLegendEntry.h:60
Long64_t entry
virtual TObject * GetObject() const
Definition: TLegendEntry.h:53
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:54
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
TObject * fObject
Definition: TLegendEntry.h:63
TString fOption
Definition: TLegendEntry.h:65
virtual const char * GetLabel() const
Definition: TLegendEntry.h:52
virtual void Copy(TObject &obj) const
copy this TLegendEntry into obj
TObject * obj
TLegendEntry & operator=(const TLegendEntry &)
Line Attributes class.
Definition: TAttLine.h:32