ROOT logo
// @(#)root/g3d:$Id: TCONE.cxx 31624 2009-12-08 09:58:40Z couet $
// Author: Nenad Buncic   18/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 "TCONE.h"
#include "TNode.h"

ClassImp(TCONE)

//______________________________________________________________________________
// Begin_Html <P ALIGN=CENTER> <IMG SRC="gif/cone.gif"> </P> End_Html
// CONE is a conical tube. It has 8 parameters:
//
//     - name       name of the shape
//     - title      shape's title
//     - material  (see TMaterial)
//     - dz         half-length in z
//     - rmin1      inside radius at -DZ in z
//     - rmax1      outside radius at -DZ in z
//     - rmin2      inside radius at +DZ in z
//     - rmax2      outside radius at +DZ in z


//______________________________________________________________________________
TCONE::TCONE()
{
   // CONE shape default constructor

   fRmin2 = 0.;
   fRmax2 = 0.;
}


//______________________________________________________________________________
TCONE::TCONE(const char *name, const char *title, const char *material, Float_t dz,
             Float_t rmin1, Float_t rmax1,
             Float_t rmin2, Float_t rmax2)
      : TTUBE(name, title,material,rmin1,rmax1,dz)
{
   // CONE shape normal constructor

   fRmin2 = rmin2;
   fRmax2 = rmax2;
}


//______________________________________________________________________________
TCONE::TCONE(const char *name, const char *title, const char *material, Float_t dz, Float_t rmax1
            , Float_t rmax2) : TTUBE(name, title,material,0,rmax1,dz)
{
   // CONE shape "simplified" constructor

   fRmin2 = 0;
   fRmax2 = rmax2;
}
//______________________________________________________________________________
TCONE::~TCONE()
{
   // CONE shape default destructor
}

//______________________________________________________________________________
void TCONE::SetPoints(Double_t *points) const
{
   // Create CONE points

   Double_t rmin1, rmax1, dz;
   Int_t j, n;

   n = GetNumberOfDivisions();

   rmin1 = TTUBE::fRmin;
   rmax1 = TTUBE::fRmax;
   dz    = TTUBE::fDz;

   Int_t indx = 0;

   if (!fCoTab) MakeTableOfCoSin();

   if (points) {
      for (j = 0; j < n; j++) {
         points[indx++] = rmin1 * fCoTab[j];
         points[indx++] = rmin1 * fSiTab[j];
         points[indx++] = -dz;
      }
      for (j = 0; j < n; j++) {
         points[indx++] = rmax1 * fCoTab[j];
         points[indx++] = rmax1 * fSiTab[j];
         points[indx++] = -dz;
      }
      for (j = 0; j < n; j++) {
         points[indx++] = fRmin2 * fCoTab[j];
         points[indx++] = fRmin2 * fSiTab[j];
         points[indx++] = dz;
      }
      for (j = 0; j < n; j++) {
         points[indx++] = fRmax2 * fCoTab[j];
         points[indx++] = fRmax2 * fSiTab[j];
         points[indx++] = dz;
      }
   }
}
 TCONE.cxx:1
 TCONE.cxx:2
 TCONE.cxx:3
 TCONE.cxx:4
 TCONE.cxx:5
 TCONE.cxx:6
 TCONE.cxx:7
 TCONE.cxx:8
 TCONE.cxx:9
 TCONE.cxx:10
 TCONE.cxx:11
 TCONE.cxx:12
 TCONE.cxx:13
 TCONE.cxx:14
 TCONE.cxx:15
 TCONE.cxx:16
 TCONE.cxx:17
 TCONE.cxx:18
 TCONE.cxx:19
 TCONE.cxx:20
 TCONE.cxx:21
 TCONE.cxx:22
 TCONE.cxx:23
 TCONE.cxx:24
 TCONE.cxx:25
 TCONE.cxx:26
 TCONE.cxx:27
 TCONE.cxx:28
 TCONE.cxx:29
 TCONE.cxx:30
 TCONE.cxx:31
 TCONE.cxx:32
 TCONE.cxx:33
 TCONE.cxx:34
 TCONE.cxx:35
 TCONE.cxx:36
 TCONE.cxx:37
 TCONE.cxx:38
 TCONE.cxx:39
 TCONE.cxx:40
 TCONE.cxx:41
 TCONE.cxx:42
 TCONE.cxx:43
 TCONE.cxx:44
 TCONE.cxx:45
 TCONE.cxx:46
 TCONE.cxx:47
 TCONE.cxx:48
 TCONE.cxx:49
 TCONE.cxx:50
 TCONE.cxx:51
 TCONE.cxx:52
 TCONE.cxx:53
 TCONE.cxx:54
 TCONE.cxx:55
 TCONE.cxx:56
 TCONE.cxx:57
 TCONE.cxx:58
 TCONE.cxx:59
 TCONE.cxx:60
 TCONE.cxx:61
 TCONE.cxx:62
 TCONE.cxx:63
 TCONE.cxx:64
 TCONE.cxx:65
 TCONE.cxx:66
 TCONE.cxx:67
 TCONE.cxx:68
 TCONE.cxx:69
 TCONE.cxx:70
 TCONE.cxx:71
 TCONE.cxx:72
 TCONE.cxx:73
 TCONE.cxx:74
 TCONE.cxx:75
 TCONE.cxx:76
 TCONE.cxx:77
 TCONE.cxx:78
 TCONE.cxx:79
 TCONE.cxx:80
 TCONE.cxx:81
 TCONE.cxx:82
 TCONE.cxx:83
 TCONE.cxx:84
 TCONE.cxx:85
 TCONE.cxx:86
 TCONE.cxx:87
 TCONE.cxx:88
 TCONE.cxx:89
 TCONE.cxx:90
 TCONE.cxx:91
 TCONE.cxx:92
 TCONE.cxx:93
 TCONE.cxx:94
 TCONE.cxx:95
 TCONE.cxx:96
 TCONE.cxx:97
 TCONE.cxx:98
 TCONE.cxx:99
 TCONE.cxx:100
 TCONE.cxx:101
 TCONE.cxx:102
 TCONE.cxx:103
 TCONE.cxx:104
 TCONE.cxx:105
 TCONE.cxx:106
 TCONE.cxx:107
 TCONE.cxx:108
 TCONE.cxx:109