ROOT  6.06/09
Reference Guide
TTRD2.cxx
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: Nenad Buncic 13/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 "TTRD2.h"
13 #include "TNode.h"
14 
16 
17 /** \class TTRD2
18 \ingroup g3d
19 A trapezoid with both x and y dimensions varying along z.
20 
21 \image html g3d_trd2.png
22 It has 8 parameters:
23 
24  - name: name of the shape
25  - title: shape's title
26  - material: (see TMaterial)
27  - dx1: half-length along x at the z surface positioned at -DZ
28  - dx2: half-length along x at the z surface positioned at +DZ
29  - dy1: half-length along y at the z surface positioned at -DZ
30  - dy2: half-length along y at the z surface positioned at +DZ
31  - dz: half-length along the z-axis
32 */
33 
34 ////////////////////////////////////////////////////////////////////////////////
35 /// TRD2 shape default constructor
36 
37 TTRD2::TTRD2()
38 {
39  fDx2 = 0.;
40  fDy2 = 0.;
41 }
42 
43 ////////////////////////////////////////////////////////////////////////////////
44 /// TRD2 shape normal constructor
45 
46 TTRD2::TTRD2(const char *name, const char *title, const char *material, Float_t dx1, Float_t dx2, Float_t dy1,
47  Float_t dy2, Float_t dz) : TBRIK(name, title,material,dx1,dy1,dz)
48 {
49  fDx2 = dx2;
50  fDy2 = dy2;
51 }
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// TRD2 shape default destructor
55 
57 {
58 }
59 
60 ////////////////////////////////////////////////////////////////////////////////
61 /// Create TRD2 points
62 
64 {
65  Float_t dx1, dx2, dy1, dy2, dz;
66 
67  dx1 = TBRIK::fDx;
68  dx2 = fDx2;
69  dy1 = TBRIK::fDy;
70  dy2 = fDy2;
71  dz = TBRIK::fDz;
72 
73  if (points) {
74  points[ 0] = -dx1 ; points[ 1] = -dy1 ; points[ 2] = -dz;
75  points[ 3] = -dx1 ; points[ 4] = dy1 ; points[ 5] = -dz;
76  points[ 6] = dx1 ; points[ 7] = dy1 ; points[ 8] = -dz;
77  points[ 9] = dx1 ; points[10] = -dy1 ; points[11] = -dz;
78  points[12] = -dx2 ; points[13] = -dy2 ; points[14] = dz;
79  points[15] = -dx2 ; points[16] = dy2 ; points[17] = dz;
80  points[18] = dx2 ; points[19] = dy2 ; points[20] = dz;
81  points[21] = dx2 ; points[22] = -dy2 ; points[23] = dz;
82  }
83 }
float Float_t
Definition: RtypesCore.h:53
Float_t fDx
Definition: TBRIK.h:31
virtual ~TTRD2()
TRD2 shape default destructor.
Definition: TTRD2.cxx:56
point * points
Definition: X3DBuffer.c:20
A trapezoid with both x and y dimensions varying along z.
Definition: TTRD2.h:31
A box with faces perpendicular to the axes.
Definition: TBRIK.h:28
#define ClassImp(name)
Definition: Rtypes.h:279
Float_t fDx2
Definition: TTRD2.h:33
double Double_t
Definition: RtypesCore.h:55
Float_t fDy2
Definition: TTRD2.h:34
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual void SetPoints(Double_t *points) const
Create TRD2 points.
Definition: TTRD2.cxx:63
Float_t fDy
Definition: TBRIK.h:32
Float_t fDz
Definition: TBRIK.h:33