39 TGLCamera(TGLVector3( 0.0, 0.0, 1.0), TGLVector3(0.0, 1.0, 0.0)),
41 fEnableRotate(kFALSE), fDollyToZoom(kTRUE),
42 fZoomMin(0.001), fZoomDefault(0.78), fZoomMax(1000.0),
43 fVolume(TGLVertex3(-100.0, -100.0, -100.0), TGLVertex3(100.0, 100.0, 100.0)),
55 fEnableRotate(kFALSE), fDollyToZoom(kTRUE),
56 fZoomMin(0.001), fZoomDefault(0.78), fZoomMax(1000.0),
57 fVolume(TGLVertex3(-100.0, -100.0, -100.0), TGLVertex3(100.0, 100.0, 100.0)),
86 TGLVertex3 center = box.
Center();
142 return Zoom(delta, mod1, mod2);
163 if (
AdjustAndClampVal(fZoom, fZoomMin, fZoomMax, -delta*2, fgZoomDeltaSens, mod1, mod2))
181 if (fZoom < fZoomMin) {
194 if (fZoom > fZoomMax) {
212 return Truck(-xstep, -ystep);
240 const TGLRect * pickRect)
const
246 glMatrixMode(GL_PROJECTION);
248 glMatrixMode(GL_MODELVIEW);
253 glMatrixMode(GL_PROJECTION);
261 gluPickMatrix(rect.
X(), rect.
Y(), rect.
Width(), rect.
Height(),
279 glOrtho(-halfRangeX, halfRangeX,
280 -halfRangeY, halfRangeY,
286 glMatrixMode(GL_MODELVIEW);
291 TGLVector3 center = pos - fwd;
294 gluLookAt(pos[0], pos[1], pos[2],
295 center[0], center[1], center[2],
296 up[0], up[1], up[2]);
Double_t fZoom
x, y size of scene from camera view
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
virtual Bool_t Dolly(Int_t delta, Bool_t mod1, Bool_t mod2)
Dolly the camera.
TGLVector3 GetTranslation() const
Return the translation component of matrix.
void SetZoomMax(Double_t z)
Set maximum zoom factor.
16 component (4x4) transform matrix - column MAJOR as per GL.
Double_t AdjustDelta(Double_t screenShift, Double_t deltaFactor, Bool_t mod1, Bool_t mod2) const
Adjust a passed screen value and apply modifiers.
Double_t fFarClip
last applied near-clip
TGLVertex3 Center() const
virtual Bool_t RotateRad(Double_t hRotate, Double_t vRotate)
Rotate camera around center.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Double_t fDollyDefault
last applied far-clip
virtual Bool_t Zoom(Int_t delta, Bool_t mod1, Bool_t mod2)
Zoom the camera - 'adjust lens focal length, retaining camera position'.
virtual void Apply(const TGLBoundingBox &sceneBox, const TGLRect *pickRect=0) const
Apply the camera to the current GL context, setting the viewport, projection and modelview matrices...
TGLRect fViewport
frustum planes (cached)
void UpdateCache() const
largest box diagonal seen in OfInterest() - used when bootstrapping interest box
Viewport (pixel base) 2D rectangle class.
Double_t fDefXSize
scene volume
virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Rotate the camera round view volume center established in Setup().
void SetIdentity()
Set matrix to identity.
TGLVector3 Extents() const
virtual void Setup(const TGLBoundingBox &box, Bool_t reset=kTRUE)
Setup camera limits suitable to view the world volume defined by 'box' and call Reset() to initialise...
void WindowToViewport(Int_t &, Int_t &y) const
Bool_t AdjustAndClampVal(Double_t &val, Double_t min, Double_t max, Int_t screenShift, Int_t screenShiftRange, Bool_t mod1, Bool_t mod2) const
Adjust a passed REFERENCE value 'val', based on screenShift delta.
TGLVector3 GetBaseVec(Int_t b) const
virtual ~TGLOrthoCamera()
Destroy orthographic camera.
virtual Bool_t Truck(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Truck the camera - 'move camera parallel to film plane'.
void SetCenterVec(Double_t x, Double_t y, Double_t z)
Set camera center vector.
Double_t fNearClip
current camera center
const Int_t * CArr() const
TGLMatrix fLastNoPickProjM
timestamp
virtual void Reset()
Reset the camera to defaults - trucking, zooming to reframe the world volume established in Setup()...
virtual Bool_t Dolly(Int_t delta, Bool_t mod1, Bool_t mod2)
Dolly the camera - 'move camera along eye line, retaining lens focal length'.
virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Rotate the camera - 'swivel round the view volume center'.
virtual void Configure(Double_t zoom, Double_t dolly, Double_t center[3], Double_t hRotate, Double_t vRotate)
Configure the camera state.
Orthographic projection camera.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
TGLMatrix fProjM
no-pick projection matrix (cached)
Double_t Sqrt(Double_t x)
void MoveLF(Int_t ai, Double_t amount)
Translate in local frame.
void SetZoomMin(Double_t z)
Set minimum zoom factor.