Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:43

0001 // @(#)root/eve:$Id$
0002 // Authors: Alja & Matevz Tadel 2008
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, 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 #ifndef ROOT_TEveText
0013 #define ROOT_TEveText
0014 
0015 #include "TNamed.h"
0016 #include "TAtt3D.h"
0017 #include "TAttBBox.h"
0018 
0019 #include "TEveElement.h"
0020 
0021 class TEveText : public TEveElement,
0022                  public TNamed,
0023                  public TAtt3D,
0024                  public TAttBBox
0025 {
0026 private:
0027    TEveText(const TEveText&);            // Not implemented
0028    TEveText& operator=(const TEveText&); // Not implemented
0029 
0030 protected:
0031    TString   fText;       // text
0032    Color_t   fTextColor;  // text color
0033 
0034    Int_t     fFontSize;   // FTFont face size
0035    Int_t     fFontFile;   // FTFont file name
0036    Int_t     fFontMode;   // FTFont FTGL class id
0037 
0038    Float_t   fExtrude;    // extrude depth
0039 
0040    Bool_t    fAutoLighting; // use default lighting
0041    Bool_t    fLighting;     // force lighting
0042 
0043    Float_t   fPolygonOffset[2]; // depth test
0044 
0045 public:
0046    TEveText(const char* txt="");
0047    ~TEveText() override {}
0048 
0049    Int_t   GetFontSize() const { return fFontSize; }
0050    Int_t   GetFontFile() const { return fFontFile; }
0051    Int_t   GetFontMode() const { return fFontMode; }
0052    void    SetFontSize(Int_t size, Bool_t validate = kTRUE);
0053    void    SetFontFile(Int_t file){ fFontFile = file; }
0054    void    SetFontFile(const char* name);
0055    void    SetFontMode(Int_t mode);
0056 
0057    const   char* GetText() const  { return fText.Data(); }
0058    void    SetText(const char* t) { fText = t; }
0059 
0060    Bool_t  GetLighting() const      { return fLighting; }
0061    void    SetLighting(Bool_t isOn) { fLighting = isOn; }
0062 
0063    Bool_t  GetAutoLighting() const      { return fAutoLighting; }
0064    void    SetAutoLighting(Bool_t isOn) { fAutoLighting = isOn; }
0065 
0066    Float_t GetExtrude() const    { return fExtrude; }
0067    void    SetExtrude(Float_t x) { fExtrude = x;    }
0068 
0069    Float_t  GetPolygonOffset(Int_t i) const { return fPolygonOffset[i]; }
0070    void     SetPolygonOffset(Float_t factor, Float_t units);
0071 
0072    void   Paint(Option_t* option="") override;
0073    void   ComputeBBox() override;
0074 
0075    const TGPicture* GetListTreeIcon(Bool_t open=kFALSE) override;
0076 
0077    ClassDefOverride(TEveText, 0); // Class for visualisation of text with FTGL font.
0078 };
0079 
0080 #endif