Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TPGON.cxx
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#include "TPGON.h"
13#include "TMath.h"
14
15
16/** \class TPGON
17\ingroup g3d
18A polygon.
19
20\image html g3d_pgon.png
21
22It has the following parameters:
23
24 - name: name of the shape
25 - title: shape's title
26 - material: (see TMaterial)
27 - phi1: the azimuthal angle &phi at which the volume begins (angles
28 are counted counterclockwise)
29 - dphi1: opening angle of the volume, which extends from phi1 to
30 phi1+dphi
31 - npdv: number of sides of the cross section between the given
32 phi limits
33 - nz: number of planes perpendicular to the z axis where
34 the dimension of the section is given -- this number
35 should be at least 2
36 - rmin: array of dimension nz with minimum radius at a given plane
37 - rmax: array of dimension nz with maximum radius at a given plane
38 - z: array of dimension nz with z position of given plane
39*/
40
41////////////////////////////////////////////////////////////////////////////////
42/// PGON shape default constructor.
43
45{
46}
47
48////////////////////////////////////////////////////////////////////////////////
49/// PGON shape normal constructor.
50///
51/// Parameters of the nz positions must be entered via TPCON::DefineSection.
52
53TPGON::TPGON (const char *name, const char *title, const char *material, Float_t phi1,
55 : TPCON (name, title,material, phi1, dphi1, nz)
56{
58}
59
60////////////////////////////////////////////////////////////////////////////////
61/// PGON shape default destructor.
62
64{
65}
66
67////////////////////////////////////////////////////////////////////////////////
68/// Fill the table of cos and sin to prepare drawing
69
71{
72 Double_t factor = 1./TMath::Cos(angstep/2);
73 Double_t ph = phi-angstep;
74 for (Int_t j = 0; j < n; j++) {
75 ph += angstep;
76 fCoTab[j] = factor*TMath::Cos(ph);
77 fSiTab[j] = factor*TMath::Sin(ph);
78 }
79}
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.
char name[80]
Definition TGX11.cxx:110
A polycone.
Definition TPCON.h:33
virtual void SetNumberOfDivisions(Int_t p)
Set number of divisions.
Definition TPCON.cxx:211
Double_t * fCoTab
Table of sin(fPhi1) .... sin(fPhil+fDphi1)
Definition TPCON.h:37
Double_t * fSiTab
Definition TPCON.h:36
~TPGON() override
PGON shape default destructor.
Definition TPGON.cxx:63
TPGON()
PGON shape default constructor.
Definition TPGON.cxx:44
void FillTableOfCoSin(Double_t phi, Double_t angstep, Int_t n) const override
Fill the table of cos and sin to prepare drawing.
Definition TPGON.cxx:70
const Int_t n
Definition legend1.C:16
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:605
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:599