Logo ROOT   6.14/05
Reference Guide
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 #include "TGLManip.h"
16 
17 
18 class TGLRotateManip : public TGLManip
19 {
20 private:
21  // Active ring interaction - set on mouse down
22  // Shallow ring interaction
23  // Where the ring plane forms a shallow angle to the eye direction -
24  // a different interaction is required in these cases - see HandleMotion()
25  Bool_t fShallowRing; //! does active ring form shallow angle to eye?
26  Bool_t fShallowFront; //! front or back of the active shallow ring?
27  TGLPlane fActiveRingPlane; //! plane of the active ring (widget)
28  TGLVertex3 fActiveRingCenter; //! center of active ring
29  // TODO: Is ring center required - why not get from plane?
30 
31  // Normal interaction tracking (non-shallow)
34 
35  void DrawAxisRing(const TGLVertex3& origin, const TGLVector3& axis,
36  Double_t radius, Float_t rgba[4]) const;
37  Double_t CalculateAngleDelta(const TPoint& mouse, const TGLCamera& camera);
38  TGLLine3 CalculateRingLine(const TPoint& mouse, const TGLCamera& camera) const;
39 
40 protected:
41  static Double_t Angle(const TGLVector3& v1, const TGLVector3& v2);
42  static Double_t Angle(const TGLVector3& v1, const TGLVector3& v2, const TGLVector3& ref);
43 
44 public:
47  virtual ~TGLRotateManip();
48 
49  virtual void Draw(const TGLCamera& camera) const;
50  virtual Bool_t HandleButton(const Event_t& event, const TGLCamera& camera);
51  virtual Bool_t HandleMotion(const Event_t& event, const TGLCamera& camera);
52 
53  ClassDef(TGLRotateManip, 0); // GL rotation manipulator widget
54 };
55 
56 #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:28
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition: TGLCamera.h:43
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
virtual void Draw(const TGLCamera &camera) const
Draw rotate manipulator - axis rings drawn from attached physical center, in plane defined by axis as...
Bool_t fShallowFront
does active ring form shallow angle to eye?
bool Bool_t
Definition: RtypesCore.h:59
Concrete physical shape - a GL drawable.
TGLPlane fActiveRingPlane
front or back of the active shallow ring?
#define ClassDef(name, id)
Definition: Rtypes.h:320
3 component (x/y/z) vertex class.
Definition: TGLUtil.h:82
TGLRotateManip()
Construct rotation manipulator not bound to any physical shape.
3 component (x/y/z) vector class.
Definition: TGLUtil.h:246
Rotate manipulator - attaches to physical shape and draws local axes widgets - rings drawn from attac...
Definition: TPoint.h:31
TGLLine3 fRingLineOld
void DrawAxisRing(const TGLVertex3 &origin, const TGLVector3 &axis, Double_t radius, Float_t rgba[4]) const
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'...
Definition: TGLUtil.h:387
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
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.
3D plane class - of format Ax + By + Cz + D = 0
Definition: TGLUtil.h:525
TGLLine3 CalculateRingLine(const TPoint &mouse, const TGLCamera &camera) const
Calculated interaction line between 'mouse' viewport point, and current selected widget (ring)...
virtual ~TGLRotateManip()
Destroy the rotation manipulator.