Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/g3d:$Id$
0002 // Author: Rene Brun   14/09/95
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, 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_TRotMatrix
0013 #define ROOT_TRotMatrix
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TRotMatrix                                                           //
0019 //                                                                      //
0020 // Rotation Matrix for 3-D geometry objects.                            //
0021 //                                                                      //
0022 //                                                                      //
0023 //////////////////////////////////////////////////////////////////////////
0024 
0025 #include "TNamed.h"
0026 
0027 
0028 class TRotMatrix  : public TNamed {
0029 private:
0030    virtual      void  SetReflection();   // Set the "reflection" flag if det < 0
0031 
0032 protected:
0033    Int_t        fNumber;      //Rotation matrix number
0034    Int_t        fType;        //Type of matrix (0=identity, 1=reflexion, 2=otherwise)
0035    Double_t     fTheta;       //theta angle
0036    Double_t     fPhi;         //phi angle
0037    Double_t     fPsi;         //psi angle
0038    Double_t     fMatrix[9];   //Rotation matrix
0039 
0040 public:
0041    //TRotMatrix status bits
0042    enum {
0043       kReflection = BIT(23)   //  "Reflection" bit
0044    };
0045 
0046    TRotMatrix();
0047    TRotMatrix(const char *name, const char *title, Double_t *matrix);
0048    TRotMatrix(const char *name, const char *title, Double_t theta, Double_t phi, Double_t psi);
0049    TRotMatrix(const char *name, const char *title, Double_t theta1, Double_t phi1,
0050                                            Double_t theta2, Double_t phi2,
0051                                            Double_t theta3, Double_t phi3);
0052    ~TRotMatrix() override;
0053    virtual Double_t  Determinant() const ;   // returns the determinant of this matrix
0054    virtual Double_t* GetMatrix()         {return &fMatrix[0];}
0055    virtual Int_t     GetNumber()   const {return fNumber;}
0056    virtual Int_t     GetType()     const {return fType;}
0057    virtual Double_t  GetTheta()    const {return fTheta;}
0058    virtual Double_t  GetPhi()      const {return fPhi;}
0059    virtual Double_t  GetPsi()      const {return fPsi;}
0060    virtual Double_t* GetGLMatrix(Double_t *rGLMatrix) const ;  // Convert this matrix to the OpenGL [4x4]
0061    virtual Bool_t    IsReflection() const {return TestBit(kReflection);}  // Return kTRUE if this matrix defines the reflection
0062    virtual const     Double_t* SetAngles(Double_t theta1, Double_t phi1,Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3);
0063    virtual void      SetMatrix(const Double_t *matrix);
0064    void      SetName(const char *name) override;
0065 
0066    ClassDefOverride(TRotMatrix,2)  //Rotation Matrix for 3-D geometry objects
0067 };
0068 
0069 inline void TRotMatrix::SetName(const char *) { }
0070 
0071 #endif