#ifndef ROOT_TGLFontManager
#define ROOT_TGLFontManager
#include "TObjArray.h"
#include <list>
#include <vector>
#include <map>
class FTFont;
class TGLFontManager;
class TGLFont
{
public:
   enum EMode
   {
      kUndef = -1,
      kBitmap, kPixmap,
      kTexture, kOutline, kPolygon, kExtrude
   }; 
private:
   TGLFont& operator=(const TGLFont& o); 
   FTFont          *fFont;     
   TGLFontManager  *fManager;  
   Float_t          fDepth;  
protected:
   Int_t            fSize;   
   Int_t            fFile;   
   EMode            fMode;   
public:
   TGLFont();
   TGLFont(Int_t size, Int_t font, EMode mode, FTFont *f=0, TGLFontManager *mng=0);
   TGLFont(const TGLFont& o);            
   virtual ~TGLFont();
   void CopyAttributes(const TGLFont &o);
  
   Int_t GetSize() const { return fSize;}
   Int_t GetFile() const { return fFile;}
   EMode GetMode() const { return fMode;}
   void  SetFont(FTFont *f) { fFont =f;}
   const FTFont* GetFont() const { return fFont; }
   void  SetManager(TGLFontManager *mng) {fManager = mng;}
   const TGLFontManager* GetManager() const { return fManager; }
   Float_t GetDepth() const { return fDepth;}
   void  SetDepth(Float_t d) { fDepth = d; }
   
   void  BBox(const Text_t* txt,
               Float_t& llx, Float_t& lly, Float_t& llz,
               Float_t& urx, Float_t& ury, Float_t& urz) const;
   void  Render(const Text_t* txt) const;
   
   virtual void PreRender(Bool_t autoLight=kTRUE, Bool_t lightOn=kFALSE) const;
   virtual void PostRender() const;
   Bool_t operator< (const TGLFont& o) const
   {
      if (fSize == o.fSize)
      {
         if(fFile == o.fFile)
         {
            return fMode < o.fMode;
         }
         return fFile < o.fFile;
      }
      return fSize < o.fSize;
   }
   ClassDef(TGLFont, 0); 
};
class TGLFontManager
{
public:
   typedef std::vector<Int_t> FontSizeVec_t;
private:
   TGLFontManager(const TGLFontManager&);            
   TGLFontManager& operator=(const TGLFontManager&); 
   std::map<TGLFont, Int_t>  fFontMap;        
   std::list<const FTFont*>   fFontTrash;      
   static TObjArray     fgFontFileArray;      
   static FontSizeVec_t fgFontSizeArray;      
   static Bool_t        fgStaticInitDone;     
   static void          InitStatics();
public:
   TGLFontManager(){}
   virtual ~TGLFontManager();
   void   RegisterFont(Int_t size, Int_t file, TGLFont::EMode mode, TGLFont& out);
   void   RegisterFont(Int_t size, const Text_t* name, TGLFont::EMode mode, TGLFont& out);
   void   ReleaseFont(TGLFont& font);
   static TObjArray*        GetFontFileArray();
   static FontSizeVec_t*    GetFontSizeArray();
   void   ClearFontTrash();
   ClassDef(TGLFontManager, 0); 
};
#endif
Last change: Tue May 13 17:12:38 2008
Last generated: 2008-05-13 17:12
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.