Logo ROOT  
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
19{
20private:
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
40protected:
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
44public:
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
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
float Float_t
Definition: RtypesCore.h:53
#define ClassDef(name, id)
Definition: Rtypes.h:326
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition: TGLCamera.h:44
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'.
Definition: TGLUtil.h:386
Abstract base class for viewer manipulators, which allow direct in viewer manipulation of a (TGlPhysi...
Definition: TGLManip.h:29
Concrete physical shape - a GL drawable.
3D plane class - of format Ax + By + Cz + D = 0
Definition: TGLUtil.h:524
Rotate manipulator - attaches to physical shape and draws local axes widgets - rings drawn from attac...
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...
Bool_t fShallowFront
does active ring form shallow angle to eye?
TGLLine3 CalculateRingLine(const TPoint &mouse, const TGLCamera &camera) const
Calculated interaction line between 'mouse' viewport point, and current selected widget (ring),...
Double_t CalculateAngleDelta(const TPoint &mouse, const TGLCamera &camera)
Calculate angle delta for rotation based on new mouse position.
TGLPlane fActiveRingPlane
front or back of the active shallow ring?
virtual void Draw(const TGLCamera &camera) const
Draw rotate manipulator - axis rings drawn from attached physical center, in plane defined by axis as...
TGLLine3 fRingLineOld
TGLLine3 fRingLine
center of active ring
virtual Bool_t HandleButton(const Event_t &event, const TGLCamera &camera)
Handle mouse button event over manipulator - returns kTRUE if redraw required kFALSE otherwise.
TGLVertex3 fActiveRingCenter
plane of the active ring (widget)
TGLRotateManip()
Construct rotation manipulator not bound to any physical shape.
void DrawAxisRing(const TGLVertex3 &origin, const TGLVector3 &axis, Double_t radius, Float_t rgba[4]) const
virtual ~TGLRotateManip()
Destroy the rotation manipulator.
static Double_t Angle(const TGLVector3 &v1, const TGLVector3 &v2)
Calculate unsigned angle between vectors v1 and v2.
3 component (x/y/z) vector class.
Definition: TGLUtil.h:247
3 component (x/y/z) vertex class.
Definition: TGLUtil.h:83
Definition: TPoint.h:31