ROOT logo
// @(#)root/g3d:$Id$
// 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 "TCONS.h"
#include "TNode.h"


ClassImp(TCONS)



//______________________________________________________________________________
// Begin_Html <P ALIGN=CENTER> <IMG SRC="gif/cons.gif"> </P> End_Html
// CONS is a segment of a conical tube. It has 10 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
//     - phi1       starting angle of the segment
//     - phi2       ending angle of the segment
//
//
// NOTE: phi1 should be smaller than phi2. If this is not the case,
//       the system adds 360 degrees to phi2.





//______________________________________________________________________________
TCONS::TCONS()
{
   // CONS shape default constructor

   fRmin2 = 0.;
   fRmax2 = 0.;
}


//______________________________________________________________________________
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,
             Float_t phi1, Float_t phi2)
      : TTUBS(name,title,material,rmin1,rmax1,dz,phi1,phi2)
{
   // CONS shape normal constructor

   fRmin2 = rmin2;
   fRmax2 = rmax2;
}


//______________________________________________________________________________
TCONS::TCONS(const char *name, const char *title, const char *material,  Float_t rmax1, Float_t dz
                          , Float_t phi1, Float_t phi2, Float_t rmax2)
             : TTUBS(name,title,material,rmax1,dz,phi1,phi2)
{
   // CONS shape normal constructor

   fRmin2 = 0;
   fRmax2 = rmax2;
}

//______________________________________________________________________________
TCONS::~TCONS()
{
   // CONS shape default destructor
}

//______________________________________________________________________________
void TCONS::SetPoints(Double_t *points) const
{
   // Create CONS points

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

   n = GetNumberOfDivisions()+1;

   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;
      }
   }
}
 TCONS.cxx:1
 TCONS.cxx:2
 TCONS.cxx:3
 TCONS.cxx:4
 TCONS.cxx:5
 TCONS.cxx:6
 TCONS.cxx:7
 TCONS.cxx:8
 TCONS.cxx:9
 TCONS.cxx:10
 TCONS.cxx:11
 TCONS.cxx:12
 TCONS.cxx:13
 TCONS.cxx:14
 TCONS.cxx:15
 TCONS.cxx:16
 TCONS.cxx:17
 TCONS.cxx:18
 TCONS.cxx:19
 TCONS.cxx:20
 TCONS.cxx:21
 TCONS.cxx:22
 TCONS.cxx:23
 TCONS.cxx:24
 TCONS.cxx:25
 TCONS.cxx:26
 TCONS.cxx:27
 TCONS.cxx:28
 TCONS.cxx:29
 TCONS.cxx:30
 TCONS.cxx:31
 TCONS.cxx:32
 TCONS.cxx:33
 TCONS.cxx:34
 TCONS.cxx:35
 TCONS.cxx:36
 TCONS.cxx:37
 TCONS.cxx:38
 TCONS.cxx:39
 TCONS.cxx:40
 TCONS.cxx:41
 TCONS.cxx:42
 TCONS.cxx:43
 TCONS.cxx:44
 TCONS.cxx:45
 TCONS.cxx:46
 TCONS.cxx:47
 TCONS.cxx:48
 TCONS.cxx:49
 TCONS.cxx:50
 TCONS.cxx:51
 TCONS.cxx:52
 TCONS.cxx:53
 TCONS.cxx:54
 TCONS.cxx:55
 TCONS.cxx:56
 TCONS.cxx:57
 TCONS.cxx:58
 TCONS.cxx:59
 TCONS.cxx:60
 TCONS.cxx:61
 TCONS.cxx:62
 TCONS.cxx:63
 TCONS.cxx:64
 TCONS.cxx:65
 TCONS.cxx:66
 TCONS.cxx:67
 TCONS.cxx:68
 TCONS.cxx:69
 TCONS.cxx:70
 TCONS.cxx:71
 TCONS.cxx:72
 TCONS.cxx:73
 TCONS.cxx:74
 TCONS.cxx:75
 TCONS.cxx:76
 TCONS.cxx:77
 TCONS.cxx:78
 TCONS.cxx:79
 TCONS.cxx:80
 TCONS.cxx:81
 TCONS.cxx:82
 TCONS.cxx:83
 TCONS.cxx:84
 TCONS.cxx:85
 TCONS.cxx:86
 TCONS.cxx:87
 TCONS.cxx:88
 TCONS.cxx:89
 TCONS.cxx:90
 TCONS.cxx:91
 TCONS.cxx:92
 TCONS.cxx:93
 TCONS.cxx:94
 TCONS.cxx:95
 TCONS.cxx:96
 TCONS.cxx:97
 TCONS.cxx:98
 TCONS.cxx:99
 TCONS.cxx:100
 TCONS.cxx:101
 TCONS.cxx:102
 TCONS.cxx:103
 TCONS.cxx:104
 TCONS.cxx:105
 TCONS.cxx:106
 TCONS.cxx:107
 TCONS.cxx:108
 TCONS.cxx:109
 TCONS.cxx:110
 TCONS.cxx:111
 TCONS.cxx:112
 TCONS.cxx:113
 TCONS.cxx:114
 TCONS.cxx:115
 TCONS.cxx:116
 TCONS.cxx:117
 TCONS.cxx:118
 TCONS.cxx:119
 TCONS.cxx:120
 TCONS.cxx:121
 TCONS.cxx:122