Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:12

0001 // @(#)root/graf:$Id$
0002 // Author: Matthew.Adam.Dobbs   06/09/99
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 //--------------------------------------------------------------------------
0012 
0013 #ifndef ROOT_TLegendEntry
0014 #define ROOT_TLegendEntry
0015 
0016 
0017 #include "TObject.h"
0018 #include "TAttText.h"
0019 #include "TAttLine.h"
0020 #include "TAttFill.h"
0021 #include "TAttMarker.h"
0022 #include "TString.h"
0023 
0024 class TLegendEntry : public TObject, public TAttText, public TAttLine,
0025                      public TAttFill, public TAttMarker {
0026 public:
0027    TLegendEntry();
0028    TLegendEntry(const TObject *obj, const char *label = nullptr, Option_t *option="lpf" );
0029    TLegendEntry( const TLegendEntry &entry );
0030    ~TLegendEntry() override;
0031    void                  Copy( TObject &obj ) const override;
0032    virtual const char   *GetLabel() const { return fLabel.Data(); }
0033    virtual TObject      *GetObject() const { return fObject; }
0034    Option_t             *GetOption() const override { return fOption.Data(); }
0035    void                  Print( Option_t *option = "" ) const override;
0036    virtual void          SaveEntry( std::ostream &out, const char *name );
0037    virtual void          SetLabel( const char *label = "" ) { fLabel = label; } // *MENU*
0038    virtual void          SetObject(TObject* obj );
0039    virtual void          SetObject( const char *objectName );  // *MENU*
0040    virtual void          SetOption( Option_t *option="lpf" ) { fOption = option; } // *MENU*
0041 
0042 protected:
0043    TObject      *fObject;   ///< pointer to object being represented by this entry
0044    TString       fLabel;    ///< Text associated with the entry, will become latex
0045    TString       fOption;   ///< Options associated with this entry
0046 
0047 private:
0048    TLegendEntry& operator=(const TLegendEntry&) = delete;
0049 
0050    ClassDefOverride(TLegendEntry,1) // Storage class for one entry of a TLegend
0051 };
0052 
0053 #endif