TGLRotateManip.h

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TGLRotateManip.h 30815 2009-10-20 13:49:22Z rdm $
00002 // Author:  Richard Maunder  04/10/2005
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGLRotateManip
00013 #define ROOT_TGLRotateManip
00014 
00015 #ifndef ROOT_TGLManip
00016 #include "TGLManip.h"
00017 #endif
00018 
00019 
00020 class TGLRotateManip : public TGLManip
00021 {
00022 private:
00023    // Active ring interaction - set on mouse down
00024    // Shallow ring interaction
00025    // Where the ring plane forms a shallow angle to the eye direction -
00026    // a different interaction is required in these cases - see HandleMotion()
00027    Bool_t     fShallowRing;         //! does active ring form shallow angle to eye?
00028    Bool_t     fShallowFront;        //! front or back of the active shallow ring?
00029    TGLPlane   fActiveRingPlane;     //! plane of the active ring (widget)
00030    TGLVertex3 fActiveRingCenter;    //! center of active ring
00031    // TODO: Is ring center required - why not get from plane?
00032 
00033    // Normal interaction tracking (non-shallow)
00034    TGLLine3 fRingLine;
00035    TGLLine3 fRingLineOld;
00036 
00037    void DrawAxisRing(const TGLVertex3& origin, const TGLVector3& axis,
00038                      Double_t radius, Float_t rgba[4]) const;
00039    Double_t CalculateAngleDelta(const TPoint& mouse, const TGLCamera& camera);
00040    TGLLine3 CalculateRingLine(const TPoint& mouse, const TGLCamera& camera) const;
00041 
00042 protected:
00043    static Double_t Angle(const TGLVector3& v1, const TGLVector3& v2);
00044    static Double_t Angle(const TGLVector3& v1, const TGLVector3& v2, const TGLVector3& ref);
00045 
00046 public:
00047    TGLRotateManip();
00048    TGLRotateManip(TGLPhysicalShape* shape);
00049    virtual ~TGLRotateManip();
00050 
00051    virtual void   Draw(const TGLCamera& camera) const;
00052    virtual Bool_t HandleButton(const Event_t& event, const TGLCamera& camera);
00053    virtual Bool_t HandleMotion(const Event_t& event, const TGLCamera& camera);
00054 
00055    ClassDef(TGLRotateManip, 0); // GL rotation manipulator widget
00056 };
00057 
00058 #endif

Generated on Tue Jul 5 14:16:53 2011 for ROOT_528-00b_version by  doxygen 1.5.1