59 faX = faY = faZ = 1.0;
68 :
TShape(name, title,material)
92 :
TShape(name, title,material)
144 if (factors[0] > 0)
faX = factors[0];
145 if (factors[1] > 0)
faY = factors[1];
146 if (factors[2] > 0)
faZ = factors[2];
173 for (i = 0; i <
fNz+1; i++) {
177 for (j = 0; j <
n; j++) {
180 points[indx++] =
faZ*
z;
182 z =
fRmax * fCoThetaTab[i];
184 for (j = 0; j <
n; j++) {
187 points[indx++] =
faZ*
z;
221 while (dphi > 360) dphi -= 360;
224 while (dtet > 180) dtet -= 180;
243 for (j = 0; j <
n; j++)
245 ph = phi1 + j*angstep;
259 angstep = range/(n-1);
262 for (j = 0; j <
n; j++)
324 Int_t nbPnts = 2*n*nz;
325 Int_t nbSegs = 4*(nz*n-1+(specialCase ==
kTRUE));
326 Int_t nbPols = 2*(nz*n-1+(specialCase ==
kTRUE));
327 if (buffer.
SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols)) {
346 for (i = 0; i < nz*2; i++) {
348 for (j = 1; j <
n; j++) {
349 buffer.
fSegs[indx++] = c;
350 buffer.
fSegs[indx++] = indx2+j-1;
351 buffer.
fSegs[indx++] = indx2+j;
354 buffer.
fSegs[indx++] = c;
355 buffer.
fSegs[indx++] = indx2+j-1;
356 buffer.
fSegs[indx++] = indx2;
361 for (i = 0; i < 2; i++) {
362 indx2 = i*(nz-1)*2*n;
363 for (j = 0; j <
n; j++) {
364 buffer.
fSegs[indx++] = c;
365 buffer.
fSegs[indx++] = indx2+j;
366 buffer.
fSegs[indx++] = indx2+n+j;
371 for (i = 0; i < (nz-1); i++) {
375 for (j = 0; j <
n; j++) {
376 buffer.
fSegs[indx++] = c+2;
377 buffer.
fSegs[indx++] = indx2+j;
378 buffer.
fSegs[indx++] = indx2+n*2+j;
382 for (j = 0; j <
n; j++) {
383 buffer.
fSegs[indx++] = c+3;
384 buffer.
fSegs[indx++] = indx2+j;
385 buffer.
fSegs[indx++] = indx2+n*2+j;
392 for (i = 1; i < (nz-1); i++) {
393 for (j = 0; j < 2; j++) {
394 buffer.
fSegs[indx++] = c;
395 buffer.
fSegs[indx++] = 2*i * n + j*(n-1);
396 buffer.
fSegs[indx++] = (2*i+1) * n + j*(n-1);
407 for (j = 0; j < n-1; j++) {
408 buffer.
fPols[indx++] = c+3;
409 buffer.
fPols[indx++] = 4;
410 buffer.
fPols[indx++] = 2*nz*m+j;
411 buffer.
fPols[indx++] = m+j;
412 buffer.
fPols[indx++] = 2*nz*m+j+1;
413 buffer.
fPols[indx++] = j;
415 for (j = 0; j < n-1; j++) {
416 buffer.
fPols[indx++] = c+3;
417 buffer.
fPols[indx++] = 4;
418 buffer.
fPols[indx++] = 2*nz*m+n+j;
419 buffer.
fPols[indx++] = (nz*2-2)*m+j;
420 buffer.
fPols[indx++] = 2*nz*m+n+j+1;
421 buffer.
fPols[indx++] = (nz*2-2)*m+m+j;
424 buffer.
fPols[indx++] = c+3;
425 buffer.
fPols[indx++] = 4;
426 buffer.
fPols[indx++] = 2*nz*m+j;
427 buffer.
fPols[indx++] = m+j;
428 buffer.
fPols[indx++] = 2*nz*
m;
429 buffer.
fPols[indx++] = j;
431 buffer.
fPols[indx++] = c+3;
432 buffer.
fPols[indx++] = 4;
433 buffer.
fPols[indx++] = 2*nz*m+n+j;
434 buffer.
fPols[indx++] = (nz*2-2)*m+j;
435 buffer.
fPols[indx++] = 2*nz*m+
n;
436 buffer.
fPols[indx++] = (nz*2-2)*m+m+j;
440 for (k = 0; k < (nz-1); k++) {
441 for (j = 0; j < n-1; j++) {
442 buffer.
fPols[indx++] = c;
443 buffer.
fPols[indx++] = 4;
444 buffer.
fPols[indx++] = 2*k*m+j;
445 buffer.
fPols[indx++] = nz*2*m+(2*k+2)*n+j+1;
446 buffer.
fPols[indx++] = (2*k+2)*m+j;
447 buffer.
fPols[indx++] = nz*2*m+(2*k+2)*n+j;
449 for (j = 0; j < n-1; j++) {
450 buffer.
fPols[indx++] = c+1;
451 buffer.
fPols[indx++] = 4;
452 buffer.
fPols[indx++] = (2*k+1)*m+j;
453 buffer.
fPols[indx++] = nz*2*m+(2*k + 3)*n+j;
454 buffer.
fPols[indx++] = (2*k+ 3)*m+j;
455 buffer.
fPols[indx++] = nz*2*m+(2*k+3)*n+j+1;
459 buffer.
fPols[indx++] = c;
460 buffer.
fPols[indx++] = 4;
461 buffer.
fPols[indx++] = 2*k*m+j;
462 buffer.
fPols[indx++] = nz*2*m+(2*k+2)*n+j;
463 buffer.
fPols[indx++] = (2*k+2)*m+j;
464 buffer.
fPols[indx++] = nz*2*m+(2*k+2)*n;
466 buffer.
fPols[indx++] = c+1;
467 buffer.
fPols[indx++] = 4;
468 buffer.
fPols[indx++] = (2*k+1)*m+j;
469 buffer.
fPols[indx++] = nz*2*m+(2*k+3)*n+j;
470 buffer.
fPols[indx++] = (2*k+3)*m+j;
471 buffer.
fPols[indx++] = nz*2*m+(2*k+3)*n;
479 for (k = 0; k < (nz-1); k++) {
480 buffer.
fPols[indx++] = c+2;
481 buffer.
fPols[indx++] = 4;
482 buffer.
fPols[indx++] = k==0 ? indx2 : indx2+2*nz*n+2*(k-1);
483 buffer.
fPols[indx++] = indx2+2*(k+1)*n;
484 buffer.
fPols[indx++] = indx2+2*nz*n+2*k;
485 buffer.
fPols[indx++] = indx2+(2*k+3)*n;
487 buffer.
fPols[indx++] = c+2;
488 buffer.
fPols[indx++] = 4;
489 buffer.
fPols[indx++] = k==0 ? indx2+n-1 : indx2+2*nz*n+2*(k-1)+1;
490 buffer.
fPols[indx++] = indx2+(2*k+3)*n+n-1;
491 buffer.
fPols[indx++] = indx2+2*nz*n+2*k+1;
492 buffer.
fPols[indx++] = indx2+2*(k+1)*n+n-1;
495 buffer.
fPols[indx-8] = indx2+
n;
496 buffer.
fPols[indx-2] = indx2+2*n-1;
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a PSPHE.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections) const
We have to set kRawSize (unless already done) to allocate buffer space before kRaw can be filled...
Buffer base class used for serializing objects.
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections) const
Get buffer 3d.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual void Sizeof3D() const
Return total X3D needed by TNode::ls (when called with option "x")
void SetSectionsValid(UInt_t mask)
Int_t ShapeDistancetoPrimitive(Int_t numPoints, Int_t px, Int_t py)
Distance to primitive.
This is the base class for all geometry shapes.
Bool_t SectionsValid(UInt_t mask) const
virtual void SetEllipse(const Float_t *factors)
Set ellipse.
Bool_t SetRawSizes(UInt_t reqPnts, UInt_t reqPntsCapacity, UInt_t reqSegs, UInt_t reqSegsCapacity, UInt_t reqPols, UInt_t reqPolsCapacity)
Set kRaw tessellation section of buffer with supplied sizes.
Double_t * fCoTab
Table of sin(fPhimin) .... sin(Phi)
Generic 3D primitive description class.
virtual void SetPoints(Double_t *points) const
Create SPHE points.
virtual void MakeTableOfCoSin() const
Make table of sine and cosine.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual ~TSPHE()
SPHE shape default destructor.
Double_t * fCoThetaTab
Table of cos(fPhimin) .... cos(Phi)
Int_t fNdiv
Table of sin(gThemin) .... cos(Theta)
Int_t GetBasicColor() const
Get basic color.
you should not use this method at all Int_t Int_t z
virtual void SetNumberOfDivisions(Int_t p)
Set number of divisions.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
TSPHE()
SPHE shape default constructor.
Double_t Sqrt(Double_t x)
void TransformPoints(Double_t *points, UInt_t NbPnts) const
Transform points (LocalToMaster)
Float_t fAspectRatio
number of sections
virtual Int_t GetNumberOfDivisions() const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0