ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
TCONS.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 "
TCONS.h
"
13
#include "
TNode.h
"
14
15
16
/** \class TCONS
17
\ingroup g3d
18
A segment of a conical tube.
19
20
\image html g3d_cons.png
21
22
It has 10 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
- phi1: starting angle of the segment
33
- phi2: ending angle of the segment
34
35
NOTE: phi1 should be smaller than phi2. If this is not the case,
36
the system adds 360 degrees to phi2.
37
*/
38
39
////////////////////////////////////////////////////////////////////////////////
40
/// CONS shape default constructor
41
42
TCONS::TCONS
()
43
{
44
fRmin2
= 0.;
45
fRmax2
= 0.;
46
}
47
48
////////////////////////////////////////////////////////////////////////////////
49
/// CONS shape normal constructor
50
51
TCONS::TCONS
(
const
char
*
name
,
const
char
*title,
const
char
*material,
Float_t
dz,
Float_t
rmin1,
Float_t
rmax1,
Float_t
rmin2,
Float_t
rmax2,
52
Float_t
phi1,
Float_t
phi2)
53
:
TTUBS
(
name
,title,material,rmin1,rmax1,dz,phi1,phi2)
54
{
55
fRmin2
= rmin2;
56
fRmax2
= rmax2;
57
}
58
59
////////////////////////////////////////////////////////////////////////////////
60
/// CONS shape normal constructor
61
62
TCONS::TCONS
(
const
char
*
name
,
const
char
*title,
const
char
*material,
Float_t
rmax1,
Float_t
dz
63
,
Float_t
phi1,
Float_t
phi2,
Float_t
rmax2)
64
:
TTUBS
(
name
,title,material,rmax1,dz,phi1,phi2)
65
{
66
fRmin2
= 0;
67
fRmax2
= rmax2;
68
}
69
70
////////////////////////////////////////////////////////////////////////////////
71
/// CONS shape default destructor
72
73
TCONS::~TCONS
()
74
{
75
}
76
77
////////////////////////////////////////////////////////////////////////////////
78
/// Create CONS points
79
80
void
TCONS::SetPoints
(
Double_t
*
points
)
const
81
{
82
Int_t
j,
n
;
83
Float_t
rmin1, rmax1, dz;
84
85
n
=
GetNumberOfDivisions
()+1;
86
87
rmin1 =
TTUBE::fRmin
;
88
rmax1 =
TTUBE::fRmax
;
89
dz =
TTUBE::fDz
;
90
91
Int_t
indx = 0;
92
93
if
(!
fCoTab
)
MakeTableOfCoSin
();
94
95
if
(
points
) {
96
for
(j = 0; j <
n
; j++) {
97
points
[indx++] = rmin1 *
fCoTab
[j];
98
points
[indx++] = rmin1 *
fSiTab
[j];
99
points
[indx++] = -dz;
100
}
101
for
(j = 0; j <
n
; j++) {
102
points
[indx++] = rmax1 *
fCoTab
[j];
103
points
[indx++] = rmax1 *
fSiTab
[j];
104
points
[indx++] = -dz;
105
}
106
for
(j = 0; j <
n
; j++) {
107
points
[indx++] =
fRmin2
*
fCoTab
[j];
108
points
[indx++] =
fRmin2
*
fSiTab
[j];
109
points
[indx++] = dz;
110
}
111
for
(j = 0; j <
n
; j++) {
112
points
[indx++] =
fRmax2
*
fCoTab
[j];
113
points
[indx++] =
fRmax2
*
fSiTab
[j];
114
points
[indx++] = dz;
115
}
116
}
117
}
Int_t
int Int_t
Signed integer 4 bytes (int).
Definition
RtypesCore.h:59
Double_t
double Double_t
Double 8 bytes.
Definition
RtypesCore.h:73
Float_t
float Float_t
Float 4 bytes (float).
Definition
RtypesCore.h:71
TCONS.h
name
char name[80]
Definition
TGX11.cxx:148
TNode.h
points
point * points
Definition
X3DBuffer.c:22
TCONS::~TCONS
~TCONS() override
CONS shape default destructor.
Definition
TCONS.cxx:73
TCONS::TCONS
TCONS()
CONS shape default constructor.
Definition
TCONS.cxx:42
TCONS::fRmin2
Float_t fRmin2
Definition
TCONS.h:30
TCONS::SetPoints
void SetPoints(Double_t *points) const override
Create CONS points.
Definition
TCONS.cxx:80
TCONS::fRmax2
Float_t fRmax2
Definition
TCONS.h:31
TTUBE::fCoTab
Double_t * fCoTab
! Table of cos(fPhi1) .... cos(fPhil+fDphi1)
Definition
TTUBE.h:45
TTUBE::fSiTab
Double_t * fSiTab
! Table of sin(fPhi1) .... sin(fPhil+fDphi1)
Definition
TTUBE.h:44
TTUBE::fRmax
Float_t fRmax
Definition
TTUBE.h:36
TTUBE::GetNumberOfDivisions
virtual Int_t GetNumberOfDivisions() const
Definition
TTUBE.h:67
TTUBE::fRmin
Float_t fRmin
Definition
TTUBE.h:35
TTUBE::fDz
Float_t fDz
Definition
TTUBE.h:38
TTUBS::MakeTableOfCoSin
void MakeTableOfCoSin() const override
Make table of sine and cosine.
Definition
TTUBS.cxx:78
TTUBS::TTUBS
TTUBS()
TUBS shape default constructor.
Definition
TTUBS.cxx:45
n
const Int_t n
Definition
legend1.C:16
graf3d
g3d
src
TCONS.cxx
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1