Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TSPHE.h
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: Rene Brun 13/06/97
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TSPHE
13 #define ROOT_TSPHE
14 
15 
16 ////////////////////////////////////////////////////////////////////////////
17 // //
18 // TSPHE //
19 // //
20 // SPHE is Sphere. Not implemented yet. //
21 // //
22 ////////////////////////////////////////////////////////////////////////////
23 
24 #include "TShape.h"
25 
26 // const Int_t kDiv = 30; //default number of z segments for semi-sphere
27 
28 class TSPHE : public TShape {
29 private:
30  // Internal cache
31  mutable Double_t *fSiTab; //! Table of sin(fPhimin) .... sin(Phi)
32  mutable Double_t *fCoTab; //! Table of cos(fPhimin) .... cos(Phi)
33  mutable Double_t *fCoThetaTab; //! Table of sin(gThemin) .... cos(Theta)
34  Int_t fNdiv; // number of divisions
35  Int_t fNz; //! number of sections
36  Float_t fAspectRatio; // Relation between asumth and grid size (by default 1.0)
37 
38 protected:
39  Float_t fRmin; // minimum radius
40  Float_t fRmax; // maximum radius
41  Float_t fThemin; // minimum theta
42  Float_t fThemax; // maximum theta
43  Float_t fPhimin; // minimum phi
44  Float_t fPhimax; // maximum phi
45  Float_t faX; // Coeff along Ox
46  Float_t faY; // Coeff along Oy
47  Float_t faZ; // Coeff along Oz
48 
49  virtual void MakeTableOfCoSin() const; // Create the table of the fSiTab; fCoTab
50  virtual void SetPoints(Double_t *points) const;
51 
52 public:
53  TSPHE();
54  TSPHE(const char *name, const char *title, const char *material, Float_t rmin, Float_t rmax, Float_t themin,
55  Float_t themax, Float_t phimin, Float_t phimax);
56  TSPHE(const char *name, const char *title, const char *material, Float_t rmax);
57  virtual ~TSPHE();
58  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
59  virtual const TBuffer3D &GetBuffer3D(Int_t reqSections) const;
60  virtual Float_t GetRmin() const {return fRmin;}
61  virtual Float_t GetRmax() const {return fRmax;}
62  virtual Float_t GetThemin() const {return fThemin;}
63  virtual Float_t GetThemax() const {return fThemax;}
64  virtual Float_t GetPhimin() const {return fPhimin;}
65  virtual Float_t GetPhimax() const {return fPhimax;}
66  virtual Float_t GetAspectRatio() const { return fAspectRatio;}
67  virtual Int_t GetNumberOfDivisions () const {return fNdiv;}
68  virtual void SetAspectRatio(Float_t factor=1.0){ fAspectRatio = factor; MakeTableOfCoSin();}
69  virtual void SetEllipse(const Float_t *factors);
70  virtual void SetNumberOfDivisions (Int_t p);
71  virtual void Sizeof3D() const;
72 
73  ClassDef(TSPHE,3) //SPHE shape
74 };
75 
76 #endif