Logo ROOT   6.08/07
Reference Guide
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 #ifndef ROOT_TBRIK
25 #include "TShape.h"
26 #endif
27 
28 // const Int_t kDiv = 30; //default number of z segments for semi-sphere
29 
30 class TSPHE : public TShape {
31 private:
32  // Internal cache
33  mutable Double_t *fSiTab; //! Table of sin(fPhimin) .... sin(Phi)
34  mutable Double_t *fCoTab; //! Table of cos(fPhimin) .... cos(Phi)
35  mutable Double_t *fCoThetaTab; //! Table of sin(gThemin) .... cos(Theta)
36  Int_t fNdiv; // number of divisions
37  Int_t fNz; //! number of sections
38  Float_t fAspectRatio; // Relation between asumth and grid size (by default 1.0)
39 
40 protected:
41  Float_t fRmin; // minimum radius
42  Float_t fRmax; // maximum radius
43  Float_t fThemin; // minimum theta
44  Float_t fThemax; // maximum theta
45  Float_t fPhimin; // minimum phi
46  Float_t fPhimax; // maximum phi
47  Float_t faX; // Coeff along Ox
48  Float_t faY; // Coeff along Oy
49  Float_t faZ; // Coeff along Oz
50 
51  virtual void MakeTableOfCoSin() const; // Create the table of the fSiTab; fCoTab
52  virtual void SetPoints(Double_t *points) const;
53 
54 public:
55  TSPHE();
56  TSPHE(const char *name, const char *title, const char *material, Float_t rmin, Float_t rmax, Float_t themin,
57  Float_t themax, Float_t phimin, Float_t phimax);
58  TSPHE(const char *name, const char *title, const char *material, Float_t rmax);
59  virtual ~TSPHE();
60  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
61  virtual const TBuffer3D &GetBuffer3D(Int_t reqSections) const;
62  virtual Float_t GetRmin() const {return fRmin;}
63  virtual Float_t GetRmax() const {return fRmax;}
64  virtual Float_t GetThemin() const {return fThemin;}
65  virtual Float_t GetThemax() const {return fThemax;}
66  virtual Float_t GetPhimin() const {return fPhimin;}
67  virtual Float_t GetPhimax() const {return fPhimax;}
68  virtual Float_t GetAspectRatio() const { return fAspectRatio;}
69  virtual Int_t GetNumberOfDivisions () const {return fNdiv;}
70  virtual void SetAspectRatio(Float_t factor=1.0){ fAspectRatio = factor; MakeTableOfCoSin();}
71  virtual void SetEllipse(const Float_t *factors);
72  virtual void SetNumberOfDivisions (Int_t p);
73  virtual void Sizeof3D() const;
74 
75  ClassDef(TSPHE,3) //SPHE shape
76 };
77 
78 #endif
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a PSPHE.
Definition: TSPHE.cxx:132
Float_t fPhimax
Definition: TSPHE.h:46
float Float_t
Definition: RtypesCore.h:53
virtual Float_t GetPhimax() const
Definition: TSPHE.h:67
Float_t fThemax
Definition: TSPHE.h:44
Float_t faZ
Definition: TSPHE.h:49
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections) const
Get buffer 3d.
Definition: TSPHE.cxx:312
virtual Float_t GetThemax() const
Definition: TSPHE.h:65
virtual Float_t GetRmin() const
Definition: TSPHE.h:62
int Int_t
Definition: RtypesCore.h:41
Float_t fThemin
Definition: TSPHE.h:43
#define ClassDef(name, id)
Definition: Rtypes.h:254
A Sphere.
Definition: TSPHE.h:30
virtual void SetAspectRatio(Float_t factor=1.0)
Definition: TSPHE.h:70
Double_t * fSiTab
Definition: TSPHE.h:33
virtual void Sizeof3D() const
Return total X3D needed by TNode::ls (when called with option "x")
Definition: TSPHE.cxx:196
point * points
Definition: X3DBuffer.c:20
virtual Float_t GetAspectRatio() const
Definition: TSPHE.h:68
This is the base class for all geometry shapes.
Definition: TShape.h:47
virtual void SetEllipse(const Float_t *factors)
Set ellipse.
Definition: TSPHE.cxx:142
Float_t fRmin
Definition: TSPHE.h:41
Float_t fPhimin
Definition: TSPHE.h:45
Double_t * fCoTab
Table of sin(fPhimin) .... sin(Phi)
Definition: TSPHE.h:34
Generic 3D primitive description class.
Definition: TBuffer3D.h:19
virtual void SetPoints(Double_t *points) const
Create SPHE points.
Definition: TSPHE.cxx:163
Float_t faY
Definition: TSPHE.h:48
virtual void MakeTableOfCoSin() const
Make table of sine and cosine.
Definition: TSPHE.cxx:215
virtual Float_t GetRmax() const
Definition: TSPHE.h:63
virtual Float_t GetThemin() const
Definition: TSPHE.h:64
virtual ~TSPHE()
SPHE shape default destructor.
Definition: TSPHE.cxx:115
virtual Float_t GetPhimin() const
Definition: TSPHE.h:66
double Double_t
Definition: RtypesCore.h:55
Int_t fNz
Definition: TSPHE.h:37
Double_t * fCoThetaTab
Table of cos(fPhimin) .... cos(Phi)
Definition: TSPHE.h:35
Float_t fRmax
Definition: TSPHE.h:42
Int_t fNdiv
Table of sin(gThemin) .... cos(Theta)
Definition: TSPHE.h:36
Float_t faX
Definition: TSPHE.h:47
virtual void SetNumberOfDivisions(Int_t p)
Set number of divisions.
Definition: TSPHE.cxx:152
TSPHE()
SPHE shape default constructor.
Definition: TSPHE.cxx:46
Float_t fAspectRatio
number of sections
Definition: TSPHE.h:38
char name[80]
Definition: TGX11.cxx:109
virtual Int_t GetNumberOfDivisions() const
Definition: TSPHE.h:69