forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TGLPlotCamera.h
62 lines (51 loc) · 1.77 KB
/
TGLPlotCamera.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// @(#)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