A++ » INCLUDE » TGLCamera

class TGLCamera: public TObject


TGLCamera

Abstract base camera class - concrete classes for orthographic and
persepctive cameras derive from it. This class maintains values for
the current:
i)   Viewport
ii)  Projection, modelview and clip matricies - extracted from GL
iii) The 6 frustum planes
iv)  Expanded frustum interest box

It provides methods for various projection, overlap and intersection
tests for viewport and world locations, against the true frustum and
 expanded interest box, and for extracting eye position and direction.

It also defines the pure virtual manipulation interface methods the
concrete ortho and prespective classes must implement.

Function Members (Methods)

 
    This is an abstract class, constructors will not be documented.
    Look at the header to check for available constructors.

public:
virtual~TGLCamera()
voidTObject::AbstractMethod(const char* method) const
Bool_tAdjustAndClampVal(Double_t& val, Double_t min, Double_t max, Int_t screenShift, Int_t screenShiftRange, Bool_t mod1, Bool_t mod2) const
Double_tAdjustDelta(Double_t screenShift, Double_t deltaFactor, Bool_t mod1, Bool_t mod2) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidApply(const TGLBoundingBox& sceneBox, const TGLRect* pickRect = 0) const
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidConfigure(Double_t zoom, Double_t dolly, Double_t[3] center, Double_t hRotate, Double_t vRotate)
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual Bool_tDolly(Int_t delta, Bool_t mod1, Bool_t mod2)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
voidDrawDebugAids() const
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
TGLVector3EyeDirection() const
TGLVertex3EyePoint() const
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
TGLVertex3FrustumCenter() const
Rgl::EOverlapFrustumOverlap(const TGLBoundingBox& box) const
const TGLPlane&FrustumPlane(TGLCamera::EFrustumPlane plane) const
const TGLMatrix&GetCamBase() const
const TGLMatrix&GetCamTrans() const
Double_t*GetCenterVec()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Bool_tGetExternalCenter()
Double_tGetFarClip() const
Double_t*GetFixDefCenterVec()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
Double_tGetNearClip() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Double_tGetTheta() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Float_tGetVAxisMinAngle()
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
voidIncTimeStamp()
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tIsCacheDirty() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tIsOrthographic() const
virtual Bool_tIsPerspective() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
Bool_tOfInterest(const TGLBoundingBox& box, Bool_t ignoreSize) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
TGLMatrix&RefCamBase()
TGLMatrix&RefCamTrans()
TGLMatrix&RefLastNoPickProjM() const
const TGLMatrix&RefModelViewMatrix() const
TGLRect&RefViewport()
const TGLRect&RefViewport() const
virtual voidReset()
voidTObject::ResetBit(UInt_t f)
voidResetInterest()
virtual Bool_tRotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
virtual Bool_tRotateArcBall(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
virtual Bool_tRotateArcBallRad(Double_t hRotate, Double_t vRotate)
virtual Bool_tRotateRad(Double_t hRotate, Double_t vRotate)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetCenterVec(Double_t x, Double_t y, Double_t z)
voidSetCenterVecWarp(Double_t x, Double_t y, Double_t z)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetExternalCenter(Bool_t x)
voidSetFixDefCenter(Bool_t x)
voidSetFixDefCenterVec(Double_t x, Double_t y, Double_t z)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidSetup(const TGLBoundingBox& box, Bool_t reset = kTRUE)
voidSetVAxisMinAngle(Float_t x)
voidSetViewport(const TGLRect& viewport)
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TGLCamera()
TGLCamera(const TGLVector3& hAxis, const TGLVector3& vAxis)
UInt_tTimeStamp() const
virtual Bool_tTruck(Double_t xDelta, Double_t yDelta)
virtual Bool_tTruck(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Bool_tUpdateInterest(Bool_t force)
virtual voidTObject::UseCurrentStyle()
TGLVector3ViewportDeltaToWorld(const TGLVertex3& worldRef, Double_t viewportXDelta, Double_t viewportYDelta, TGLMatrix* modviewMat = 0) const
Rgl::EOverlapViewportOverlap(const TGLBoundingBox& box) const
pair<Bool_t,TGLVertex3>ViewportPlaneIntersection(const TPoint& viewport, const TGLPlane& worldPlane) const
pair<Bool_t,TGLVertex3>ViewportPlaneIntersection(Double_t viewportX, Double_t viewportY, const TGLPlane& worldPlane) const
TGLRectViewportRect(const TGLBoundingBox& box, TGLBoundingBox::EFace face) const
TGLRectViewportRect(const TGLBoundingBox& box, const TGLBoundingBox::EFace* face = 0) const
TGLLine3ViewportToWorld(const TPoint& viewport) const
TGLVertex3ViewportToWorld(const TGLVertex3& viewportVertex, TGLMatrix* modviewMat = 0) const
TGLLine3ViewportToWorld(Double_t viewportX, Double_t viewportY) const
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
voidWindowToViewport(TPoint& point) const
voidWindowToViewport(TGLRect& rect) const
voidWindowToViewport(TGLVertex3& vertex) const
voidWindowToViewport(Int_t&, Int_t& y) const
TGLVector3WorldDeltaToViewport(const TGLVertex3& worldRef, const TGLVector3& worldDelta) const
TGLVertex3WorldToViewport(const TGLVertex3& worldVertex, TGLMatrix* modviewMat = 0) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
virtual Bool_tZoom(Int_t delta, Bool_t mod1, Bool_t mod2)
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
voidUpdateCache() const

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TGLCamera::EFrustumPlanekBottom
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TGLCamera::EFrustumPlanekFar
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TGLCamera::EFrustumPlanekLeft
static TObject::EStatusBitsTObject::kMustCleanup
static TGLCamera::EFrustumPlanekNear
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TGLCamera::EFrustumPlanekPlanesPerFrustum
static TGLCamera::EFrustumPlanekRight
static TObject::(anonymous)TObject::kSingleKey
static TGLCamera::EFrustumPlanekTop
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
Bool_tfCacheDirty! cached items dirty?
TGLMatrixfCamBasetranformation to center and rotation from up to x vector
TGLMatrixfCamTranstransformation relative to fCamTrans
TGLVector3*fCenter! current camera center
TGLMatrixfClipM! object space clip matrix (cached)
TGLVector3fDefCenterdefault camera center
Double_tfDollyDefaultdefault distnce from viewing centre
Double_tfDollyDistanceunit distance for camera movement in fwd/bck direction
TGLVector3fExtCenterexternal camera center
Bool_tfExternalCenteruse external center insead of scene center
TGLVector3fFDCenterfixed default camera center
Double_tfFarClip! last applied far-clip
Bool_tfFixDefCenteruse fixed default center
TGLPlanefFrustumPlanes[6]! frustum planes (cached)
TGLBoundingBoxfInterestBox! the interest box - created in UpdateInterest()
Double_tfLargestSeen! largest box diagonal seen in OfInterest() - used when
TGLMatrixfLastNoPickProjM! no-pick projection matrix (cached)
TGLMatrixfModVM! modelView matrix (cached)
Double_tfNearClip! last applied near-clip
TGLMatrixfProjM! projection matrix (cached)
UInt_tfTimeStamp! timestamp
Float_tfVAxisMinAngleminimal allowed angle between up and fCamTrans Z vector
TGLRectfViewport! viewport (GL coords - origin bottom left)
Bool_tfWasArcBalledset when arc-ball rotation is used
static UInt_tfgDollyDeltaSens
private:
TGLBoundingBoxfInterestFrustum! frustum basis of current interest box - NOT a true BB! (DEBUG)
TGLBoundingBoxfInterestFrustumAsBox! frustum basis (as box) of current interest box (DEBUG)
TGLBoundingBoxfPreviousInterestBox! previous interest box (DEBUG)
static const Double_tfgInterestBoxExpansion! expansion c.f. aligned current frustum box

Class Charts

Inheritance Chart:
TObject
TGLCamera
TGLOrthoCamera
TGLPerspectiveCamera

Function documentation

const TGLPlane & FrustumPlane(TGLCamera::EFrustumPlane plane) const
 Return one of the planes forming the camera frustum
TGLBoundingBox Frustum(Bool_t asBox = kTRUE) const
 Methods
TGLCamera(const TGLCamera& )
 Non-copyable class
TGLCamera & operator=(const TGLCamera& )
TGLBoundingBox fInterestBox; //! the interest box - created in UpdateInterest()
mutable Double_t fLargestSeen; //! largest box diagonal seen in OfInterest()
! bootstrapping interest box
void UpdateCache() const
 Internal cache update - const as the actual camera configuration is unaffected
TGLCamera()
TGLCamera(const TGLVector3& hAxis, const TGLVector3& vAxis)
virtual ~TGLCamera()
Bool_t IsOrthographic() const
{ return kFALSE; }
Bool_t IsPerspective() const
{ return kFALSE; }
const TGLMatrix& RefModelViewMatrix() const
{ return fModVM; }
Bool_t IsCacheDirty() const
{ return fCacheDirty; }
void IncTimeStamp()
UInt_t TimeStamp() const
{ return fTimeStamp; }
void SetViewport(const TGLRect& viewport)
TGLRect& RefViewport()
{ return fViewport; }
const TGLRect& RefViewport() const
{ return fViewport; }
void Setup(const TGLBoundingBox& box, Bool_t reset = kTRUE)
 Camera manipulation interface (GL coord - origin bottom left)
void Reset()
Bool_t Dolly(Int_t delta, Bool_t mod1, Bool_t mod2)
Bool_t Zoom(Int_t delta, Bool_t mod1, Bool_t mod2)
Bool_t Truck(Double_t xDelta, Double_t yDelta)
Bool_t Truck(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Bool_t RotateRad(Double_t hRotate, Double_t vRotate)
Bool_t RotateArcBall(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Bool_t RotateArcBallRad(Double_t hRotate, Double_t vRotate)
void Apply(const TGLBoundingBox& sceneBox, const TGLRect* pickRect = 0) 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
void SetExternalCenter(Bool_t x)
Bool_t GetExternalCenter()
{ return fExternalCenter; }
void SetCenterVec(Double_t x, Double_t y, Double_t z)
void SetCenterVecWarp(Double_t x, Double_t y, Double_t z)
Double_t* GetCenterVec()
{ return fCenter->Arr(); }
void SetFixDefCenter(Bool_t x)
{ fFixDefCenter = x; }
void SetFixDefCenterVec(Double_t x, Double_t y, Double_t z)
{ fFDCenter.Set(x, y, z); }
Double_t* GetFixDefCenterVec()
{ return fFDCenter.Arr(); }
Double_t GetNearClip() const
{ return fNearClip; }
Double_t GetFarClip() const
{ return fFarClip; }
const TGLMatrix& GetCamBase() const
{ return fCamBase; }
const TGLMatrix& GetCamTrans() const
 If you manipulate camera ... also call IncTimeStamp() before redraw.
{ return fCamTrans; }
TGLMatrix& RefCamBase()
{ return fCamBase; }
TGLMatrix& RefCamTrans()
{ return fCamTrans; }
Double_t GetTheta() const
TGLMatrix& RefLastNoPickProjM() const
{ return fLastNoPickProjM; }
TGLVertex3 EyePoint() const
 Current orientation and frustum
TGLVector3 EyeDirection() const
TGLVertex3 FrustumCenter() const
Rgl::EOverlap FrustumOverlap(const TGLBoundingBox& box) const
 Overlap / projection / intersection tests
 Viewport is GL coorinate system - origin bottom/left
Rgl::EOverlap ViewportOverlap(const TGLBoundingBox& box) const
TGLRect ViewportRect(const TGLBoundingBox& box, TGLBoundingBox::EFace face) const
TGLRect ViewportRect(const TGLBoundingBox& box, const TGLBoundingBox::EFace* face = 0) const
TGLVertex3 WorldToViewport(const TGLVertex3& worldVertex, TGLMatrix* modviewMat = 0) const
TGLVector3 WorldDeltaToViewport(const TGLVertex3& worldRef, const TGLVector3& worldDelta) const
TGLVertex3 ViewportToWorld(const TGLVertex3& viewportVertex, TGLMatrix* modviewMat = 0) const
TGLLine3 ViewportToWorld(Double_t viewportX, Double_t viewportY) const
TGLLine3 ViewportToWorld(const TPoint& viewport) const
TGLVector3 ViewportDeltaToWorld(const TGLVertex3& worldRef, Double_t viewportXDelta, Double_t viewportYDelta, TGLMatrix* modviewMat = 0) const
std::pair<Bool_t, TGLVertex3> ViewportPlaneIntersection(Double_t viewportX, Double_t viewportY, const TGLPlane& worldPlane) const
std::pair<Bool_t, TGLVertex3> ViewportPlaneIntersection(const TPoint& viewport, const TGLPlane& worldPlane) const
void WindowToViewport(Int_t& , Int_t& y) const
 Window to GL viewport conversion - invert Y
{ y = fViewport.Height() - y; }
void WindowToViewport(TPoint& point) const
{ point.SetY(fViewport.Height() - point.GetY()); }
void WindowToViewport(TGLRect& rect) const
{ rect.Y() = fViewport.Height() - rect.Y(); }
void WindowToViewport(TGLVertex3& vertex) const
{ vertex.Y() = fViewport.Height() - vertex.Y(); }
Float_t GetVAxisMinAngle()
{return fVAxisMinAngle;}
void SetVAxisMinAngle(Float_t x)
void Configure(Double_t zoom, Double_t dolly, Double_t[3] center, Double_t hRotate, Double_t vRotate)
 Cameras expanded-frustum interest box
void ResetInterest()
void DrawDebugAids() const
 Debuging - draw frustum and interest boxes