TRotMatrix.h

Go to the documentation of this file.
00001 // @(#)root/g3d:$Id: TRotMatrix.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Rene Brun   14/09/95
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, 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_TRotMatrix
00013 #define ROOT_TRotMatrix
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TRotMatrix                                                           //
00019 //                                                                      //
00020 // Rotation Matrix for 3-D geometry objects.                            //
00021 //                                                                      //
00022 //                                                                      //
00023 //////////////////////////////////////////////////////////////////////////
00024 
00025 #ifndef ROOT_TNamed
00026 #include "TNamed.h"
00027 #endif
00028 
00029 
00030 class TRotMatrix  : public TNamed {
00031 private:
00032    virtual      void  SetReflection();   // Set the "reflection" flag if det < 0
00033 
00034 protected:
00035    Int_t        fNumber;      //Rotation matrix number
00036    Int_t        fType;        //Type of matrix (0=identity, 1=reflexion, 2=otherwise)
00037    Double_t     fTheta;       //theta angle
00038    Double_t     fPhi;         //phi angle
00039    Double_t     fPsi;         //psi angle
00040    Double_t     fMatrix[9];   //Rotation matrix
00041 
00042 public:
00043    //TRotMatrix status bits
00044    enum {
00045       kReflection = BIT(23)   //  "Reflection" bit
00046    };
00047       
00048    TRotMatrix();
00049    TRotMatrix(const char *name, const char *title, Double_t *matrix);
00050    TRotMatrix(const char *name, const char *title, Double_t theta, Double_t phi, Double_t psi);
00051    TRotMatrix(const char *name, const char *title, Double_t theta1, Double_t phi1,
00052                                            Double_t theta2, Double_t phi2,
00053                                            Double_t theta3, Double_t phi3);
00054    virtual ~TRotMatrix();
00055    virtual Double_t  Determinant() const ;   // returns the determinant of this matrix
00056    virtual Double_t* GetMatrix()         {return &fMatrix[0];}
00057    virtual Int_t     GetNumber()   const {return fNumber;}
00058    virtual Int_t     GetType()     const {return fType;}
00059    virtual Double_t  GetTheta()    const {return fTheta;}
00060    virtual Double_t  GetPhi()      const {return fPhi;}
00061    virtual Double_t  GetPsi()      const {return fPsi;}
00062    virtual Double_t* GetGLMatrix(Double_t *rGLMatrix) const ;  // Convert this matrix to the OpenGL [4x4]
00063    virtual Bool_t    IsReflection() const {return TestBit(kReflection);}  // Return kTRUE if this matrix defines the reflection
00064    virtual const     Double_t* SetAngles(Double_t theta1, Double_t phi1,Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3);
00065    virtual void      SetMatrix(const Double_t *matrix);
00066    virtual void      SetName(const char *name);
00067 
00068    ClassDef(TRotMatrix,2)  //Rotation Matrix for 3-D geometry objects
00069 };
00070 
00071 inline void TRotMatrix::SetName(const char *) { }
00072 
00073 #endif

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