TGLCameraOverlay.h

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TGLCameraOverlay.h 33579 2010-05-19 12:43:08Z rdm $
00002 // Author: Alja Mrak-Tadel 2007
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_TGLCameraOverlay
00013 #define ROOT_TGLCameraOverlay
00014 
00015 #include "TAttAxis.h"
00016 #include "TGLOverlay.h"
00017 #include "TGLUtil.h"
00018 
00019 class TGLAxisPainter;
00020 class TGLFont;
00021 
00022 class TAttAxis;
00023 class TAxis;
00024 
00025 class TGLCameraOverlay : public TGLOverlayElement
00026 {
00027 public:
00028    enum EMode { kPlaneIntersect, kBar, kAxis, kGridFront, kGridBack };
00029 
00030 private:
00031    TGLCameraOverlay(const TGLCameraOverlay&);            // Not implemented
00032    TGLCameraOverlay& operator=(const TGLCameraOverlay&); // Not implemented
00033 
00034 protected:
00035    Bool_t         fShowOrthographic;
00036    Bool_t         fShowPerspective;
00037 
00038    EMode          fOrthographicMode;
00039    EMode          fPerspectiveMode;
00040 
00041    TGLAxisPainter *fAxisPainter;
00042    TAxis          *fAxis;
00043    Float_t         fAxisExtend;
00044    Bool_t          fUseAxisColors;
00045 
00046    TGLPlane       fExternalRefPlane;
00047    Bool_t         fUseExternalRefPlane;
00048 
00049    Double_t       fFrustum[4];
00050 
00051 
00052    void    RenderPlaneIntersect(TGLRnrCtx& rnrCtx);
00053    void    RenderAxis(TGLRnrCtx& rnrCtx, Bool_t drawGrid);
00054    void    RenderGrid(TGLRnrCtx& rnrCtx);
00055    void    RenderBar(TGLRnrCtx& rnrCtx);
00056 
00057 public:
00058    TGLCameraOverlay(Bool_t showOrtho=kTRUE, Bool_t showPersp=kFALSE);
00059    virtual ~TGLCameraOverlay();
00060 
00061    virtual  void   Render(TGLRnrCtx& rnrCtx);
00062 
00063    TGLPlane& RefExternalRefPlane() { return fExternalRefPlane; }
00064    void      UseExternalRefPlane(Bool_t x) { fUseExternalRefPlane=x; }
00065    Bool_t    GetUseExternalRefPlane() const { return fUseExternalRefPlane; }
00066 
00067    Int_t    GetPerspectiveMode() const { return fPerspectiveMode;}
00068    void     SetPerspectiveMode(EMode m) {fPerspectiveMode = m;}
00069    Int_t    GetOrthographicMode() const { return fOrthographicMode;}
00070    void     SetOrthographicMode(EMode m) {fOrthographicMode = m;}
00071 
00072    Bool_t   GetShowOrthographic() const { return fShowOrthographic; }
00073    void     SetShowOrthographic(Bool_t x) {fShowOrthographic =x;}
00074    Bool_t   GetShowPerspective() const { return fShowPerspective; }
00075    void     SetShowPerspective(Bool_t x) {fShowPerspective =x;}
00076 
00077    void     SetFrustum(TGLCamera& cam);
00078 
00079    TAttAxis* GetAttAxis();
00080 
00081    ClassDef(TGLCameraOverlay, 1); // Show coorinates of current camera frustum.
00082 };
00083 
00084 #endif

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