Logo ROOT   6.12/07
Reference Guide
TCONE.cxx
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: Nenad Buncic 18/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 #include "TCONE.h"
13 #include "TNode.h"
14 
16 
17 /** \class TCONE
18 \ingroup g3d
19 
20 A conical tube.
21 
22 \image html g3d_cone.png
23 It has 8 parameters:
24 
25  - name: name of the shape
26  - title: shape's title
27  - material: (see TMaterial)
28  - dz: half-length in z
29  - rmin1: inside radius at -DZ in z
30  - rmax1: outside radius at -DZ in z
31  - rmin2: inside radius at +DZ in z
32  - rmax2: outside radius at +DZ in z
33 */
34 
35 ////////////////////////////////////////////////////////////////////////////////
36 /// CONE shape default constructor
37 
39 {
40  fRmin2 = 0.;
41  fRmax2 = 0.;
42 }
43 
44 ////////////////////////////////////////////////////////////////////////////////
45 /// CONE shape normal constructor
46 
47 TCONE::TCONE(const char *name, const char *title, const char *material, Float_t dz,
48  Float_t rmin1, Float_t rmax1,
49  Float_t rmin2, Float_t rmax2)
50  : TTUBE(name, title,material,rmin1,rmax1,dz)
51 {
52  fRmin2 = rmin2;
53  fRmax2 = rmax2;
54 }
55 
56 ////////////////////////////////////////////////////////////////////////////////
57 /// CONE shape "simplified" constructor
58 
59 TCONE::TCONE(const char *name, const char *title, const char *material, Float_t dz, Float_t rmax1
60  , Float_t rmax2) : TTUBE(name, title,material,0,rmax1,dz)
61 {
62  fRmin2 = 0;
63  fRmax2 = rmax2;
64 }
65 
66 ////////////////////////////////////////////////////////////////////////////////
67 /// CONE shape default destructor
68 
70 {
71 }
72 
73 ////////////////////////////////////////////////////////////////////////////////
74 /// Create CONE points
75 
77 {
78  Double_t rmin1, rmax1, dz;
79  Int_t j, n;
80 
82 
83  rmin1 = TTUBE::fRmin;
84  rmax1 = TTUBE::fRmax;
85  dz = TTUBE::fDz;
86 
87  Int_t indx = 0;
88 
89  if (!fCoTab) MakeTableOfCoSin();
90 
91  if (points) {
92  for (j = 0; j < n; j++) {
93  points[indx++] = rmin1 * fCoTab[j];
94  points[indx++] = rmin1 * fSiTab[j];
95  points[indx++] = -dz;
96  }
97  for (j = 0; j < n; j++) {
98  points[indx++] = rmax1 * fCoTab[j];
99  points[indx++] = rmax1 * fSiTab[j];
100  points[indx++] = -dz;
101  }
102  for (j = 0; j < n; j++) {
103  points[indx++] = fRmin2 * fCoTab[j];
104  points[indx++] = fRmin2 * fSiTab[j];
105  points[indx++] = dz;
106  }
107  for (j = 0; j < n; j++) {
108  points[indx++] = fRmax2 * fCoTab[j];
109  points[indx++] = fRmax2 * fSiTab[j];
110  points[indx++] = dz;
111  }
112  }
113 }
float Float_t
Definition: RtypesCore.h:53
TCONE()
CONE shape default constructor.
Definition: TCONE.cxx:38
int Int_t
Definition: RtypesCore.h:41
virtual void SetPoints(Double_t *points) const
Create CONE points.
Definition: TCONE.cxx:76
Float_t fDz
Definition: TTUBE.h:38
virtual Int_t GetNumberOfDivisions() const
Definition: TTUBE.h:67
Float_t fRmin2
Definition: TCONE.h:31
point * points
Definition: X3DBuffer.c:20
Float_t fRmax
Definition: TTUBE.h:36
Float_t fRmin
Definition: TTUBE.h:35
virtual ~TCONE()
CONE shape default destructor.
Definition: TCONE.cxx:69
#define ClassImp(name)
Definition: Rtypes.h:359
double Double_t
Definition: RtypesCore.h:55
virtual void MakeTableOfCoSin() const
Make table of sine and cosine.
Definition: TTUBE.cxx:130
A tube.
Definition: TTUBE.h:32
A conical tube.
Definition: TCONE.h:28
const Int_t n
Definition: legend1.C:16
Double_t * fSiTab
Definition: TTUBE.h:44
char name[80]
Definition: TGX11.cxx:109
Double_t * fCoTab
Table of sin(fPhi1) .... sin(fPhil+fDphi1)
Definition: TTUBE.h:45
Float_t fRmax2
Definition: TCONE.h:32