Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
15
16/** \class TCONE
17\ingroup g3d
18
19A conical tube.
20
21\image html g3d_cone.png
22It has 8 parameters:
23
24 - name: name of the shape
25 - title: shape's title
26 - material: (see TMaterial)
27 - dz: half-length in z
28 - rmin1: inside radius at -DZ in z
29 - rmax1: outside radius at -DZ in z
30 - rmin2: inside radius at +DZ in z
31 - rmax2: outside radius at +DZ in z
32*/
33
34////////////////////////////////////////////////////////////////////////////////
35/// CONE shape default constructor
36
38{
39 fRmin2 = 0.;
40 fRmax2 = 0.;
41}
42
43////////////////////////////////////////////////////////////////////////////////
44/// CONE shape normal constructor
45
46TCONE::TCONE(const char *name, const char *title, const char *material, Float_t dz,
49 : TTUBE(name, title,material,rmin1,rmax1,dz)
50{
51 fRmin2 = rmin2;
52 fRmax2 = rmax2;
53}
54
55////////////////////////////////////////////////////////////////////////////////
56/// CONE shape "simplified" constructor
57
58TCONE::TCONE(const char *name, const char *title, const char *material, Float_t dz, Float_t rmax1
59 , Float_t rmax2) : TTUBE(name, title,material,0,rmax1,dz)
60{
61 fRmin2 = 0;
62 fRmax2 = rmax2;
63}
64
65////////////////////////////////////////////////////////////////////////////////
66/// CONE shape default destructor
67
69{
70}
71
72////////////////////////////////////////////////////////////////////////////////
73/// Create CONE points
74
76{
78 Int_t j, n;
79
81
84 dz = TTUBE::fDz;
85
86 Int_t indx = 0;
87
89
90 if (points) {
91 for (j = 0; j < n; j++) {
92 points[indx++] = rmin1 * fCoTab[j];
93 points[indx++] = rmin1 * fSiTab[j];
94 points[indx++] = -dz;
95 }
96 for (j = 0; j < n; j++) {
97 points[indx++] = rmax1 * fCoTab[j];
98 points[indx++] = rmax1 * fSiTab[j];
99 points[indx++] = -dz;
100 }
101 for (j = 0; j < n; j++) {
102 points[indx++] = fRmin2 * fCoTab[j];
103 points[indx++] = fRmin2 * fSiTab[j];
104 points[indx++] = dz;
105 }
106 for (j = 0; j < n; j++) {
107 points[indx++] = fRmax2 * fCoTab[j];
108 points[indx++] = fRmax2 * fSiTab[j];
109 points[indx++] = dz;
110 }
111 }
112}
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
char name[80]
Definition TGX11.cxx:110
~TCONE() override
CONE shape default destructor.
Definition TCONE.cxx:68
TCONE()
CONE shape default constructor.
Definition TCONE.cxx:37
Float_t fRmin2
Definition TCONE.h:31
Float_t fRmax2
Definition TCONE.h:32
void SetPoints(Double_t *points) const override
Create CONE points.
Definition TCONE.cxx:75
A tube.
Definition TTUBE.h:32
Double_t * fCoTab
Table of sin(fPhi1) .... sin(fPhil+fDphi1)
Definition TTUBE.h:45
Double_t * fSiTab
Definition TTUBE.h:44
Float_t fRmax
Definition TTUBE.h:36
virtual Int_t GetNumberOfDivisions() const
Definition TTUBE.h:67
virtual void MakeTableOfCoSin() const
Make table of sine and cosine.
Definition TTUBE.cxx:127
Float_t fRmin
Definition TTUBE.h:35
Float_t fDz
Definition TTUBE.h:38
const Int_t n
Definition legend1.C:16