Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLPerspectiveCamera.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Richard Maunder 25/05/2005
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGLPerspectiveCamera
13#define ROOT_TGLPerspectiveCamera
14
15#include "TGLCamera.h"
16
17//////////////////////////////////////////////////////////////////////////
18// //
19// TGLPerspectiveCamera //
20// //
21// Perspective projection camera - with characteristic foreshortening. //
22// //
23//////////////////////////////////////////////////////////////////////////
24
26{
27private:
28 // Fields
30
33
34public:
36 TGLPerspectiveCamera(const TGLVector3 & hAxis, const TGLVector3 & vAxis);
37 ~TGLPerspectiveCamera() override;
38
39 Bool_t IsPerspective() const override { return kTRUE; }
40
41 Double_t GetFOV() const { return fFOV; }
42 void SetFOV(Double_t fov) { fFOV = fov; }
43
44 void Setup(const TGLBoundingBox & box, Bool_t reset=kTRUE) override;
45 void Reset() override;
46 Bool_t Zoom (Int_t delta, Bool_t mod1, Bool_t mod2) override;
47 using TGLCamera::Truck;
48 Bool_t Truck(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2) override;
49 void Apply(const TGLBoundingBox & box, const TGLRect * pickRect = nullptr) const override;
50
51 // External scripting control
52 void Configure(Double_t fov, Double_t dolly, Double_t center[3],
53 Double_t hRotate, Double_t vRotate) override;
54
55 ClassDefOverride(TGLPerspectiveCamera,1) // Camera for perspective view.
56};
57
58#endif // ROOT_TGLPerspectiveCamera
59
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition TGLCamera.h:44
virtual Bool_t Truck(Double_t xDelta, Double_t yDelta)
Truck the camera - 'move camera parallel to film plane'.
Perspective projection camera - with characteristic foreshortening.
void Setup(const TGLBoundingBox &box, Bool_t reset=kTRUE) override
Setup camera limits suitable to view the world volume defined by 'box' and call Reset() to initialise...
void Configure(Double_t fov, Double_t dolly, Double_t center[3], Double_t hRotate, Double_t vRotate) override
Configure the camera state.
Bool_t Zoom(Int_t delta, Bool_t mod1, Bool_t mod2) override
Zoom the camera - 'adjust lens focal length, retaining camera position'.
void Apply(const TGLBoundingBox &box, const TGLRect *pickRect=nullptr) const override
Apply the camera to the current GL context, setting the viewport, projection and modelview matrices.
Bool_t IsPerspective() const override
~TGLPerspectiveCamera() override
Destroy perspective camera.
TGLPerspectiveCamera()
Construct default XOZ perspective camera.
Bool_t Truck(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2) override
Truck the camera - 'move camera parallel to film plane'.
void Reset() override
Reset the camera to defaults - reframe the world volume established in Setup() in default state.
void SetFOV(Double_t fov)
Viewport (pixel base) 2D rectangle class.
Definition TGLUtil.h:422
3 component (x/y/z) vector class.
Definition TGLUtil.h:248
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition fillpatterns.C:1