File indexing completed on 2025-01-18 10:11:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TArcBall
0013 #define ROOT_TArcBall
0014
0015 #include "Rtypes.h"
0016
0017 class TPoint;
0018
0019 class TArcBall {
0020 private:
0021 Double_t fThisRot[9];
0022 Double_t fLastRot[9];
0023 Double_t fTransform[16];
0024 Double_t fStVec[3];
0025 Double_t fEnVec[3];
0026 Double_t fAdjustWidth;
0027 Double_t fAdjustHeight;
0028
0029 TArcBall(const TArcBall &);
0030 TArcBall & operator = (const TArcBall &);
0031 void ResetMatrices();
0032 protected:
0033 void MapToSphere(const TPoint &NewPt, Double_t *NewVec)const;
0034 public:
0035 TArcBall(UInt_t NewWidth = 100, UInt_t NewHeight = 100);
0036 virtual ~TArcBall() { }
0037
0038 void SetBounds(UInt_t NewWidth, UInt_t NewHeight)
0039 {
0040 fAdjustWidth = 1.0f / ((NewWidth - 1.) * 0.5);
0041 fAdjustHeight = 1.0f / ((NewHeight - 1.) * 0.5);
0042 }
0043
0044 void Click(const TPoint &NewPt);
0045
0046 void Drag(const TPoint &NewPt);
0047 const Double_t *GetRotMatrix()const
0048 {
0049 return fTransform;
0050 }
0051
0052 ClassDef(TArcBall,0)
0053 };
0054
0055 #endif
0056