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++) {
184 for (j = 0; j <
n; j++) {
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++)
301 b.CheckByteCount(R__s, R__c, TSPHE::IsA());
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++) {
350 buffer.
fSegs[indx++] = indx2+j-1;
351 buffer.
fSegs[indx++] = indx2+j;
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++) {
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++) {
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++) {
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;
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;
Generic 3D primitive description class.
Bool_t SectionsValid(UInt_t mask) const
void SetSectionsValid(UInt_t mask)
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.
Buffer base class used for serializing objects.
virtual void SetPoints(Double_t *points) const
Create SPHE points.
virtual void SetNumberOfDivisions(Int_t p)
Set number of divisions.
virtual void Sizeof3D() const
Return total X3D needed by TNode::ls (when called with option "x")
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections) const
Get buffer 3d.
virtual Int_t GetNumberOfDivisions() const
virtual void MakeTableOfCoSin() const
Make table of sine and cosine.
TSPHE()
SPHE shape default constructor.
virtual ~TSPHE()
SPHE shape default destructor.
Double_t * fCoThetaTab
Table of cos(fPhimin) .... cos(Phi)
Double_t * fCoTab
Table of sin(fPhimin) .... sin(Phi)
virtual void SetEllipse(const Float_t *factors)
Set ellipse.
Float_t fAspectRatio
number of sections
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a PSPHE.
Int_t fNdiv
Table of sin(gThemin) .... cos(Theta)
This is the base class for all geometry shapes.
Int_t GetBasicColor() const
Get basic color.
Int_t ShapeDistancetoPrimitive(Int_t numPoints, Int_t px, Int_t py)
Distance to primitive.
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.
void TransformPoints(Double_t *points, UInt_t NbPnts) const
Transform points (LocalToMaster)
static constexpr double pi
Double_t Sqrt(Double_t x)