Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:00

0001 // @(#)root/gl:$Id$
0002 // Author: Timur Pocheptsov
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_TGLPlotCamera
0013 #define ROOT_TGLPlotCamera
0014 
0015 #include "TGLUtil.h"
0016 #include "TArcBall.h"
0017 #include "TPoint.h"
0018 
0019 class TGLPaintDevice;
0020 
0021 class TGLPlotCamera
0022 {
0023 private:
0024    TGLPlotCamera(const TGLPlotCamera&) = delete;
0025    TGLPlotCamera& operator=(const TGLPlotCamera&) = delete;
0026 
0027 protected:
0028    TGLRect        fViewport;
0029    Double_t       fZoom;
0030    Double_t       fShift;
0031    Double_t       fOrthoBox[4];
0032    TGLVertex3     fCenter;
0033    TGLVector3     fTruck;
0034    TArcBall       fArcBall;
0035    TPoint         fMousePos;
0036    Bool_t         fVpChanged;
0037 
0038 public:
0039    TGLPlotCamera();
0040    virtual ~TGLPlotCamera() {}
0041 
0042    void   SetViewport(const TGLRect &vp);
0043 
0044    void   SetViewVolume(const TGLVertex3 *box);
0045    void   StartRotation(Int_t px, Int_t py);
0046    void   RotateCamera(Int_t px, Int_t py);
0047    void   StartPan(Int_t px, Int_t py);
0048    void   Pan(Int_t px, Int_t py);
0049    void   ZoomIn();
0050    void   ZoomOut();
0051    void   SetCamera()const;
0052    void   Apply(Double_t phi, Double_t theta)const;
0053    Bool_t ViewportChanged()const{return fVpChanged;}
0054    Int_t  GetX()const;
0055    Int_t  GetY()const;
0056    Int_t  GetWidth()const;
0057    Int_t  GetHeight()const;
0058 
0059    ClassDef(TGLPlotCamera, 0); // Camera for plot-painters.
0060 };
0061 
0062 #endif