Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
24class TLegendEntry : public TObject, public TAttText, public TAttLine,
25 public TAttFill, public TAttMarker {
26public:
28 TLegendEntry(const TObject *obj, const char *label = nullptr, Option_t *option="lpf" );
29 TLegendEntry( const TLegendEntry &entry );
30 virtual ~TLegendEntry();
31 void Copy( TObject &obj ) const override;
32 virtual const char *GetLabel() const { return fLabel.Data(); }
33 virtual TObject *GetObject() const { return fObject; }
34 Option_t *GetOption() const override { return fOption.Data(); }
35 void Print( Option_t *option = "" ) const override;
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
42protected:
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
47private:
49
50 ClassDefOverride(TLegendEntry,1) // Storage class for one entry of a TLegend
51};
52
53#endif
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
Fill Area Attributes class.
Definition TAttFill.h:19
Line Attributes class.
Definition TAttLine.h:18
Marker Attributes class.
Definition TAttMarker.h:19
Text Attributes class.
Definition TAttText.h:18
Storage class for one entry of a TLegend.
virtual TObject * GetObject() const
virtual void SetLabel(const char *label="")
virtual ~TLegendEntry()
TLegendEntry default destructor.
TObject * fObject
pointer to object being represented by this entry
virtual void SetOption(Option_t *option="lpf")
TLegendEntry()
TLegendEntry do-nothing default constructor.
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 ....
virtual const char * GetLabel() const
TLegendEntry & operator=(const TLegendEntry &)=delete
TString fLabel
Text associated with the entry, will become latex.
virtual void SetObject(TObject *obj)
(re)set the obj pointed to by this entry
void Copy(TObject &obj) const override
copy this TLegendEntry into obj
void Print(Option_t *option="") const override
dump this TLegendEntry to std::cout
TString fOption
Options associated with this entry.
Option_t * GetOption() const override
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:380