1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
23 // ---------------------------------------------------------------------------
27 // This file is part of the ALICE Geometry Database .
29 // By: Joana E. Santo & David Collados
31 // ---------------------------------------------------------------------------
34 #include <TVirtualPad.h>
36 #include <TGLKernelABC.h>
43 AliGCone::AliGCone() : AliGTube()
45 /* Default Constructor */
46 fRmax2 = 0.; // outside radius at the high z limit
47 fRmin2 = 0.; // inside radius at the high z limit
49 //SetLineColor(5); // Yellow
52 //-------------------------------------------------------------------------
54 AliGCone::AliGCone(Text_t *name, Text_t *title, Float_t dz, Float_t rmin1, Float_t rmax1, Float_t rmin2, Float_t rmax2) : AliGTube(name, title, rmin1, rmax1, dz)
60 //SetLineColor(5); // Yellow
63 //-------------------------------------------------------------------------
65 AliGCone::AliGCone(AliGCone *cone)
67 /* Copy Constructor */
68 fRmax2 = cone->fRmax2;
69 fRmin2 = cone->fRmin2;
70 fColor = cone->fColor;
72 //SetLineColor(5); // Yellow
75 //-------------------------------------------------------------------------
77 AliGCone::AliGCone(Text_t *name, Text_t *title, Float_t dz, Float_t rmax1, Float_t rmax2) : AliGTube(name, title, 0, rmax1, dz)
79 /* Simplified Constructor */
83 //SetLineColor(5); // Yellow
86 //-------------------------------------------------------------------------
88 AliGCone::~AliGCone() {
92 //-------------------------------------------------------------------------
94 void AliGCone::DrawShape(Option_t *option)
100 //-------------------------------------------------------------------------
102 void AliGCone::Draw(Option_t *option)
104 cout << " Entra en " << this->GetName() << "::Draw " << endl;
105 TString opt = option;
109 //TCanvas* Cone = new TCanvas("AliGCone","AliGCone",0,0,400,300);
110 gPad = new TCanvas("AliGCone","AliGCone",0,0,400,300);
111 gPad->Range(0,0,1,1);
112 gPad->SetFillColor(32); // Light Green
113 gPad->SetBorderSize(3);
114 gPad->SetBorderMode(0); // -1 (down) 0 (no) 1 (up)
117 if( !opt.Contains("same") ) {
119 gPad->SetName("AliGCone");
120 gPad->SetTitle("AliGCone");
123 gPad->SetName("AliShapes");
124 gPad->SetTitle("AliShapes");
129 TView *view = gPad->GetView();
134 view->SetAutoRange(kTRUE);
136 view->SetAutoRange(kFALSE);
137 cout << " Sale de " << this->GetName() << "::Draw " << endl;
140 //-------------------------------------------------------------------------
142 void AliGCone::SetPoints(Float_t *buff)
144 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Create CONE points*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
145 //*-* ==================
147 //cout << " Entra en " << this->GetName() << "::Paint " << endl;
148 SetLineColor( GetCol() );
150 Float_t rmin1, rmax1, dz;
153 n = GetNumberOfDivisions();
155 rmin1 = AliGTube::fRmin;
156 rmax1 = AliGTube::fRmax;
161 //*-* We've to checxk whether the table does exist and create it
162 //*-* since fCoTab/fSiTab are not saved with any TShape::Streamer function
163 if (!fCoTab) MakeTableOfCoSin();
166 for (j = 0; j < n; j++) {
167 buff[indx++] = rmin1 * fCoTab[j];
168 buff[indx++] = rmin1 * fSiTab[j];
171 for (j = 0; j < n; j++) {
173 buff[indx++] = rmax1 * fCoTab[j];
174 buff[indx++] = rmax1 * fSiTab[j];
178 for (j = 0; j < n; j++) {
179 buff[indx++] = fRmin2 * fCoTab[j];
180 buff[indx++] = fRmin2 * fSiTab[j];
184 for (j = 0; j < n; j++) {
185 buff[indx++] = fRmax2 * fCoTab[j];
186 buff[indx++] = fRmax2 * fSiTab[j];
191 //cout << " Sale de " << this->GetName() << "::Paint " << endl;
194 //-------------------------------------------------------------------------