ROOT logo
// @(#)root/g3d:$Id: TTUBE.h 20882 2007-11-19 11:31:26Z rdm $
// Author: Nenad Buncic   18/09/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TTUBE
#define ROOT_TTUBE


////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TTUBE                                                                  //
//                                                                        //
// This tube has 3 parameters, the inside radius, the outside radius, and //
// the half length in z. Optional parameter is number of segments, also   //
// known as precision (default value is 20).                              //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TShape
#include "TShape.h"
#endif


const Int_t kDivNum = 20;               //default number of divisions


class TTUBE : public TShape {
protected:

   Float_t fRmin;        // ellipse  semi-axis   in  X inside
   Float_t fRmax;        // ellipse  semi-axis   in  X outside

   Float_t fDz;          // half length in z
   Int_t   fNdiv;        // number of segments (precision)

   Float_t fAspectRatio; // defines  (the ellipse semi-axis in Y)/(the ellipse semi-axis in X)

   // Internal cache
   mutable Double_t   *fSiTab;   //! Table of sin(fPhi1) .... sin(fPhil+fDphi1)
   mutable Double_t   *fCoTab;   //! Table of cos(fPhi1) .... cos(fPhil+fDphi1)

   TTUBE(const TTUBE&);
   TTUBE& operator=(const TTUBE&);

   virtual void    MakeTableOfCoSin() const;  // Create the table of the fSiTab; fCoTab
   virtual void    SetPoints(Double_t *points) const;
   virtual void    SetSegsAndPols(TBuffer3D & buffer) const;

public:
   TTUBE();
   TTUBE(const char *name, const char *title, const char *material, Float_t rmin, Float_t rmax, Float_t dz, Float_t aspect=1);
   TTUBE(const char *name, const char *title, const char *material, Float_t rmax, Float_t dz);
   virtual ~TTUBE();

   virtual Int_t   DistancetoPrimitive(Int_t px, Int_t py);
   virtual const TBuffer3D &GetBuffer3D(Int_t reqSections) const;
   virtual Float_t GetRmin() const  {return fRmin;}
   virtual Float_t GetRmax() const  {return fRmax;}
   virtual Float_t GetDz()   const  {return fDz;}
   virtual Int_t   GetNdiv() const  {return fNdiv;}
   virtual Float_t GetAspectRatio() const {return fAspectRatio;}
   virtual Int_t   GetNumberOfDivisions () const {if (fNdiv) return fNdiv; else return kDivNum;}
   virtual void    SetNumberOfDivisions (Int_t ndiv);
   virtual void    SetAspectRatio(Float_t factor=1){fAspectRatio = factor;}
   virtual void    Sizeof3D() const;

   ClassDef(TTUBE,3)  //TUBE shape
};

#endif
 TTUBE.h:1
 TTUBE.h:2
 TTUBE.h:3
 TTUBE.h:4
 TTUBE.h:5
 TTUBE.h:6
 TTUBE.h:7
 TTUBE.h:8
 TTUBE.h:9
 TTUBE.h:10
 TTUBE.h:11
 TTUBE.h:12
 TTUBE.h:13
 TTUBE.h:14
 TTUBE.h:15
 TTUBE.h:16
 TTUBE.h:17
 TTUBE.h:18
 TTUBE.h:19
 TTUBE.h:20
 TTUBE.h:21
 TTUBE.h:22
 TTUBE.h:23
 TTUBE.h:24
 TTUBE.h:25
 TTUBE.h:26
 TTUBE.h:27
 TTUBE.h:28
 TTUBE.h:29
 TTUBE.h:30
 TTUBE.h:31
 TTUBE.h:32
 TTUBE.h:33
 TTUBE.h:34
 TTUBE.h:35
 TTUBE.h:36
 TTUBE.h:37
 TTUBE.h:38
 TTUBE.h:39
 TTUBE.h:40
 TTUBE.h:41
 TTUBE.h:42
 TTUBE.h:43
 TTUBE.h:44
 TTUBE.h:45
 TTUBE.h:46
 TTUBE.h:47
 TTUBE.h:48
 TTUBE.h:49
 TTUBE.h:50
 TTUBE.h:51
 TTUBE.h:52
 TTUBE.h:53
 TTUBE.h:54
 TTUBE.h:55
 TTUBE.h:56
 TTUBE.h:57
 TTUBE.h:58
 TTUBE.h:59
 TTUBE.h:60
 TTUBE.h:61
 TTUBE.h:62
 TTUBE.h:63
 TTUBE.h:64
 TTUBE.h:65
 TTUBE.h:66
 TTUBE.h:67
 TTUBE.h:68
 TTUBE.h:69
 TTUBE.h:70
 TTUBE.h:71
 TTUBE.h:72
 TTUBE.h:73
 TTUBE.h:74
 TTUBE.h:75
 TTUBE.h:76
 TTUBE.h:77