ROOT logo
// @(#)root/g3d:$Id: TSPHE.h 20882 2007-11-19 11:31:26Z rdm $
// Author: Rene Brun   13/06/97

/*************************************************************************
 * 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_TSPHE
#define ROOT_TSPHE


////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TSPHE                                                                  //
//                                                                        //
// SPHE is Sphere. Not implemented yet.                                   //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

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

// const Int_t kDiv = 30;               //default number of z segments for semi-sphere

class TSPHE : public TShape {
private:
   // Internal cache
   mutable Double_t  *fSiTab;       //! Table of sin(fPhimin) .... sin(Phi)
   mutable Double_t  *fCoTab;       //! Table of cos(fPhimin) .... cos(Phi)
   mutable Double_t  *fCoThetaTab;  //! Table of sin(gThemin) .... cos(Theta)
   Int_t      fNdiv;        // number of divisions
   Int_t      fNz;          //! number of sections
   Float_t    fAspectRatio; // Relation between asumth and grid size (by default 1.0)

protected:
   Float_t fRmin;    // minimum radius
   Float_t fRmax;    // maximum radius
   Float_t fThemin;  // minimum theta
   Float_t fThemax;  // maximum theta
   Float_t fPhimin;  // minimum phi
   Float_t fPhimax;  // maximum phi
   Float_t faX;      // Coeff along Ox
   Float_t faY;      // Coeff along Oy
   Float_t faZ;      // Coeff along Oz
        
   virtual void    MakeTableOfCoSin() const;  // Create the table of the fSiTab; fCoTab
   virtual void    SetPoints(Double_t *points) const;

public:
   TSPHE();
   TSPHE(const char *name, const char *title, const char *material, Float_t rmin, Float_t rmax, Float_t themin,
         Float_t themax, Float_t phimin, Float_t phimax);
   TSPHE(const char *name, const char *title, const char *material, Float_t rmax);
   virtual ~TSPHE();
   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 GetThemin() const {return fThemin;}
   virtual Float_t GetThemax() const {return fThemax;}
   virtual Float_t GetPhimin() const {return fPhimin;}
   virtual Float_t GetPhimax() const {return fPhimax;}
   virtual Float_t GetAspectRatio() const { return fAspectRatio;}
   virtual Int_t   GetNumberOfDivisions () const {return fNdiv;}
   virtual void    SetAspectRatio(Float_t factor=1.0){ fAspectRatio = factor; MakeTableOfCoSin();}
   virtual void    SetEllipse(const Float_t *factors);
   virtual void    SetNumberOfDivisions (Int_t p);
   virtual void    Sizeof3D() const;

   ClassDef(TSPHE,3)  //SPHE shape
};

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