library: libRGL
#include "TGLOrthoCamera.h"

TGLOrthoCamera


class description - header file - source file
viewCVS header - viewCVS source

class TGLOrthoCamera: public TGLCamera

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
TGLOrthoCamera()
TGLOrthoCamera(TGLOrthoCamera::EType type)
virtual~TGLOrthoCamera()
voidApply() const
virtual voidApply(const TGLBoundingBox& sceneBox, const TGLRect* pickRect = 0) const
static TClass*Class()
voidConfigure(Double_t left, Double_t right, Double_t top, Double_t bottom)
virtual Bool_tDolly(Int_t delta, Bool_t mod1, Bool_t mod2)
voidTGLCamera::DrawDebugAids() const
TGLVector3TGLCamera::EyeDirection() const
TGLVertex3TGLCamera::EyePoint() const
TGLVertex3TGLCamera::FrustumCenter() const
EOverlapTGLCamera::FrustumOverlap(const TGLBoundingBox& box) const
const TGLPlane&TGLCamera::FrustumPlane(TGLCamera::EFrustumPlane plane) const
Int_tGetHeight() const
Int_tGetWidth() const
Int_tGetX() const
Int_tGetY() const
virtual TClass*IsA() const
virtual voidMarkup(TGLCameraMarkupStyle* ms) const
Bool_tTGLCamera::OfInterest(const TGLBoundingBox& box, Bool_t ignoreSize) const
voidPan(Int_t px, Int_t py)
const TGLRect&TGLCamera::RefViewport() const
virtual voidReset()
voidTGLCamera::ResetInterest()
virtual Bool_tRotate(Int_t xDelta, Int_t yDelta)
voidRotateCamera(Int_t px, Int_t py)
voidSetCamera() const
virtual voidSetup(const TGLBoundingBox& box, Bool_t reset = kTRUE)
voidSetViewport(Int_t context)
voidSetViewVolume(const TGLVertex3* box)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
voidStartPan(Int_t px, Int_t py)
voidStartRotation(Int_t px, Int_t py)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual Bool_tTruck(Int_t x, Int_t y, Int_t xDelta, Int_t yDelta)
Bool_tTGLCamera::UpdateInterest(Bool_t force)
Bool_tViewportChanged() const
TGLVector3TGLCamera::ViewportDeltaToWorld(const TGLVertex3& worldRef, Double_t viewportXDelta, Double_t viewportYDelta) const
EOverlapTGLCamera::ViewportOverlap(const TGLBoundingBox& box) const
pair<Bool_t,TGLVertex3>TGLCamera::ViewportPlaneIntersection(const TPoint& viewport, const TGLPlane& worldPlane) const
pair<Bool_t,TGLVertex3>TGLCamera::ViewportPlaneIntersection(Double_t viewportX, Double_t viewportY, const TGLPlane& worldPlane) const
TGLRectTGLCamera::ViewportRect(const TGLBoundingBox& box, TGLBoundingBox::EFace face) const
TGLRectTGLCamera::ViewportRect(const TGLBoundingBox& box, const TGLBoundingBox::EFace* face = 0) const
TGLVertex3TGLCamera::ViewportToWorld(const TGLVertex3& viewportVertex) const
TGLLine3TGLCamera::ViewportToWorld(const TPoint& viewport) const
TGLLine3TGLCamera::ViewportToWorld(Double_t viewportX, Double_t viewportY) const
voidTGLCamera::WindowToViewport(TPoint& point) const
voidTGLCamera::WindowToViewport(TGLRect& rect) const
voidTGLCamera::WindowToViewport(TGLVertex3& vertex) const
voidTGLCamera::WindowToViewport(Int_t&, Int_t& y) const
TGLVector3TGLCamera::WorldDeltaToViewport(const TGLVertex3& worldRef, const TGLVector3& worldDelta) const
TGLVertex3TGLCamera::WorldToViewport(const TGLVertex3& worldVertex) const
virtual Bool_tZoom(Int_t delta, Bool_t mod1, Bool_t mod2)
voidZoomIn()
voidZoomOut()
protected:
Bool_tTGLCamera::AdjustAndClampVal(Double_t& val, Double_t min, Double_t max, Int_t screenShift, Int_t screenShiftRange, Bool_t mod1, Bool_t mod2) const
voidTGLCamera::UpdateCache() const
private:
voidInit()

Data Members

public:
enum EType { kXOY
kXOZ
kZOY
};
enum TGLCamera::EFrustumPlane { kNear
kLeft
kRight
kTop
kBottom
kFar
kPlanesPerFrustum
};
protected:
Bool_tTGLCamera::fCacheDirty! cached items dirty?
TGLMatrixTGLCamera::fProjM! projection matrix (cached)
TGLMatrixTGLCamera::fModVM! modelView matrix (cached)
TGLMatrixTGLCamera::fClipM! object space clip matrix (cached)
TGLPlaneTGLCamera::fFrustumPlanes[6]! frustum planes (cached)
TGLRectTGLCamera::fViewport! viewport (GL coords - origin bottom left)
TGLBoundingBoxTGLCamera::fInterestBox! the interest box - created in UpdateInterest()
Double_tTGLCamera::fLargestSeen! largest box volume seen in OfInterest() - used when
private:
TGLOrthoCamera::ETypefType! type (EType) - one of kXOY, kXOZ, kZOY
Double_tfZoomMin! minimum zoom factor
Double_tfZoomDefault! default zoom factor
Double_tfZoomMax! maximum zoom factor
TGLBoundingBoxfVolume!
Double_tfZoom! current zoom
TGLVector3fTruck! current truck vector
TGLMatrixfMatrix! orthographic orientation matrix
static UInt_tfgZoomDeltaSens
Double_tfShift
Double_tfOrthoBox[4]
TGLVertex3fCenter
TArcBallfArcBall
TPointfMousePos
Bool_tfVpChanged

