Logo ROOT  
Reference Guide
TArcBall.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov 03/08/2004
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TArcBall
13 #define ROOT_TArcBall
14 
15 #include "Rtypes.h"
16 
17 class TPoint;
18 
19 class TArcBall {
20 private:
24  Double_t fStVec[3]; //Saved click vector
25  Double_t fEnVec[3]; //Saved drag vector
26  Double_t fAdjustWidth; //Mouse bounds width
27  Double_t fAdjustHeight; //Mouse bounds height
28  //Non-copyable
29  TArcBall(const TArcBall &);
31  void ResetMatrices();
32 protected:
33  void MapToSphere(const TPoint &NewPt, Double_t *NewVec)const;
34 public:
35  TArcBall(UInt_t NewWidth = 100, UInt_t NewHeight = 100);
36  virtual ~TArcBall() { }
37 
38  void SetBounds(UInt_t NewWidth, UInt_t NewHeight)
39  {
40  fAdjustWidth = 1.0f / ((NewWidth - 1.) * 0.5);
41  fAdjustHeight = 1.0f / ((NewHeight - 1.) * 0.5);
42  }
43  //Mouse down
44  void Click(const TPoint &NewPt);
45  //Mouse drag, calculate rotation
46  void Drag(const TPoint &NewPt);
47  const Double_t *GetRotMatrix()const
48  {
49  return fTransform;
50  }
51 
52  ClassDef(TArcBall,0) //ArcBall manipulator
53 };
54 
55 #endif
56 
TArcBall::fEnVec
Double_t fEnVec[3]
Definition: TArcBall.h:25
TArcBall::Drag
void Drag(const TPoint &NewPt)
Mouse drag, calculate rotation.
Definition: TArcBall.cxx:260
TArcBall::SetBounds
void SetBounds(UInt_t NewWidth, UInt_t NewHeight)
Definition: TArcBall.h:38
TArcBall::fLastRot
Double_t fLastRot[9]
Definition: TArcBall.h:22
TArcBall::MapToSphere
void MapToSphere(const TPoint &NewPt, Double_t *NewVec) const
map to sphere
Definition: TArcBall.cxx:210
TArcBall
Implements the arc-ball rotation manipulator.
Definition: TArcBall.h:19
TArcBall::fTransform
Double_t fTransform[16]
Definition: TArcBall.h:23
TArcBall::operator=
TArcBall & operator=(const TArcBall &)
TArcBall::GetRotMatrix
const Double_t * GetRotMatrix() const
Definition: TArcBall.h:47
TArcBall::fThisRot
Double_t fThisRot[9]
Definition: TArcBall.h:21
unsigned int
TArcBall::TArcBall
TArcBall(const TArcBall &)
TArcBall::fStVec
Double_t fStVec[3]
Definition: TArcBall.h:24
TPoint
Definition: TPoint.h:31
Double_t
double Double_t
Definition: RtypesCore.h:59
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TArcBall::Click
void Click(const TPoint &NewPt)
Mouse down.
Definition: TArcBall.cxx:249
TArcBall::fAdjustWidth
Double_t fAdjustWidth
Definition: TArcBall.h:26
TArcBall::fAdjustHeight
Double_t fAdjustHeight
Definition: TArcBall.h:27
TArcBall::~TArcBall
virtual ~TArcBall()
Definition: TArcBall.h:36
TArcBall::ResetMatrices
void ResetMatrices()
Set rotation matrix as union.
Definition: TArcBall.cxx:287
Rtypes.h