
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.
| virtual | ~TGLCamera() |
| void | TObject::AbstractMethod(const char* method) 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 |
| Double_t | AdjustDelta(Double_t screenShift, Double_t deltaFactor, Bool_t mod1, Bool_t mod2) const |
| virtual void | TObject::AppendPad(Option_t* option = "") |
| virtual void | Apply(const TGLBoundingBox& sceneBox, const TGLRect* pickRect = 0) const |
| virtual void | TObject::Browse(TBrowser* b) |
| static TClass* | Class() |
| virtual const char* | TObject::ClassName() const |
| virtual void | TObject::Clear(Option_t* = "") |
| virtual TObject* | TObject::Clone(const char* newname = "") const |
| virtual Int_t | TObject::Compare(const TObject* obj) const |
| virtual void | Configure(Double_t zoom, Double_t dolly, Double_t* center, Double_t hRotate, Double_t vRotate) |
| virtual void | TObject::Copy(TObject& object) const |
| virtual void | TObject::Delete(Option_t* option = "")MENU |
| virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
| virtual Bool_t | Dolly(Int_t delta, Bool_t mod1, Bool_t mod2) |
| virtual void | TObject::Draw(Option_t* option = "") |
| virtual void | TObject::DrawClass() constMENU |
| virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
| void | DrawDebugAids() const |
| virtual void | TObject::Dump() constMENU |
| virtual void | TObject::Error(const char* method, const char* msgfmt) const |
| virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
| virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
| virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
| TGLVector3 | EyeDirection() const |
| TGLVertex3 | EyePoint() const |
| virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
| virtual TObject* | TObject::FindObject(const char* name) const |
| virtual TObject* | TObject::FindObject(const TObject* obj) const |
| TGLVertex3 | FrustumCenter() const |
| Rgl::EOverlap | FrustumOverlap(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_t | TObject::GetDtorOnly() |
| Bool_t | GetExternalCenter() |
| Double_t | GetFarClip() const |
| Double_t* | GetFixDefCenterVec() |
| virtual const char* | TObject::GetIconName() const |
| virtual const char* | TObject::GetName() const |
| Double_t | GetNearClip() const |
| virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
| static Bool_t | TObject::GetObjectStat() |
| virtual Option_t* | TObject::GetOption() const |
| Double_t | GetTheta() const |
| virtual const char* | TObject::GetTitle() const |
| virtual UInt_t | TObject::GetUniqueID() const |
| Float_t | GetVAxisMinAngle() |
| virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
| virtual ULong_t | TObject::Hash() const |
| void | IncTimeStamp() |
| virtual void | TObject::Info(const char* method, const char* msgfmt) const |
| virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
| virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
| virtual void | TObject::Inspect() constMENU |
| void | TObject::InvertBit(UInt_t f) |
| virtual TClass* | IsA() const |
| Bool_t | IsCacheDirty() const |
| virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
| virtual Bool_t | TObject::IsFolder() const |
| Bool_t | TObject::IsOnHeap() const |
| virtual Bool_t | IsOrthographic() const |
| virtual Bool_t | IsPerspective() const |
| virtual Bool_t | TObject::IsSortable() const |
| Bool_t | TObject::IsZombie() const |
| virtual void | TObject::ls(Option_t* option = "") const |
| void | TObject::MayNotUse(const char* method) const |
| virtual Bool_t | TObject::Notify() |
| void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
| Bool_t | OfInterest(const TGLBoundingBox& box, Bool_t ignoreSize) const |
| static void | TObject::operator delete(void* ptr) |
| static void | TObject::operator delete(void* ptr, void* vp) |
| static void | TObject::operator delete[](void* ptr) |
| static void | TObject::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 void | TObject::Paint(Option_t* option = "") |
| virtual void | TObject::Pop() |
| virtual void | TObject::Print(Option_t* option = "") const |
| virtual Int_t | TObject::Read(const char* name) |
| virtual void | TObject::RecursiveRemove(TObject* obj) |
| TGLMatrix& | RefCamBase() |
| TGLMatrix& | RefCamTrans() |
| TGLMatrix& | RefLastNoPickProjM() const |
| const TGLMatrix& | RefModelViewMatrix() const |
| TGLRect& | RefViewport() |
| const TGLRect& | RefViewport() const |
| virtual void | Reset() |
| void | TObject::ResetBit(UInt_t f) |
| void | ResetInterest() |
| virtual Bool_t | Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2) |
| virtual Bool_t | RotateArcBall(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2) |
| virtual Bool_t | RotateArcBallRad(Double_t hRotate, Double_t vRotate) |
| virtual Bool_t | RotateRad(Double_t hRotate, Double_t vRotate) |
| virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
| virtual void | TObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "") |
| void | TObject::SetBit(UInt_t f) |
| void | TObject::SetBit(UInt_t f, Bool_t set) |
| void | SetCenterVec(Double_t x, Double_t y, Double_t z) |
| void | SetCenterVecWarp(Double_t x, Double_t y, Double_t z) |
| virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
| static void | TObject::SetDtorOnly(void* obj) |
| void | SetExternalCenter(Bool_t x) |
| void | SetFixDefCenter(Bool_t x) |
| void | SetFixDefCenterVec(Double_t x, Double_t y, Double_t z) |
| static void | TObject::SetObjectStat(Bool_t stat) |
| virtual void | TObject::SetUniqueID(UInt_t uid) |
| virtual void | Setup(const TGLBoundingBox& box, Bool_t reset = kTRUE) |
| void | SetVAxisMinAngle(Float_t x) |
| void | SetViewport(const TGLRect& viewport) |
| virtual void | ShowMembers(TMemberInspector&) |
| virtual void | Streamer(TBuffer&) |
| void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
| virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
| Bool_t | TObject::TestBit(UInt_t f) const |
| Int_t | TObject::TestBits(UInt_t f) const |
| UInt_t | TimeStamp() const |
| virtual Bool_t | Truck(Double_t xDelta, Double_t yDelta) |
| virtual Bool_t | Truck(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2) |
| Bool_t | UpdateInterest(Bool_t force) |
| virtual void | TObject::UseCurrentStyle() |
| TGLVector3 | ViewportDeltaToWorld(const TGLVertex3& worldRef, Double_t viewportXDelta, Double_t viewportYDelta, TGLMatrix* modviewMat = 0) const |
| Rgl::EOverlap | ViewportOverlap(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 |
| TGLRect | ViewportRect(const TGLBoundingBox& box, TGLBoundingBox::EFace face) const |
| TGLRect | ViewportRect(const TGLBoundingBox& box, const TGLBoundingBox::EFace* face = 0) const |
| TGLLine3 | ViewportToWorld(const TPoint& viewport) const |
| TGLVertex3 | ViewportToWorld(const TGLVertex3& viewportVertex, TGLMatrix* modviewMat = 0) const |
| TGLLine3 | ViewportToWorld(Double_t viewportX, Double_t viewportY) const |
| virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
| void | WindowToViewport(TPoint& point) const |
| void | WindowToViewport(TGLRect& rect) const |
| void | WindowToViewport(TGLVertex3& vertex) const |
| void | WindowToViewport(Int_t&, Int_t& y) const |
| TGLVector3 | WorldDeltaToViewport(const TGLVertex3& worldRef, const TGLVector3& worldDelta) const |
| TGLVertex3 | WorldToViewport(const TGLVertex3& worldVertex, TGLMatrix* modviewMat = 0) const |
| virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
| virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
| virtual Bool_t | Zoom(Int_t delta, Bool_t mod1, Bool_t mod2) |
| virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
| void | TObject::MakeZombie() |
| void | UpdateCache() const |
| enum EFrustumPlane { | kNear | |
| kLeft | ||
| kRight | ||
| kTop | ||
| kBottom | ||
| kFar | ||
| kPlanesPerFrustum | ||
| }; | ||
| enum TObject::EStatusBits { | kCanDelete | |
| kMustCleanup | ||
| kObjInCanvas | ||
| kIsReferenced | ||
| kHasUUID | ||
| kCannotPick | ||
| kNoContextMenu | ||
| kInvalidObject | ||
| }; | ||
| enum TObject::[unnamed] { | kIsOnHeap | |
| kNotDeleted | ||
| kZombie | ||
| kBitMask | ||
| kSingleKey | ||
| kOverwrite | ||
| kWriteDelete | ||
| }; |
| Bool_t | fCacheDirty | ! cached items dirty? |
| TGLMatrix | fCamBase | tranformation to center and rotation from up to x vector |
| TGLMatrix | fCamTrans | transformation relative to fCamTrans |
| TGLVector3* | fCenter | ! current camera center |
| TGLMatrix | fClipM | ! object space clip matrix (cached) |
| TGLVector3 | fDefCenter | default camera center |
| Double_t | fDollyDefault | default distnce from viewing centre |
| Double_t | fDollyDistance | unit distance for camera movement in fwd/bck direction |
| TGLVector3 | fExtCenter | external camera center |
| Bool_t | fExternalCenter | use external center insead of scene center |
| TGLVector3 | fFDCenter | fixed default camera center |
| Double_t | fFarClip | ! last applied far-clip |
| Bool_t | fFixDefCenter | use fixed default center |
| TGLPlane | fFrustumPlanes[6] | ! frustum planes (cached) |
| TGLBoundingBox | fInterestBox | ! the interest box - created in UpdateInterest() |
| Double_t | fLargestSeen | ! largest box diagonal seen in OfInterest() - used when |
| TGLMatrix | fLastNoPickProjM | ! no-pick projection matrix (cached) |
| TGLMatrix | fModVM | ! modelView matrix (cached) |
| Double_t | fNearClip | ! last applied near-clip |
| TGLMatrix | fProjM | ! projection matrix (cached) |
| UInt_t | fTimeStamp | ! timestamp |
| Float_t | fVAxisMinAngle | minimal allowed angle between up and fCamTrans Z vector |
| TGLRect | fViewport | ! viewport (GL coords - origin bottom left) |
| Bool_t | fWasArcBalled | set when arc-ball rotation is used |
| static UInt_t | fgDollyDeltaSens |
| TGLBoundingBox | fInterestFrustum | ! frustum basis of current interest box - NOT a true BB! (DEBUG) |
| TGLBoundingBox | fInterestFrustumAsBox | ! frustum basis (as box) of current interest box (DEBUG) |
| TGLBoundingBox | fPreviousInterestBox | ! previous interest box (DEBUG) |
| static const Double_t | fgInterestBoxExpansion | ! expansion c.f. aligned current frustum box |

Return the the current camera frustum. If asBox == kFALSE return a true frustum (truncated square based pyramid). If asBox == kTRUE return a true box, using the far clipping plane intersection projected back to the near plane. Camera must have valid frustum cache - call Apply() after last modifcation, before using Note: TGLBoundingBox is not really valid when filled with truncated pyramid - this is used as a visual debug aid only so ok.
Return the camera eye point (vertex) in world space Camera must have valid frustum cache - call Apply() after last modifcation, before using
Find the center of the camera frustum from intersection of planes This method will work even with parallel left/right & top/bottom and infinite eye point of ortho cameras Camera must have valid frustum cache - call Apply() after last modifcation, before using
Calcaulte overlap (kInside, kOutside, kPartial) of box with camera frustum Camera must have valid frustum cache - call Apply() after last modifcation, before using
Calculate overlap (kInside, kOutside, kPartial) of box projection onto viewport (as rect) against the viewport rect. Camera must have valid frustum cache - call Apply() after last modifcation, before using.
Calculate viewport rectangle which just contains projection of single 'face' of world frame bounding box 'box' onto the viewport. Note use other version of ViewportRect() if you want whole 'box' contained
Calculate viewport rectangle which just contains projection of world frame bounding box 'box' onto the viewport. If face is null the rect contains the whole bounding box (8 vertices/6 faces). If face is non-null it indicates a box face, and the rect contains the single face (4 vertices). Note use other version of ViewportRect() if you wish to just pass a static EFace enum member (e.g. kFaceLowX) Note: i) Rectangle is NOT clipped by viewport limits - so can result in rect with corners outside viewport - negative etc ii) TGLRect provides int (pixel based) values - not subpxiel accurate iii) Camera must have valid frustum cache - call Apply() after last modifcation, before calling
Convert a 3D world vertex to '3D' viewport (screen) one. The X()/Y() components of the viewport vertex are the horizontal/vertical pixel positions. The Z() component is the viewport depth value - for a default depth range this is 0.0 (at near clip plane) to 1.0 (at far clip plane). See OpenGL gluProject & glDepth documentation Camera must have valid frustum cache - call Apply() after last modifcation, before using
Convert a 3D vector worldDelta (shift) about vertex worldRef to a viewport (screen) '3D' vector. The X()/Y() components of the vector are the horizontal vertical pixel deltas. The Z() component is the viewport depth delta - for a default depth range between 0.0 (at near clip plane) to 1.0 (at far clip plane) See OpenGL gluProject & glDepth documentation Camera must have valid frustum cache - call Apply()
Convert a '3D' viewport vertex to 3D world one. The X()/Y() components of viewportVertex are the horizontal/vertical pixel position.
Convert a 2D viewport position to 3D world line - the projection of the
viewport point into 3D space. Line runs from near to far camera clip planes
(the minimum and maximum visible depth). See also
TGLVertex3 TGLCamera::ViewportToWorld(const TGLVertex3 & viewportVertex) const
for 3D viewport -> 3D world vertex conversions.
See also OpenGL gluUnProject & glDepth documentation
Camera must have valid frustum cache - call Apply() after last modifcation, before using
Convert a 2D viewport position to 3D world line - the projection of the
viewport point into 3D space. Line runs from near to far camera clip planes
(the minimum and maximum visible depth). See also
TGLVertex3 TGLCamera::ViewportToWorld(const TGLVertex3 & viewportVertex) const
for 3D viewport -> 3D world vertex conversions.
See also OpenGL gluUnProject & glDepth documentation
Camera must have valid frustum cache - call Apply() after last modifcation, before using
Find the intersection of projection of supplied viewport point (a 3D world line - see ViewportToWorld) with supplied world plane. Returns std::pair of Bool_t and TGLVertex3. If line intersects std::pair.first (Bool_t) is kTRUE, and std::pair.second (TGLVertex) contains the intersection vertex. If line does not intersect (line and plane parallel) std::pair.first (Bool_t) if kFALSE, and std::pair.second (TGLVertex) is invalid. NOTE: The projection lines is extended for the plane intersection test hence the intersection vertex can lie outside the near/far clip regions (not visible) Camera must have valid frustum cache - call Apply() after last modifcation, before using
Find the intersection of projection of supplied viewport TPoint (a 3D world line - see ViewportToWorld) with supplied world plane. Returns std::pair of bool and vertex. If line intersects Camera must have valid frustum cache - call Apply() after last modifcation, before using
Calculate if the an object defined by world frame bounding box is 'of interest' to the camera. This is defined as box: i) intersecting completely or partially (kInside/kPartial) with cameras interest box (fInterestBox) ii) having significant length OR volume ratio compared to this interest box If a box is 'of interest' returns kTRUE, kFALSE otherwise. See TGLCamera::UpdateInterest() for more details of camera interest box. Note: Length/volume ratios NOT dependent on the projected size of box at current camera configuration as we do not want continual changes. This is used when (re) populating the scene with objects from external client. TODO: Might be more logical to move this test out to client - and have accessor for fInterestBox instead?
Update the internal interest box (fInterestBox) of the camera. The interest box is an orientated bounding box, calculated as an expanded container round the frustum. It is used to test if if object bounding boxes are of interest (should be accepted into viewer scene) for a camera - see TGLCamera::OfInterest() The interest box is updated if the frustum is no longer contained in the existing one, or a new one calculated on the current frustum differs significantly in volume (camera has been zoomed/dollyed sizable amount). If the interest box is updated we return kTRUE - kFALSE otherwise.
Adjust a passed REFERENCE value 'val', based on screenShift delta.
Two modifier flags ('mod1' / 'mod2' ) for sensitivity:
mod1 = kFALSE, mod2 = kFALSE : normal sensitivity (screenShift/screenShiftRange)
mod1 = kTRUE, mod2 = kFALSE : 0.1x sensitivity
mod1 = kTRUE, mod2 = kTRUE : 0.01x sensitivity
mod1 = kFALSE, mod2 = kTRUE : 10.0x sensitivity
'val' is modified and clamped to 'min' / 'max' range.
Return bool kTRUE if val actually changed.
Used as common interaction function for adjusting zoom/dolly etc
Adjust a passed screen value and apply modifiers. See AdjustAndClampVal() for details.
Draw out some debugging aids for the camera: i) The frustum used to create the current interest box (RED) ii) The same frustum as a squared off box (ORANGE) iii) The axis aligned version of the frustum used as interest box basis (YELLOW) iv) The current interest box (BLUE)
Set camera center vector and do not keep the same combined camera transformation matrix. It appears as if the camera warped to the new center.
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() Returns kTRUE is redraw required (camera change), kFALSE otherwise.
Return one of the planes forming the camera frustum
Camera manipulation interface (GL coord - origin bottom left)
If you manipulate camera ... also call IncTimeStamp() before redraw.
{ return fCamTrans; }Cameras expanded-frustum interest box