ROOT logo
// @(#)root/gl:$Id$
// Author: Timur Pocheptsov

/*************************************************************************
 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGLPlotCamera
#define ROOT_TGLPlotCamera

#include "TGLUtil.h"
#include "TArcBall.h"
#include "TPoint.h"

class TGLPaintDevice;

class TGLPlotCamera
{
private:
   TGLPlotCamera(const TGLPlotCamera&);            // Not implemented
   TGLPlotCamera& operator=(const TGLPlotCamera&); // Not implemented

protected:
   TGLRect        fViewport;
   Double_t       fZoom;
   Double_t       fShift;
   Double_t       fOrthoBox[4];
   TGLVertex3     fCenter;
   TGLVector3     fTruck;
   TArcBall       fArcBall;
   TPoint         fMousePos;
   Bool_t         fVpChanged;

public:
   TGLPlotCamera();
   virtual ~TGLPlotCamera() {}

   void   SetViewport(const TGLRect &vp);

   void   SetViewVolume(const TGLVertex3 *box);
   void   StartRotation(Int_t px, Int_t py);
   void   RotateCamera(Int_t px, Int_t py);
   void   StartPan(Int_t px, Int_t py);
   void   Pan(Int_t px, Int_t py);
   void   ZoomIn();
   void   ZoomOut();
   void   SetCamera()const;
   void   Apply(Double_t phi, Double_t theta)const;
   Bool_t ViewportChanged()const{return fVpChanged;}
   Int_t  GetX()const;
   Int_t  GetY()const;
   Int_t  GetWidth()const;
   Int_t  GetHeight()const;

   ClassDef(TGLPlotCamera, 0); // Camera for plot-painters.
};

#endif
 TGLPlotCamera.h:1
 TGLPlotCamera.h:2
 TGLPlotCamera.h:3
 TGLPlotCamera.h:4
 TGLPlotCamera.h:5
 TGLPlotCamera.h:6
 TGLPlotCamera.h:7
 TGLPlotCamera.h:8
 TGLPlotCamera.h:9
 TGLPlotCamera.h:10
 TGLPlotCamera.h:11
 TGLPlotCamera.h:12
 TGLPlotCamera.h:13
 TGLPlotCamera.h:14
 TGLPlotCamera.h:15
 TGLPlotCamera.h:16
 TGLPlotCamera.h:17
 TGLPlotCamera.h:18
 TGLPlotCamera.h:19
 TGLPlotCamera.h:20
 TGLPlotCamera.h:21
 TGLPlotCamera.h:22
 TGLPlotCamera.h:23
 TGLPlotCamera.h:24
 TGLPlotCamera.h:25
 TGLPlotCamera.h:26
 TGLPlotCamera.h:27
 TGLPlotCamera.h:28
 TGLPlotCamera.h:29
 TGLPlotCamera.h:30
 TGLPlotCamera.h:31
 TGLPlotCamera.h:32
 TGLPlotCamera.h:33
 TGLPlotCamera.h:34
 TGLPlotCamera.h:35
 TGLPlotCamera.h:36
 TGLPlotCamera.h:37
 TGLPlotCamera.h:38
 TGLPlotCamera.h:39
 TGLPlotCamera.h:40
 TGLPlotCamera.h:41
 TGLPlotCamera.h:42
 TGLPlotCamera.h:43
 TGLPlotCamera.h:44
 TGLPlotCamera.h:45
 TGLPlotCamera.h:46
 TGLPlotCamera.h:47
 TGLPlotCamera.h:48
 TGLPlotCamera.h:49
 TGLPlotCamera.h:50
 TGLPlotCamera.h:51
 TGLPlotCamera.h:52
 TGLPlotCamera.h:53
 TGLPlotCamera.h:54
 TGLPlotCamera.h:55
 TGLPlotCamera.h:56
 TGLPlotCamera.h:57
 TGLPlotCamera.h:58
 TGLPlotCamera.h:59
 TGLPlotCamera.h:60
 TGLPlotCamera.h:61
 TGLPlotCamera.h:62