TTUBE.h

Go to the documentation of this file.
00001 // @(#)root/g3d:$Id: TTUBE.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Nenad Buncic   18/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_TTUBE
00013 #define ROOT_TTUBE
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////////////
00017 //                                                                        //
00018 // TTUBE                                                                  //
00019 //                                                                        //
00020 // This tube has 3 parameters, the inside radius, the outside radius, and //
00021 // the half length in z. Optional parameter is number of segments, also   //
00022 // known as precision (default value is 20).                              //
00023 //                                                                        //
00024 ////////////////////////////////////////////////////////////////////////////
00025 
00026 #ifndef ROOT_TShape
00027 #include "TShape.h"
00028 #endif
00029 
00030 
00031 const Int_t kDivNum = 20;               //default number of divisions
00032 
00033 
00034 class TTUBE : public TShape {
00035 protected:
00036 
00037    Float_t fRmin;        // ellipse  semi-axis   in  X inside
00038    Float_t fRmax;        // ellipse  semi-axis   in  X outside
00039 
00040    Float_t fDz;          // half length in z
00041    Int_t   fNdiv;        // number of segments (precision)
00042 
00043    Float_t fAspectRatio; // defines  (the ellipse semi-axis in Y)/(the ellipse semi-axis in X)
00044 
00045    // Internal cache
00046    mutable Double_t   *fSiTab;   //! Table of sin(fPhi1) .... sin(fPhil+fDphi1)
00047    mutable Double_t   *fCoTab;   //! Table of cos(fPhi1) .... cos(fPhil+fDphi1)
00048 
00049    TTUBE(const TTUBE&);
00050    TTUBE& operator=(const TTUBE&);
00051 
00052    virtual void    MakeTableOfCoSin() const;  // Create the table of the fSiTab; fCoTab
00053    virtual void    SetPoints(Double_t *points) const;
00054    virtual void    SetSegsAndPols(TBuffer3D & buffer) const;
00055 
00056 public:
00057    TTUBE();
00058    TTUBE(const char *name, const char *title, const char *material, Float_t rmin, Float_t rmax, Float_t dz, Float_t aspect=1);
00059    TTUBE(const char *name, const char *title, const char *material, Float_t rmax, Float_t dz);
00060    virtual ~TTUBE();
00061 
00062    virtual Int_t   DistancetoPrimitive(Int_t px, Int_t py);
00063    virtual const TBuffer3D &GetBuffer3D(Int_t reqSections) const;
00064    virtual Float_t GetRmin() const  {return fRmin;}
00065    virtual Float_t GetRmax() const  {return fRmax;}
00066    virtual Float_t GetDz()   const  {return fDz;}
00067    virtual Int_t   GetNdiv() const  {return fNdiv;}
00068    virtual Float_t GetAspectRatio() const {return fAspectRatio;}
00069    virtual Int_t   GetNumberOfDivisions () const {if (fNdiv) return fNdiv; else return kDivNum;}
00070    virtual void    SetNumberOfDivisions (Int_t ndiv);
00071    virtual void    SetAspectRatio(Float_t factor=1){fAspectRatio = factor;}
00072    virtual void    Sizeof3D() const;
00073 
00074    ClassDef(TTUBE,3)  //TUBE shape
00075 };
00076 
00077 #endif

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