Logo ROOT   6.08/07
Reference Guide
TPCON.h
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: Nenad Buncic 29/09/95
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_TPCON
13 #define ROOT_TPCON
14 
15 
16 ////////////////////////////////////////////////////////////////////////////
17 // //
18 // TPCON //
19 // //
20 // PCON is a polycone. It has at least 9 parameters, the lower phi limit, //
21 // the range in phi, the number (at least two) of z planes where the //
22 // radius is changing for each z boundary and the z coordinate, the //
23 // minimum radius and the maximum radius. //
24 // //
25 ////////////////////////////////////////////////////////////////////////////
26 
27 #ifndef ROOT_TShape
28 #include "TShape.h"
29 #endif
30 
31 
32 const Int_t kDiv = 20; //default number of divisions
33 
34 
35 class TPCON : public TShape {
36 protected:
37  // Internal cache
38  mutable Double_t *fSiTab; //! Table of sin(fPhi1) .... sin(fPhil+fDphi1)
39  mutable Double_t *fCoTab; //! Table of cos(fPhi1) .... cos(fPhil+fDphi1)
40 
41  Float_t fPhi1; // lower phi limit
42  Float_t fDphi1; // range in phi
43  Int_t fNdiv; // number of divisions
44  Int_t fNz; // number of z segments
45  Float_t *fRmin; //[fNz] pointer to array of inside radiuses
46  Float_t *fRmax; //[fNz] pointer to array of outside radiuses
47  Float_t *fDz; //[fNz] pointer to array of half lengths in z
48 
49  TPCON(const TPCON&);
50  TPCON& operator=(const TPCON&);
51 
52  virtual void MakeTableOfCoSin() const; // Create the table of the fSiTab; fCoTab
53  virtual void FillTableOfCoSin(Double_t phi, Double_t angstep,Int_t n) const; // Fill the table of cosin
54  virtual void SetPoints(Double_t *points) const;
55  virtual Bool_t SetSegsAndPols(TBuffer3D & buffer) const;
56 
57 public:
58  TPCON();
59  TPCON(const char *name, const char *title, const char *material, Float_t phi1, Float_t dphi1, Int_t nz);
60  virtual ~TPCON();
61 
62  virtual void DefineSection(Int_t secNum, Float_t z, Float_t rmin, Float_t rmax);
63  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
64  virtual const TBuffer3D &GetBuffer3D(Int_t reqSections) const;
65  virtual Int_t GetNumberOfDivisions () const {if (fNdiv) return fNdiv; else return kDiv;}
66  virtual Float_t GetPhi1() const {return fPhi1;}
67  virtual Float_t GetDhi1() const {return fDphi1;}
68  virtual Int_t GetNz() const {return fNz;}
69  virtual Float_t *GetRmin() const {return fRmin;}
70  virtual Float_t *GetRmax() const {return fRmax;}
71  virtual Float_t *GetDz() const {return fDz;}
72  virtual Int_t GetNdiv() const {return fNdiv;}
73  virtual void SetNumberOfDivisions (Int_t p);
74  virtual void Sizeof3D() const;
75 
76  ClassDef(TPCON,2) //PCON shape
77 };
78 
79 #endif
virtual void SetPoints(Double_t *points) const
Create PCON points.
Definition: TPCON.cxx:224
virtual void MakeTableOfCoSin() const
Make table of cosine and sine.
Definition: TPCON.cxx:130
virtual ~TPCON()
PCON shape default destructor.
Definition: TPCON.cxx:154
Float_t fPhi1
Table of cos(fPhi1) .... cos(fPhil+fDphi1)
Definition: TPCON.h:41
float Float_t
Definition: RtypesCore.h:53
virtual void DefineSection(Int_t secNum, Float_t z, Float_t rmin, Float_t rmax)
Defines section secNum of the polycone.
Definition: TPCON.cxx:176
Float_t * fRmin
Definition: TPCON.h:45
virtual Int_t GetNdiv() const
Definition: TPCON.h:72
Float_t fDphi1
Definition: TPCON.h:42
TPCON()
PCON shape default constructor.
Definition: TPCON.cxx:49
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual Float_t * GetRmax() const
Definition: TPCON.h:70
TPCON & operator=(const TPCON &)
assignment operator
Definition: TPCON.cxx:110
Int_t fNdiv
Definition: TPCON.h:43
const Int_t kDiv
Definition: TPCON.h:32
point * points
Definition: X3DBuffer.c:20
Int_t fNz
Definition: TPCON.h:44
This is the base class for all geometry shapes.
Definition: TShape.h:47
virtual Bool_t SetSegsAndPols(TBuffer3D &buffer) const
Set segments and polygons.
Definition: TPCON.cxx:337
virtual void Sizeof3D() const
Return total X3D needed by TNode::ls (when called with option "x")
Definition: TPCON.cxx:251
virtual Int_t GetNz() const
Definition: TPCON.h:68
Double_t * fCoTab
Table of sin(fPhi1) .... sin(fPhil+fDphi1)
Definition: TPCON.h:39
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections) const
Get buffer 3d.
Definition: TPCON.cxx:297
Generic 3D primitive description class.
Definition: TBuffer3D.h:19
virtual Float_t GetPhi1() const
Definition: TPCON.h:66
A polycone.
Definition: TPCON.h:35
virtual void SetNumberOfDivisions(Int_t p)
Set number of divisions.
Definition: TPCON.cxx:214
Double_t * fSiTab
Definition: TPCON.h:38
double Double_t
Definition: RtypesCore.h:55
virtual Float_t GetDhi1() const
Definition: TPCON.h:67
virtual Float_t * GetDz() const
Definition: TPCON.h:71
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a PCON.
Definition: TPCON.cxx:191
virtual Int_t GetNumberOfDivisions() const
Definition: TPCON.h:65
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
Float_t * fDz
Definition: TPCON.h:47
virtual Float_t * GetRmin() const
Definition: TPCON.h:69
virtual void FillTableOfCoSin(Double_t phi, Double_t angstep, Int_t n) const
Fill the table of cos and sin to prepare drawing.
Definition: TPCON.cxx:201
const Int_t n
Definition: legend1.C:16
char name[80]
Definition: TGX11.cxx:109
Float_t * fRmax
Definition: TPCON.h:46