ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TGLRotateManip.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Richard Maunder 04/10/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, 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_TGLRotateManip
13 #define ROOT_TGLRotateManip
14 
15 #ifndef ROOT_TGLManip
16 #include "TGLManip.h"
17 #endif
18 
19 
20 class TGLRotateManip : public TGLManip
21 {
22 private:
23  // Active ring interaction - set on mouse down
24  // Shallow ring interaction
25  // Where the ring plane forms a shallow angle to the eye direction -
26  // a different interaction is required in these cases - see HandleMotion()
27  Bool_t fShallowRing; //! does active ring form shallow angle to eye?
28  Bool_t fShallowFront; //! front or back of the active shallow ring?
29  TGLPlane fActiveRingPlane; //! plane of the active ring (widget)
30  TGLVertex3 fActiveRingCenter; //! center of active ring
31  // TODO: Is ring center required - why not get from plane?
32 
33  // Normal interaction tracking (non-shallow)
36 
37  void DrawAxisRing(const TGLVertex3& origin, const TGLVector3& axis,
38  Double_t radius, Float_t rgba[4]) const;
39  Double_t CalculateAngleDelta(const TPoint& mouse, const TGLCamera& camera);
40  TGLLine3 CalculateRingLine(const TPoint& mouse, const TGLCamera& camera) const;
41 
42 protected:
43  static Double_t Angle(const TGLVector3& v1, const TGLVector3& v2);
44  static Double_t Angle(const TGLVector3& v1, const TGLVector3& v2, const TGLVector3& ref);
45 
46 public:
49  virtual ~TGLRotateManip();
50 
51  virtual void Draw(const TGLCamera& camera) const;
52  virtual Bool_t HandleButton(const Event_t& event, const TGLCamera& camera);
53  virtual Bool_t HandleMotion(const Event_t& event, const TGLCamera& camera);
54 
55  ClassDef(TGLRotateManip, 0); // GL rotation manipulator widget
56 };
57 
58 #endif
TGLVertex3 fActiveRingCenter
plane of the active ring (widget)
Abstract base class for viewer manipulators, which allow direct in viewer manipulation of a (TGlPhysi...
Definition: TGLManip.h:36
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition: TGLCamera.h:43
const Double_t * v1
Definition: TArcBall.cxx:33
float Float_t
Definition: RtypesCore.h:53
virtual Bool_t HandleButton(const Event_t &event, const TGLCamera &camera)
Handle mouse button event over manipulator - returns kTRUE if redraw required kFALSE otherwise...
TGLLine3 fRingLine
center of active ring
Bool_t fShallowFront
does active ring form shallow angle to eye?
bool Bool_t
Definition: RtypesCore.h:59
TGLViewer::ECameraType camera
Concrete physical shape - a GL drawable.
TGLPlane fActiveRingPlane
front or back of the active shallow ring?
3 component (x/y/z) vertex class.
Definition: TGLUtil.h:86
TGLRotateManip()
Construct rotation manipulator not bound to any physical shape.
3 component (x/y/z) vector class.
Definition: TGLUtil.h:250
virtual void Draw(const TGLCamera &camera) const
Draw rotate manipulator - axis rings drawn from attached physical center, in plane defined by axis as...
Rotate manipulator - attaches to physical shape and draws local axes widgets - rings drawn from attac...
Definition: TPoint.h:33
TGLLine3 fRingLineOld
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'...
Definition: TGLUtil.h:391
virtual Bool_t HandleMotion(const Event_t &event, const TGLCamera &camera)
Handle mouse motion over manipulator - if active (selected widget) rotate physical around selected ri...
double Double_t
Definition: RtypesCore.h:55
void DrawAxisRing(const TGLVertex3 &origin, const TGLVector3 &axis, Double_t radius, Float_t rgba[4]) const
Bool_t axis
Definition: geodemo.C:37
Double_t CalculateAngleDelta(const TPoint &mouse, const TGLCamera &camera)
Calculate angle delta for rotation based on new mouse position.
static Double_t Angle(const TGLVector3 &v1, const TGLVector3 &v2)
Calculate unsigned angle between vectors v1 and v2.
TGLLine3 CalculateRingLine(const TPoint &mouse, const TGLCamera &camera) const
Calculated interaction line between 'mouse' viewport point, and current selected widget (ring)...
3D plane class - of format Ax + By + Cz + D = 0
Definition: TGLUtil.h:529
ClassDef(TGLRotateManip, 0)
virtual ~TGLRotateManip()
Destroy the rotation manipulator.