Logo ROOT   6.18/05
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#include "TShape.h"
25
26// const Int_t kDiv = 30; //default number of z segments for semi-sphere
27
28class TSPHE : public TShape {
29private:
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
38protected:
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
52public:
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
int Int_t
Definition: RtypesCore.h:41
double Double_t
Definition: RtypesCore.h:55
float Float_t
Definition: RtypesCore.h:53
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
point * points
Definition: X3DBuffer.c:22
Generic 3D primitive description class.
Definition: TBuffer3D.h:18
A Sphere.
Definition: TSPHE.h:28
virtual Float_t GetThemax() const
Definition: TSPHE.h:63
Float_t faY
Definition: TSPHE.h:46
virtual void SetPoints(Double_t *points) const
Create SPHE points.
Definition: TSPHE.cxx:163
virtual void SetNumberOfDivisions(Int_t p)
Set number of divisions.
Definition: TSPHE.cxx:152
Float_t fPhimax
Definition: TSPHE.h:44
virtual Float_t GetAspectRatio() const
Definition: TSPHE.h:66
Float_t fThemax
Definition: TSPHE.h:42
virtual void Sizeof3D() const
Return total X3D needed by TNode::ls (when called with option "x")
Definition: TSPHE.cxx:196
virtual Float_t GetThemin() const
Definition: TSPHE.h:62
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections) const
Get buffer 3d.
Definition: TSPHE.cxx:312
virtual Int_t GetNumberOfDivisions() const
Definition: TSPHE.h:67
virtual Float_t GetRmax() const
Definition: TSPHE.h:61
virtual Float_t GetRmin() const
Definition: TSPHE.h:60
virtual void MakeTableOfCoSin() const
Make table of sine and cosine.
Definition: TSPHE.cxx:215
TSPHE()
SPHE shape default constructor.
Definition: TSPHE.cxx:46
Float_t fRmax
Definition: TSPHE.h:40
Float_t faX
Definition: TSPHE.h:45
Int_t fNz
Definition: TSPHE.h:35
Float_t fRmin
Definition: TSPHE.h:39
virtual Float_t GetPhimax() const
Definition: TSPHE.h:65
virtual ~TSPHE()
SPHE shape default destructor.
Definition: TSPHE.cxx:115
Float_t fPhimin
Definition: TSPHE.h:43
virtual Float_t GetPhimin() const
Definition: TSPHE.h:64
Float_t faZ
Definition: TSPHE.h:47
Double_t * fCoThetaTab
Table of cos(fPhimin) .... cos(Phi)
Definition: TSPHE.h:33
Float_t fThemin
Definition: TSPHE.h:41
Double_t * fCoTab
Table of sin(fPhimin) .... sin(Phi)
Definition: TSPHE.h:32
virtual void SetEllipse(const Float_t *factors)
Set ellipse.
Definition: TSPHE.cxx:142
virtual void SetAspectRatio(Float_t factor=1.0)
Definition: TSPHE.h:68
Float_t fAspectRatio
number of sections
Definition: TSPHE.h:36
Double_t * fSiTab
Definition: TSPHE.h:31
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a PSPHE.
Definition: TSPHE.cxx:132
Int_t fNdiv
Table of sin(gThemin) .... cos(Theta)
Definition: TSPHE.h:34
This is the base class for all geometry shapes.
Definition: TShape.h:35