ROOT logo
// @(#)root/g3d:$Id: TPCON.h 20882 2007-11-19 11:31:26Z rdm $
// Author: Nenad Buncic   29/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_TPCON
#define ROOT_TPCON


////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TPCON                                                                  //
//                                                                        //
// PCON is a polycone. It has at least 9 parameters, the lower phi limit, //
// the range in phi, the number (at least two) of z planes where the      //
// radius is changing for each z boundary and the z coordinate, the       //
// minimum radius and the maximum radius.                                 //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

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


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


class TPCON : public TShape {
protected:
   // Internal cache
   mutable Double_t   *fSiTab;       //! Table of sin(fPhi1) .... sin(fPhil+fDphi1)
   mutable Double_t   *fCoTab;       //! Table of cos(fPhi1) .... cos(fPhil+fDphi1)

   Float_t     fPhi1;        // lower phi limit
   Float_t     fDphi1;       // range in phi
   Int_t       fNdiv;        // number of divisions
   Int_t       fNz;          // number of z segments
   Float_t    *fRmin;        //[fNz] pointer to array of inside radiuses
   Float_t    *fRmax;        //[fNz] pointer to array of outside radiuses
   Float_t    *fDz;          //[fNz] pointer to array of half lengths in z
        
   TPCON(const TPCON&); 
   TPCON& operator=(const TPCON&);

   virtual void    MakeTableOfCoSin() const;  // Create the table of the fSiTab; fCoTab
   virtual void    FillTableOfCoSin(Double_t phi, Double_t angstep,Int_t n) const; // Fill the table of cosin
   virtual void    SetPoints(Double_t *points) const;
   virtual Bool_t  SetSegsAndPols(TBuffer3D & buffer) const;

public:
   TPCON();
   TPCON(const char *name, const char *title, const char *material, Float_t phi1, Float_t dphi1, Int_t nz);
   virtual ~TPCON();

   virtual void     DefineSection(Int_t secNum, Float_t z, Float_t rmin, Float_t rmax);
   virtual Int_t    DistancetoPrimitive(Int_t px, Int_t py);
   virtual const TBuffer3D &GetBuffer3D(Int_t reqSections) const;
   virtual Int_t    GetNumberOfDivisions () const {if (fNdiv) return fNdiv; else return kDiv;}
   virtual Float_t  GetPhi1() const  {return fPhi1;}
   virtual Float_t  GetDhi1() const  {return fDphi1;}
   virtual Int_t    GetNz() const    {return fNz;}
   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 void     SetNumberOfDivisions (Int_t p);
   virtual void     Sizeof3D() const;

   ClassDef(TPCON,2)  //PCON shape
};

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