Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGLRotateManip.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gl:$Id$
0002 // Author:  Richard Maunder  04/10/2005
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGLRotateManip
0013 #define ROOT_TGLRotateManip
0014 
0015 #include "TGLManip.h"
0016 
0017 
0018 class TGLRotateManip : public TGLManip
0019 {
0020 private:
0021    // Active ring interaction - set on mouse down
0022    // Shallow ring interaction
0023    // Where the ring plane forms a shallow angle to the eye direction -
0024    // a different interaction is required in these cases - see HandleMotion()
0025    Bool_t     fShallowRing;         //! does active ring form shallow angle to eye?
0026    Bool_t     fShallowFront;        //! front or back of the active shallow ring?
0027    TGLPlane   fActiveRingPlane;     //! plane of the active ring (widget)
0028    TGLVertex3 fActiveRingCenter;    //! center of active ring
0029    // TODO: Is ring center required - why not get from plane?
0030 
0031    // Normal interaction tracking (non-shallow)
0032    TGLLine3 fRingLine;
0033    TGLLine3 fRingLineOld;
0034 
0035    void DrawAxisRing(const TGLVertex3& origin, const TGLVector3& axis,
0036                      Double_t radius, Float_t rgba[4]) const;
0037    Double_t CalculateAngleDelta(const TPoint& mouse, const TGLCamera& camera);
0038    TGLLine3 CalculateRingLine(const TPoint& mouse, const TGLCamera& camera) const;
0039 
0040 protected:
0041    static Double_t Angle(const TGLVector3& v1, const TGLVector3& v2);
0042    static Double_t Angle(const TGLVector3& v1, const TGLVector3& v2, const TGLVector3& ref);
0043 
0044 public:
0045    TGLRotateManip();
0046    TGLRotateManip(TGLPhysicalShape* shape);
0047    ~TGLRotateManip() override;
0048 
0049    void   Draw(const TGLCamera& camera) const override;
0050    Bool_t HandleButton(const Event_t& event, const TGLCamera& camera) override;
0051    Bool_t HandleMotion(const Event_t& event, const TGLCamera& camera) override;
0052 
0053    ClassDefOverride(TGLRotateManip, 0); // GL rotation manipulator widget
0054 };
0055 
0056 #endif