12 #ifndef ROOT_TGLCamera
13 #define ROOT_TGLCamera
133 virtual void Reset() = 0;
223 Error(
"TGLCamera::FrustumBox()",
"cache dirty");
229 #endif // ROOT_TGLCamera
TGLBoundingBox fInterestFrustum
previous interest box (DEBUG)
void DrawDebugAids() const
Draw out some debugging aids for the camera:
void SetFixDefCenter(Bool_t x)
TGLMatrix fModVM
projection matrix (cached)
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
TGLRect ViewportRect(const TGLBoundingBox &box, TGLBoundingBox::EFace face) const
Calculate viewport rectangle which just contains projection of single 'face' of world frame bounding ...
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
TGLBoundingBox fInterestFrustumAsBox
frustum basis of current interest box - NOT a true BB! (DEBUG)
void SetFixDefCenterVec(Double_t x, Double_t y, Double_t z)
TGLVertex3 EyePoint() const
Return the camera eye point (vertex) in world space Camera must have valid frustum cache - call Apply...
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
Double_t GetTheta() const
Get angle between camera up axis.
TGLVector3 ViewportDeltaToWorld(const TGLVertex3 &worldRef, Double_t viewportXDelta, Double_t viewportYDelta, TGLMatrix *modviewMat=0) const
Apply a 2D viewport delta (shift) to the projection of worldRef onto viewport, returning the resultan...
virtual Bool_t RotateRad(Double_t hRotate, Double_t vRotate)
Rotate camera around center.
virtual Bool_t RotateArcBall(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Rotate the camera round view volume center established in Setup().
TGLVector3 EyeDirection() const
Extract the camera eye direction (vector), running from EyePoint() Camera must have valid frustum cac...
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Double_t GetFarClip() const
Double_t fLargestSeen
the interest box - created in UpdateInterest()
Double_t fDollyDefault
last applied far-clip
void Set(Double_t x, Double_t y, Double_t z)
TGLCamera()
Default base camera constructor.
const TGLMatrix & GetCamBase() const
virtual Bool_t IsOrthographic() const
void WindowToViewport(TGLVertex3 &vertex) const
virtual void Apply(const TGLBoundingBox &sceneBox, const TGLRect *pickRect=0) const =0
Double_t GetNearClip() const
TGLBoundingBox fInterestBox
viewport (GL coords - origin bottom left)
3 component (x/y/z) vertex class.
TGLVertex3 WorldToViewport(const TGLVertex3 &worldVertex, TGLMatrix *modviewMat=0) const
Convert a 3D world vertex to '3D' viewport (screen) one.
virtual void Setup(const TGLBoundingBox &box, Bool_t reset=kTRUE)=0
TGLMatrix & RefLastNoPickProjM() const
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.
TGLVertex3 ViewportToWorld(const TGLVertex3 &viewportVertex, TGLMatrix *modviewMat=0) const
Convert a '3D' viewport vertex to 3D world one.
const TGLMatrix & GetCamTrans() const
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().
3 component (x/y/z) vector class.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void SetCenterVecWarp(Double_t x, Double_t y, Double_t z)
Set camera center vector and do not keep the same combined camera transformation matrix.
void SetVAxisMinAngle(Float_t x)
TGLBoundingBox Frustum(Bool_t asBox=kTRUE) const
expansion c.f. aligned current frustum box
Double_t * GetCenterVec()
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.
TGLMatrix & RefCamTrans()
TGLPlane fFrustumPlanes[kPlanesPerFrustum]
object space clip matrix (cached)
TGLMatrix fClipM
modelView matrix (cached)
const TGLRect & RefViewport() const
Rgl::EOverlap ViewportOverlap(const TGLBoundingBox &box) const
Calculate overlap (kInside, kOutside, kPartial) of box projection onto viewport (as rect) against the...
virtual Bool_t Zoom(Int_t delta, Bool_t mod1, Bool_t mod2)=0
void WindowToViewport(TGLRect &rect) const
void SetExternalCenter(Bool_t x)
Set camera center diffrent than scene center, if enable is kTRUE.
virtual Bool_t Truck(Double_t xDelta, Double_t yDelta)
Truck the camera - 'move camera parallel to film plane'.
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'...
virtual ~TGLCamera()
Base camera destructor.
std::pair< Bool_t, TGLVertex3 > ViewportPlaneIntersection(Double_t viewportX, Double_t viewportY, const TGLPlane &worldPlane) const
Find the intersection of projection of supplied viewport point (a 3D world line - see ViewportToWorld...
TGLCamera & operator=(const TGLCamera &)
virtual void Configure(Double_t zoom, Double_t dolly, Double_t center[3], Double_t hRotate, Double_t vRotate)=0
Bool_t IsCacheDirty() const
virtual Bool_t IsPerspective() const
void SetCenterVec(Double_t x, Double_t y, Double_t z)
Set camera center vector.
Double_t fNearClip
current camera center
Float_t GetVAxisMinAngle()
TGLBoundingBox fPreviousInterestBox
TGLMatrix fLastNoPickProjM
timestamp
void ResetInterest()
Clear out the existing interest box.
static UInt_t fgDollyDeltaSens
Bool_t UpdateInterest(Bool_t force)
Update the internal interest box (fInterestBox) of the camera.
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'.
Rgl::EOverlap FrustumOverlap(const TGLBoundingBox &box) const
Calculate overlap (kInside, kOutside, kPartial) of box with camera frustum Camera must have valid fru...
const TGLMatrix & RefModelViewMatrix() const
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Mother of all ROOT objects.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
TGLVertex3 FrustumCenter() const
Find the center of the camera frustum from intersection of planes This method will work even with par...
Double_t * GetFixDefCenterVec()
TGLMatrix fProjM
no-pick projection matrix (cached)
Bool_t GetExternalCenter()
UInt_t fTimeStamp
cached items dirty?
void WindowToViewport(TPoint &point) const
const TGLPlane & FrustumPlane(EFrustumPlane plane) const
void SetViewport(const TGLRect &viewport)
Set viewport extents from passed 'viewport' rect.
TGLVector3 WorldDeltaToViewport(const TGLVertex3 &worldRef, const TGLVector3 &worldDelta) const
Convert a 3D vector worldDelta (shift) about vertex worldRef to a viewport (screen) '3D' vector...
Bool_t OfInterest(const TGLBoundingBox &box, Bool_t ignoreSize) const
Calculate if the an object defined by world frame bounding box is 'of interest' to the camera...
3D plane class - of format Ax + By + Cz + D = 0
static const Double_t fgInterestBoxExpansion
frustum basis (as box) of current interest box (DEBUG)
virtual Bool_t RotateArcBallRad(Double_t hRotate, Double_t vRotate)
Rotate camera around center.