00001 // @(#)root/eve:$Id: TEveText.h 33864 2010-06-14 09:47:19Z matevz $ 00002 // Authors: Alja & Matevz Tadel 2008 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TEveText 00013 #define ROOT_TEveText 00014 00015 #include "TNamed.h" 00016 #include "TAtt3D.h" 00017 #include "TAttBBox.h" 00018 00019 #include "TEveElement.h" 00020 00021 class TEveText : public TEveElement, 00022 public TNamed, 00023 public TAtt3D, 00024 public TAttBBox 00025 { 00026 private: 00027 TEveText(const TEveText&); // Not implemented 00028 TEveText& operator=(const TEveText&); // Not implemented 00029 00030 protected: 00031 TString fText; // text 00032 Color_t fTextColor; // text color 00033 00034 Int_t fFontSize; // FTFont face size 00035 Int_t fFontFile; // FTFont file name 00036 Int_t fFontMode; // FTFont FTGL class id 00037 00038 Float_t fExtrude; // extrude depth 00039 00040 Bool_t fAutoLighting; // use default lighting 00041 Bool_t fLighting; // force lighting 00042 00043 Float_t fPolygonOffset[2]; // depth test 00044 00045 public: 00046 TEveText(const char* txt=""); 00047 virtual ~TEveText() {} 00048 00049 Int_t GetFontSize() const { return fFontSize; } 00050 Int_t GetFontFile() const { return fFontFile; } 00051 Int_t GetFontMode() const { return fFontMode; } 00052 void SetFontSize(Int_t size, Bool_t validate = kTRUE); 00053 void SetFontFile(Int_t file){ fFontFile = file; } 00054 void SetFontFile(const char* name); 00055 void SetFontMode(Int_t mode); 00056 00057 const char* GetText() const { return fText.Data(); } 00058 void SetText(const char* t) { fText = t; } 00059 00060 Bool_t GetLighting() const { return fLighting; } 00061 void SetLighting(Bool_t isOn) { fLighting = isOn; } 00062 00063 Bool_t GetAutoLighting() const { return fAutoLighting; } 00064 void SetAutoLighting(Bool_t isOn) { fAutoLighting = isOn; } 00065 00066 Float_t GetExtrude() const { return fExtrude; } 00067 void SetExtrude(Float_t x) { fExtrude = x; } 00068 00069 Float_t GetPolygonOffset(Int_t i) const { return fPolygonOffset[i]; } 00070 void SetPolygonOffset(Float_t factor, Float_t units); 00071 00072 virtual void Paint(Option_t* option=""); 00073 virtual void ComputeBBox(); 00074 00075 virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE); 00076 00077 ClassDef(TEveText, 0); // Class for visualisation of text with FTGL font. 00078 }; 00079 00080 #endif