ROOT logo
// @(#)root/g3d:$Id: TPGON.cxx 20882 2007-11-19 11:31:26Z rdm $
// Author: Nenad Buncic   29/09/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TPGON.h"
#include "TMath.h"

ClassImp(TPGON)

//______________________________________________________________________________
// Begin_Html <P ALIGN=CENTER> <IMG SRC="gif/pgon.gif"> </P> End_Html
// PGON is a polygon. It has the following parameters:
//
//     - name       name of the shape
//     - title      shape's title
//     - material  (see TMaterial)
//     - phi1       the azimuthal angle &phi at which the volume begins (angles
//                  are counted counterclockwise)
//     - dphi1      opening angle of the volume, which extends from phi1 to
//                  phi1+dphi
//     - npdv       number of sides of the cross section between the given
//                  phi limits
//     - nz         number of planes perpendicular to the z axis where
//                  the dimension of the section is given -- this number
//                  should be at least 2
//     - rmin       array of dimension nz with minimum radius at a given plane
//     - rmax       array of dimension nz with maximum radius at a given plane
//     - z          array of dimension nz with z position of given plane


//______________________________________________________________________________
TPGON::TPGON ()
{
   // PGON shape default constructor.
}


//______________________________________________________________________________
TPGON::TPGON (const char *name, const char *title, const char *material, Float_t phi1,
              Float_t dphi1, Int_t npdv, Int_t nz)
     : TPCON (name, title,material, phi1, dphi1, nz)
{
   // PGON shape normal constructor.
   //
   //  Parameters of the nz positions must be entered via TPCON::DefineSection.

   SetNumberOfDivisions (npdv);
}


//______________________________________________________________________________
TPGON::~TPGON ()
{
   // PGON shape default destructor.
}


//______________________________________________________________________________
void TPGON::FillTableOfCoSin(Double_t phi, Double_t angstep,Int_t n) const
{
   // Fill the table of cos and sin to prepare drawing

   Double_t factor = 1./TMath::Cos(angstep/2);
   Double_t ph = phi-angstep;
   for (Int_t j = 0; j < n; j++) {
      ph += angstep;
      fCoTab[j] = factor*TMath::Cos(ph);
      fSiTab[j] = factor*TMath::Sin(ph);
   }
}
 TPGON.cxx:1
 TPGON.cxx:2
 TPGON.cxx:3
 TPGON.cxx:4
 TPGON.cxx:5
 TPGON.cxx:6
 TPGON.cxx:7
 TPGON.cxx:8
 TPGON.cxx:9
 TPGON.cxx:10
 TPGON.cxx:11
 TPGON.cxx:12
 TPGON.cxx:13
 TPGON.cxx:14
 TPGON.cxx:15
 TPGON.cxx:16
 TPGON.cxx:17
 TPGON.cxx:18
 TPGON.cxx:19
 TPGON.cxx:20
 TPGON.cxx:21
 TPGON.cxx:22
 TPGON.cxx:23
 TPGON.cxx:24
 TPGON.cxx:25
 TPGON.cxx:26
 TPGON.cxx:27
 TPGON.cxx:28
 TPGON.cxx:29
 TPGON.cxx:30
 TPGON.cxx:31
 TPGON.cxx:32
 TPGON.cxx:33
 TPGON.cxx:34
 TPGON.cxx:35
 TPGON.cxx:36
 TPGON.cxx:37
 TPGON.cxx:38
 TPGON.cxx:39
 TPGON.cxx:40
 TPGON.cxx:41
 TPGON.cxx:42
 TPGON.cxx:43
 TPGON.cxx:44
 TPGON.cxx:45
 TPGON.cxx:46
 TPGON.cxx:47
 TPGON.cxx:48
 TPGON.cxx:49
 TPGON.cxx:50
 TPGON.cxx:51
 TPGON.cxx:52
 TPGON.cxx:53
 TPGON.cxx:54
 TPGON.cxx:55
 TPGON.cxx:56
 TPGON.cxx:57
 TPGON.cxx:58
 TPGON.cxx:59
 TPGON.cxx:60
 TPGON.cxx:61
 TPGON.cxx:62
 TPGON.cxx:63
 TPGON.cxx:64
 TPGON.cxx:65
 TPGON.cxx:66
 TPGON.cxx:67
 TPGON.cxx:68
 TPGON.cxx:69
 TPGON.cxx:70
 TPGON.cxx:71
 TPGON.cxx:72
 TPGON.cxx:73
 TPGON.cxx:74
 TPGON.cxx:75
 TPGON.cxx:76
 TPGON.cxx:77