Class Description

                                                                      
 TGLOrthoCamera                                                       
                                                                      
 Orthographic projection camera. Currently limited to three types     
 defined at construction time - kXOY, kXOZ, kZOY - where this refers  
 to the viewport plane axis - e.g. kXOY has X axis horizontal, Y      
 vertical - i.e. looking down Z axis with Y vertical.                 

 The plane types restriction could easily be removed to supported     
 arbitary ortho projections along any axis/orientation with free      
 rotations about them.                                                
                                                                      

TGLOrthoCamera(EType type)
 Construct orthographic camera with 'type' defining fixed view direction
 & orientation (in world frame):

 kXOY : X Horz. / Y Vert (looking towards +Z, Y up)
 kXOZ : X Horz. / Z Vert (looking towards +Y, Z up)
 kZOY : Z Horz. / Y Vert (looking towards +X, Y up)
 
TGLOrthoCamera()
 Construct orthographic camera.
~TGLOrthoCamera()
 Destroy orthographic camera
void Setup(const TGLBoundingBox & box, Bool_t reset)
 Setup camera limits suitible to view the world volume defined by 'box'
 and call Reset() to initialise camera.
void Reset()
 Reset the camera to defaults - trucking, zooming to reframe the world volume
 established in Setup(). Note: limits defined in Setup() are not adjusted.
Bool_t Dolly(Int_t delta, Bool_t mod1, Bool_t mod2)
 Dolly the camera - 'move camera along eye line, retaining lens focal length'.
 Arguments are:

 'delta' - mouse viewport delta (pixels) - +ive dolly in, -ive dolly out
 'mod1' / 'mod2' - sensitivity modifiers - see TGLCamera::AdjustAndClampVal()

 For an orthographic camera dollying and zooming are identical and both equate 
 logically to a rescaling of the viewport limits - without center shift. 
 There is no perspective foreshortening or lens 'focal length'.

 Returns kTRUE is redraw required (camera change), kFALSE otherwise.
Bool_t Truck(Int_t x, Int_t y, Int_t xDelta, Int_t yDelta)
 Truck the camera - 'move camera parallel to film plane'. The film 
 plane is defined by the EyePoint() / EyeDirection() pair. Define motion 
 using center point (x/y) and delta (xDelta/yDelta) - the mouse motion. 

 Returns kTRUE is redraw required (camera change), kFALSE otherwise.

 Note: Trucking is often mistakenly refered to as 'pan' or 'panning'. 
 Panning is swivelling the camera on it's own axis - the eye point.
Bool_t Rotate(Int_t /*xDelta*/, Int_t /*yDelta*/)
 Rotate the camera - 'swivel round the view volume center'.
 Ignored at present for orthographic cameras - have a fixed direction. 
 Could let the user or external code create non-axis
 ortho projects by adjusting H/V rotations in future.

 Returns kTRUE is redraw required (camera change), kFALSE otherwise.
void Apply(const TGLBoundingBox & /*box*/, const TGLRect * pickRect)
 Apply the camera to the current GL context, setting the viewport, projection
 and modelview matricies. After this verticies etc can be directly entered
 in the world frame. This also updates the cached frustum values, enabling
 all the projection, overlap tests etc defined in TGLCamera to be used.
 
 Arguments are:
 'box' - view volume box - ignored for ortho camera. Assumed to be same
 as one passed to Setup().
 'pickRect' - optional picking rect. If non-null, restrict drawing to this
 viewport rect.
void Configure(Double_t left, Double_t right, Double_t top, Double_t bottom)
 Configure the camera state
void SetViewport(Int_t context)
Setup viewport, if it was changed, plus reset arcball.
void SetViewVolume(const TGLVertex3 *box)
'box' is the TGLPlotPainter's back box's coordinates.
void StartRotation(Int_t px, Int_t py)
User clicks somewhere (px, py).
void RotateCamera(Int_t px, Int_t py)
Mouse movement.
void StartPan(Int_t px, Int_t py)
User clicks somewhere (px, py).
void Pan(Int_t px, Int_t py)
Pan camera.
void SetCamera()
Viewport and projection.
void Apply()
Applies rotations and translations before drawing
Int_t GetX()
viewport[0]
Int_t GetY()
viewport[1]
Int_t GetWidth()
viewport[2]
Int_t GetHeight()
viewport[3]
void ZoomIn()
Zoom in.
void ZoomOut()
Zoom out.
void Markup(TGLCameraMarkupStyle* ms)
 Write viewport dimensions on screen.
void Init()
 Methods
Bool_t ViewportChanged()
{return fVpChanged;}

Author: Richard Maunder 25/05/2005
Last update: root/gl:$Name: $:$Id: TGLOrthoCamera.cxx,v 1.16 2006/12/09 23:04:37 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.