TGLOverlay.h

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TGLOverlay.h 34006 2010-06-21 10:36:05Z matevz $
00002 // Author:  Matevz Tadel, Feb 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, 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_TGLOverlay_H
00013 #define ROOT_TGLOverlay_H
00014 
00015 #include <GuiTypes.h>
00016 
00017 class TGLRnrCtx;
00018 class TGLOvlSelectRecord;
00019 
00020 #include <list>
00021 
00022 class TGLOverlayElement
00023 {
00024 public:
00025    enum ERole  { kUser, kViewer, kAnnotation, kAll };
00026 
00027    enum EState { kInvisible = 1, kDisabled = 2, kActive = 4,
00028                  kAllVisible = kDisabled | kActive };
00029 
00030 private:
00031    TGLOverlayElement(const TGLOverlayElement&);            // Not implemented
00032    TGLOverlayElement& operator=(const TGLOverlayElement&); // Not implemented
00033 
00034 protected:
00035    ERole   fRole;
00036    EState  fState;
00037 
00038    void ProjectionMatrixPushIdentity();
00039 
00040 public:
00041    TGLOverlayElement(ERole r=kUser, EState s=kActive) :
00042       fRole(r), fState(s) {}
00043    virtual ~TGLOverlayElement() {}
00044 
00045    virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
00046    virtual Bool_t MouseStillInside(TGLOvlSelectRecord& selRec);
00047    virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec,
00048                          Event_t* event);
00049    virtual void   MouseLeave();
00050 
00051    virtual void Render(TGLRnrCtx& rnrCtx) = 0;
00052 
00053    ERole   GetRole() const  { return fRole; }
00054    void    SetRole(ERole r) { fRole = r; }
00055 
00056    EState  GetState() const   { return fState; }
00057    void    SetState(EState s) { fState = s; }
00058 
00059    void    SetBinaryState(Bool_t s) { SetState(s ? kActive : kInvisible); }
00060 
00061    ClassDef(TGLOverlayElement, 0) // Base class for GL overlay elements.
00062 };
00063 
00064 
00065 class TGLOverlayList
00066 {
00067 private:
00068    TGLOverlayList(const TGLOverlayList&);            // Not implemented
00069    TGLOverlayList& operator=(const TGLOverlayList&); // Not implemented
00070 
00071 protected:
00072    std::list<TGLOverlayElement*> fElements;
00073 
00074 public:
00075    TGLOverlayList() : fElements() {}
00076    virtual ~TGLOverlayList() {}
00077 
00078    // void AddElement(TGLOverlayElement* element);
00079    // void RemoveElement(TGLOverlayElement* element);
00080 
00081    // TGLOverlayElement* SelectElement(TGLSelectRecord& selRec, Int_t nameOff);
00082 
00083    ClassDef(TGLOverlayList, 0) // Collection of overlay elements to draw/select together.
00084 };
00085 
00086 
00087 #endif

Generated on Tue Jul 5 14:16:48 2011 for ROOT_528-00b_version by  doxygen 1.5.1