// @(#)root/geom:$Id$
// Author: Mihaela Gheata   5/01/04

/*************************************************************************
 * 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.             *
 *************************************************************************/

//____________________________________________________________________________
// TGeoPolygon - Arbitrary polygon class
//____________________________________________________________________________
//
// A polygon is a 2D shape defined by vertices in the XY plane. It is used by
// TGeoXtru class for computing Contains() and Safety(). Only the pointers to
// the actual lists of XY values are used - these are not owned by the class.
//
// To check if a point in XY plane is contained by a polygon, this is split
// into an outscribed convex polygon and the remaining polygons of its subtracton
// from the outscribed one. A point is INSIDE if it is
// contained by the outscribed polygon but NOT by the remaining ones. Since these
// can also be arbitrary polygons at their turn, a tree structure is formed:
//
//  P = Pconvex - (Pconvex-P)           where (-) means 'subtraction'
//  Pconvex-P = P1 + P2 + ...           where (+) means 'union'
//
//  *Note that P1, P2, ... do not intersect each other and they are defined
//   by subsets of the list of vertices of P. They can be split in the same
//   way as P*
//
// Therefore, if C(P) represents the Boolean : 'does P contains a given point?',
// then:
//
// C(P) = C(Pconvex) .and. not(C(P1) | C(P2) | ...)
//
// For creating a polygon without TGeoXtru class, one has to call the constructor
// TGeoPolygon(nvert) and then SetXY(Double_t *x, Double_t *y) providing the
// arrays of X and Y vertex positions (defined clockwise) that have to 'live' longer
// than the polygon they will describe. This complication is due to efficiency reasons.
// At the end one has to call the FinishPolygon() method.

#include "TObjArray.h"
#include "TGeoPolygon.h"
#include "TMath.h"
#include "TGeoShape.h"
#include "TGeoManager.h"
#include "TVirtualGeoPainter.h"

ClassImp(TGeoPolygon)

//_____________________________________________________________________________
TGeoPolygon::TGeoPolygon()
{
// Dummy constructor.
   fNvert   = 0;
   fNconvex = 0;
   fInd     = 0;
   fIndc    = 0;
   fX       = 0;
   fY       = 0;
   fDaughters = 0;
   SetConvex(kFALSE);
   TObject::SetBit(kGeoFinishPolygon, kFALSE);
}

//_____________________________________________________________________________
TGeoPolygon::TGeoPolygon(Int_t nvert)
{
// Default constructor.
   if (nvert<3) {
      Fatal("Ctor", "Invalid number of vertices %i", nvert);
      return;
   }
   fNvert   = nvert;
   fNconvex = 0;
   fInd     = new Int_t[nvert];
   fIndc    = 0;
   fX       = 0;
   fY       = 0;
   fDaughters = 0;
   SetConvex(kFALSE);
   TObject::SetBit(kGeoFinishPolygon, kFALSE);
   SetNextIndex();
}

//_____________________________________________________________________________
TGeoPolygon::~TGeoPolygon()
{
// Destructor
   if (fInd)  delete [] fInd;
   if (fIndc) delete [] fIndc;
   if (fDaughters) {
      fDaughters->Delete();
      delete fDaughters;
   }
}
//_____________________________________________________________________________
Double_t TGeoPolygon::Area() const
{
// Computes area of the polygon in [length^2].
   Int_t ic,i,j;
   Double_t area = 0;
   // Compute area of the convex part
   for (ic=0; ic<fNvert; ic++) {
      i = fInd[ic];
      j = fInd[(ic+1)%fNvert];
      area += 0.5*(fX[i]*fY[j]-fX[j]*fY[i]);
   }
   return TMath::Abs(area);
}

//_____________________________________________________________________________
Bool_t TGeoPolygon::Contains(const Double_t *point) const
{
// Check if a point given by X = point[0], Y = point[1] is inside the polygon.
   Int_t i;
   TGeoPolygon *poly;
   for (i=0; i<fNconvex; i++)
      if (!IsRightSided(point, fIndc[i], fIndc[(i+1)%fNconvex])) return kFALSE;
   if (!fDaughters) return kTRUE;
   Int_t nd = fDaughters->GetEntriesFast();
   for (i=0; i<nd; i++) {
      poly = (TGeoPolygon*)fDaughters->UncheckedAt(i);
      if (poly->Contains(point)) return kFALSE;
   }
   return kTRUE;
}

//_____________________________________________________________________________
void TGeoPolygon::ConvexCheck()
{
// Check polygon convexity.
   if (fNvert==3) {
      SetConvex();
      return;
   }
   Int_t j,k;
   Double_t point[2];
   for (Int_t i=0; i<fNvert; i++) {
      j = (i+1)%fNvert;
      k = (i+2)%fNvert;
      point[0] = fX[fInd[k]];
      point[1] = fY[fInd[k]];
      if (!IsRightSided(point, fInd[i], fInd[j])) return;
   }
   SetConvex();
}

//_____________________________________________________________________________
void TGeoPolygon::Draw(Option_t *)
{
// Draw the polygon.
   if (!gGeoManager) return;
   gGeoManager->GetGeomPainter()->DrawPolygon(this);
}

//_____________________________________________________________________________
void TGeoPolygon::FinishPolygon()
{
// Decompose polygon in a convex outscribed part and a list of daughter
// polygons that have to be substracted to get the actual one.
   TObject::SetBit(kGeoFinishPolygon);
   // check convexity
   ConvexCheck();
   // find outscribed convex polygon indices
   OutscribedConvex();
   if (IsConvex()) {
//      printf(" -> polygon convex -> same indices\n");
      memcpy(fIndc, fInd, fNvert*sizeof(Int_t));
      return;
   }
//   printf(" -> polygon NOT convex\n");
   // make daughters if necessary
   if (IsConvex()) return;
   // ... algorithm here
   if (!fDaughters) fDaughters = new TObjArray();
   TGeoPolygon *poly = 0;
   Int_t indconv = 0;
   Int_t indnext, indback;
   Int_t nskip;
   while (indconv < fNconvex) {
      indnext = (indconv+1)%fNconvex;
      nskip = fIndc[indnext]-fIndc[indconv];
      if (nskip<0) nskip+=fNvert;
      if (nskip==1) {
         indconv++;
         continue;
      }
      // gap -> make polygon
      poly = new TGeoPolygon(nskip+1);
      poly->SetXY(fX,fY);
      poly->SetNextIndex(fInd[fIndc[indconv]]);
      poly->SetNextIndex(fInd[fIndc[indnext]]);
      indback = fIndc[indnext]-1;
      if (indback < 0) indback+=fNvert;
      while (indback != fIndc[indconv]) {
         poly->SetNextIndex(fInd[indback]);
         indback--;
         if (indback < 0) indback+=fNvert;
      }
      poly->FinishPolygon();
      fDaughters->Add(poly);
      indconv++;
   }
   for (indconv=0; indconv<fNconvex; indconv++) fIndc[indconv] = fInd[fIndc[indconv]];
}

//_____________________________________________________________________________
void TGeoPolygon::GetVertices(Double_t *x, Double_t *y) const
{
// Fill list of vertices into provided arrays.
   memcpy(x, fX, fNvert*sizeof(Double_t));
   memcpy(y, fY, fNvert*sizeof(Double_t));
}

//_____________________________________________________________________________
void TGeoPolygon::GetConvexVertices(Double_t *x, Double_t *y) const
{
// Fill list of vertices of the convex outscribed polygon into provided arrays.
   for (Int_t ic=0; ic<fNconvex; ic++) {
      x[ic] = fX[fIndc[ic]];
      y[ic] = fY[fIndc[ic]];
   }
}

//_____________________________________________________________________________
Bool_t TGeoPolygon::IsRightSided(const Double_t *point, Int_t ind1, Int_t ind2) const
{
// Check if POINT is right-sided with respect to the segment defined by IND1 and IND2.
   Double_t dot = (point[0]-fX[ind1])*(fY[ind2]-fY[ind1]) -
                  (point[1]-fY[ind1])*(fX[ind2]-fX[ind1]);
   if (!IsClockwise()) dot = -dot;
   if (dot<-1.E-10) return kFALSE;
   return kTRUE;
}

//_____________________________________________________________________________
Bool_t TGeoPolygon::IsSegConvex(Int_t i1, Int_t i2) const
{
// Check if a segment [0..fNvert-1] belongs to the outscribed convex pgon.
   if (i2<0) i2=(i1+1)%fNvert;
   Double_t point[2];
   for (Int_t i=0; i<fNvert; i++) {
      if (i==i1 || i==i2) continue;
      point[0] = fX[fInd[i]];
      point[1] = fY[fInd[i]];
      if (!IsRightSided(point, fInd[i1], fInd[i2])) return kFALSE;
   }
   return kTRUE;
}

//_____________________________________________________________________________
Bool_t TGeoPolygon::IsIllegalCheck() const
{
// Check for illegal crossings between non-consecutive segments
   if (fNvert<4) return kFALSE;
   Bool_t is_illegal = kFALSE;
   Double_t x1,y1,x2,y2,x3,y3,x4,y4;
   for (Int_t i=0; i<fNvert-2; i++) {
      // Check segment i
      for (Int_t j=i+2; j<fNvert; j++) {
         // Versus segment j
         if (i==0 && j==(fNvert-1)) continue;
         x1 = fX[i];
         y1 = fY[i];
         x2 = fX[i+1];
         y2 = fY[i+1];
         x3 = fX[j];
         y3 = fY[j];
         x4 = fX[(j+1)%fNvert];
         y4 = fY[(j+1)%fNvert];
         if (TGeoShape::IsSegCrossing(x1,y1,x2,y2,x3,y3,x4,y4)) {
            Error("IsIllegalCheck", "Illegal crossing of segment %d vs. segment %d", i,j);
            is_illegal = kTRUE;
         }
      }
   }
   return is_illegal;
}

//_____________________________________________________________________________
void TGeoPolygon::OutscribedConvex()
{
// Compute indices for the outscribed convex polygon.
   fNconvex = 0;
   Int_t iseg = 0;
   Int_t ivnew;
   Bool_t conv;
   Int_t *indconv = new Int_t[fNvert];
   memset(indconv, 0, fNvert*sizeof(Int_t));
   while (iseg<fNvert) {
      if (!IsSegConvex(iseg)) {
         if (iseg+2 > fNvert) break;
         ivnew = (iseg+2)%fNvert;
         conv = kFALSE;
         // check iseg with next vertices
         while (ivnew) {
            if (IsSegConvex(iseg, ivnew)) {
               conv = kTRUE;
               break;
            }
            ivnew = (ivnew+1)%fNvert;
         }
         if (!conv) {
//            Error("OutscribedConvex","NO convex line connection to vertex %d\n", iseg);
            iseg++;
            continue;
         }
      } else {
         ivnew = (iseg+1)%fNvert;
      }
      // segment belonging to convex outscribed poligon
      if (!fNconvex) indconv[fNconvex++] = iseg;
      else if (indconv[fNconvex-1] != iseg) indconv[fNconvex++] = iseg;
      if (iseg<fNvert-1) indconv[fNconvex++] = ivnew;
      if (ivnew<iseg) break;
      iseg = ivnew;
   }
   if (!fNconvex) {
      delete [] indconv;
      Fatal("OutscribedConvex","cannot build outscribed convex");
      return;
   }
   fIndc = new Int_t[fNvert];
   memcpy(fIndc, indconv, fNconvex*sizeof(Int_t)); // does not contain real indices yet
   delete [] indconv;
}

//_____________________________________________________________________________
Double_t TGeoPolygon::Safety(const Double_t *point, Int_t &isegment) const
{
// Compute minimum distance from POINT to any segment. Returns segment index.
   Int_t i1, i2;
   Double_t p1[2], p2[3];
   Double_t lsq, ssq, dx, dy, dpx, dpy, u;
   Double_t safe=1E30;
   Int_t isegmin=0;
   for (i1=0; i1<fNvert; i1++) {
      if (TGeoShape::IsSameWithinTolerance(safe,0)) {
         isegment = isegmin;
         return 0.;
      }
      i2 = (i1+1)%fNvert;
      p1[0] = fX[i1];
      p1[1] = fY[i1];
      p2[0] = fX[i2];
      p2[1] = fY[i2];

      dx = p2[0] - p1[0];
      dy = p2[1] - p1[1];
      dpx = point[0] - p1[0];
      dpy = point[1] - p1[1];

      lsq = dx*dx + dy*dy;
      if (TGeoShape::IsSameWithinTolerance(lsq,0)) {
         ssq = dpx*dpx + dpy*dpy;
         if (ssq < safe) {
            safe = ssq;
            isegmin = i1;
         }
         continue;
      }
      u = (dpx*dx + dpy*dy)/lsq;
      if (u>1) {
         dpx = point[0]-p2[0];
         dpy = point[1]-p2[1];
      } else {
         if (u>=0) {
            dpx -= u*dx;
            dpy -= u*dy;
         }
      }
      ssq = dpx*dpx + dpy*dpy;
      if (ssq < safe) {
         safe = ssq;
         isegmin = i1;
      }
   }
   isegment = isegmin;
   safe = TMath::Sqrt(safe);
//   printf("== segment %d: (%f, %f) - (%f, %f) safe=%f\n", isegment, fX[isegment],fY[isegment],fX[(isegment+1)%fNvert],fY[(isegment+1)%fNvert],safe);
   return safe;
}

//_____________________________________________________________________________
void TGeoPolygon::SetNextIndex(Int_t index)
{
// Sets the next polygone index. If index<0 sets all indices consecutive
// in increasing order.
   Int_t i;
   if (index <0) {
      for (i=0; i<fNvert; i++) fInd[i] = i;
      return;
   }
   if (fNconvex >= fNvert) {
      Error("SetNextIndex", "all indices already set");
      return;
   }
   fInd[fNconvex++] = index;
   if (fNconvex == fNvert) {
      if (!fX || !fY) return;
      Double_t area = 0.0;
      for (i=0; i<fNvert; i++) area += fX[fInd[i]]*fY[fInd[(i+1)%fNvert]]-fX[fInd[(i+1)%fNvert]]*fY[fInd[i]];
      if (area<0) TObject::SetBit(kGeoACW, kFALSE);
      else        TObject::SetBit(kGeoACW, kTRUE);
   }
}

//_____________________________________________________________________________
void TGeoPolygon::SetXY(Double_t *x, Double_t *y)
{
// Set X/Y array pointer for the polygon and daughters.
   Int_t i;
   fX = x;
   fY = y;
   Double_t area = 0.0;
   for (i=0; i<fNvert; i++) area += fX[fInd[i]]*fY[fInd[(i+1)%fNvert]]-fX[fInd[(i+1)%fNvert]]*fY[fInd[i]];
   if (area<0) TObject::SetBit(kGeoACW, kFALSE);
   else        TObject::SetBit(kGeoACW, kTRUE);

   if (!fDaughters) return;
   TGeoPolygon *poly;
   Int_t nd = fDaughters->GetEntriesFast();
   for (i=0; i<nd; i++) {
      poly = (TGeoPolygon*)fDaughters->At(i);
      if (poly) poly->SetXY(x,y);
   }
}
 TGeoPolygon.cxx:1
 TGeoPolygon.cxx:2
 TGeoPolygon.cxx:3
 TGeoPolygon.cxx:4
 TGeoPolygon.cxx:5
 TGeoPolygon.cxx:6
 TGeoPolygon.cxx:7
 TGeoPolygon.cxx:8
 TGeoPolygon.cxx:9
 TGeoPolygon.cxx:10
 TGeoPolygon.cxx:11
 TGeoPolygon.cxx:12
 TGeoPolygon.cxx:13
 TGeoPolygon.cxx:14
 TGeoPolygon.cxx:15
 TGeoPolygon.cxx:16
 TGeoPolygon.cxx:17
 TGeoPolygon.cxx:18
 TGeoPolygon.cxx:19
 TGeoPolygon.cxx:20
 TGeoPolygon.cxx:21
 TGeoPolygon.cxx:22
 TGeoPolygon.cxx:23
 TGeoPolygon.cxx:24
 TGeoPolygon.cxx:25
 TGeoPolygon.cxx:26
 TGeoPolygon.cxx:27
 TGeoPolygon.cxx:28
 TGeoPolygon.cxx:29
 TGeoPolygon.cxx:30
 TGeoPolygon.cxx:31
 TGeoPolygon.cxx:32
 TGeoPolygon.cxx:33
 TGeoPolygon.cxx:34
 TGeoPolygon.cxx:35
 TGeoPolygon.cxx:36
 TGeoPolygon.cxx:37
 TGeoPolygon.cxx:38
 TGeoPolygon.cxx:39
 TGeoPolygon.cxx:40
 TGeoPolygon.cxx:41
 TGeoPolygon.cxx:42
 TGeoPolygon.cxx:43
 TGeoPolygon.cxx:44
 TGeoPolygon.cxx:45
 TGeoPolygon.cxx:46
 TGeoPolygon.cxx:47
 TGeoPolygon.cxx:48
 TGeoPolygon.cxx:49
 TGeoPolygon.cxx:50
 TGeoPolygon.cxx:51
 TGeoPolygon.cxx:52
 TGeoPolygon.cxx:53
 TGeoPolygon.cxx:54
 TGeoPolygon.cxx:55
 TGeoPolygon.cxx:56
 TGeoPolygon.cxx:57
 TGeoPolygon.cxx:58
 TGeoPolygon.cxx:59
 TGeoPolygon.cxx:60
 TGeoPolygon.cxx:61
 TGeoPolygon.cxx:62
 TGeoPolygon.cxx:63
 TGeoPolygon.cxx:64
 TGeoPolygon.cxx:65
 TGeoPolygon.cxx:66
 TGeoPolygon.cxx:67
 TGeoPolygon.cxx:68
 TGeoPolygon.cxx:69
 TGeoPolygon.cxx:70
 TGeoPolygon.cxx:71
 TGeoPolygon.cxx:72
 TGeoPolygon.cxx:73
 TGeoPolygon.cxx:74
 TGeoPolygon.cxx:75
 TGeoPolygon.cxx:76
 TGeoPolygon.cxx:77
 TGeoPolygon.cxx:78
 TGeoPolygon.cxx:79
 TGeoPolygon.cxx:80
 TGeoPolygon.cxx:81
 TGeoPolygon.cxx:82
 TGeoPolygon.cxx:83
 TGeoPolygon.cxx:84
 TGeoPolygon.cxx:85
 TGeoPolygon.cxx:86
 TGeoPolygon.cxx:87
 TGeoPolygon.cxx:88
 TGeoPolygon.cxx:89
 TGeoPolygon.cxx:90
 TGeoPolygon.cxx:91
 TGeoPolygon.cxx:92
 TGeoPolygon.cxx:93
 TGeoPolygon.cxx:94
 TGeoPolygon.cxx:95
 TGeoPolygon.cxx:96
 TGeoPolygon.cxx:97
 TGeoPolygon.cxx:98
 TGeoPolygon.cxx:99
 TGeoPolygon.cxx:100
 TGeoPolygon.cxx:101
 TGeoPolygon.cxx:102
 TGeoPolygon.cxx:103
 TGeoPolygon.cxx:104
 TGeoPolygon.cxx:105
 TGeoPolygon.cxx:106
 TGeoPolygon.cxx:107
 TGeoPolygon.cxx:108
 TGeoPolygon.cxx:109
 TGeoPolygon.cxx:110
 TGeoPolygon.cxx:111
 TGeoPolygon.cxx:112
 TGeoPolygon.cxx:113
 TGeoPolygon.cxx:114
 TGeoPolygon.cxx:115
 TGeoPolygon.cxx:116
 TGeoPolygon.cxx:117
 TGeoPolygon.cxx:118
 TGeoPolygon.cxx:119
 TGeoPolygon.cxx:120
 TGeoPolygon.cxx:121
 TGeoPolygon.cxx:122
 TGeoPolygon.cxx:123
 TGeoPolygon.cxx:124
 TGeoPolygon.cxx:125
 TGeoPolygon.cxx:126
 TGeoPolygon.cxx:127
 TGeoPolygon.cxx:128
 TGeoPolygon.cxx:129
 TGeoPolygon.cxx:130
 TGeoPolygon.cxx:131
 TGeoPolygon.cxx:132
 TGeoPolygon.cxx:133
 TGeoPolygon.cxx:134
 TGeoPolygon.cxx:135
 TGeoPolygon.cxx:136
 TGeoPolygon.cxx:137
 TGeoPolygon.cxx:138
 TGeoPolygon.cxx:139
 TGeoPolygon.cxx:140
 TGeoPolygon.cxx:141
 TGeoPolygon.cxx:142
 TGeoPolygon.cxx:143
 TGeoPolygon.cxx:144
 TGeoPolygon.cxx:145
 TGeoPolygon.cxx:146
 TGeoPolygon.cxx:147
 TGeoPolygon.cxx:148
 TGeoPolygon.cxx:149
 TGeoPolygon.cxx:150
 TGeoPolygon.cxx:151
 TGeoPolygon.cxx:152
 TGeoPolygon.cxx:153
 TGeoPolygon.cxx:154
 TGeoPolygon.cxx:155
 TGeoPolygon.cxx:156
 TGeoPolygon.cxx:157
 TGeoPolygon.cxx:158
 TGeoPolygon.cxx:159
 TGeoPolygon.cxx:160
 TGeoPolygon.cxx:161
 TGeoPolygon.cxx:162
 TGeoPolygon.cxx:163
 TGeoPolygon.cxx:164
 TGeoPolygon.cxx:165
 TGeoPolygon.cxx:166
 TGeoPolygon.cxx:167
 TGeoPolygon.cxx:168
 TGeoPolygon.cxx:169
 TGeoPolygon.cxx:170
 TGeoPolygon.cxx:171
 TGeoPolygon.cxx:172
 TGeoPolygon.cxx:173
 TGeoPolygon.cxx:174
 TGeoPolygon.cxx:175
 TGeoPolygon.cxx:176
 TGeoPolygon.cxx:177
 TGeoPolygon.cxx:178
 TGeoPolygon.cxx:179
 TGeoPolygon.cxx:180
 TGeoPolygon.cxx:181
 TGeoPolygon.cxx:182
 TGeoPolygon.cxx:183
 TGeoPolygon.cxx:184
 TGeoPolygon.cxx:185
 TGeoPolygon.cxx:186
 TGeoPolygon.cxx:187
 TGeoPolygon.cxx:188
 TGeoPolygon.cxx:189
 TGeoPolygon.cxx:190
 TGeoPolygon.cxx:191
 TGeoPolygon.cxx:192
 TGeoPolygon.cxx:193
 TGeoPolygon.cxx:194
 TGeoPolygon.cxx:195
 TGeoPolygon.cxx:196
 TGeoPolygon.cxx:197
 TGeoPolygon.cxx:198
 TGeoPolygon.cxx:199
 TGeoPolygon.cxx:200
 TGeoPolygon.cxx:201
 TGeoPolygon.cxx:202
 TGeoPolygon.cxx:203
 TGeoPolygon.cxx:204
 TGeoPolygon.cxx:205
 TGeoPolygon.cxx:206
 TGeoPolygon.cxx:207
 TGeoPolygon.cxx:208
 TGeoPolygon.cxx:209
 TGeoPolygon.cxx:210
 TGeoPolygon.cxx:211
 TGeoPolygon.cxx:212
 TGeoPolygon.cxx:213
 TGeoPolygon.cxx:214
 TGeoPolygon.cxx:215
 TGeoPolygon.cxx:216
 TGeoPolygon.cxx:217
 TGeoPolygon.cxx:218
 TGeoPolygon.cxx:219
 TGeoPolygon.cxx:220
 TGeoPolygon.cxx:221
 TGeoPolygon.cxx:222
 TGeoPolygon.cxx:223
 TGeoPolygon.cxx:224
 TGeoPolygon.cxx:225
 TGeoPolygon.cxx:226
 TGeoPolygon.cxx:227
 TGeoPolygon.cxx:228
 TGeoPolygon.cxx:229
 TGeoPolygon.cxx:230
 TGeoPolygon.cxx:231
 TGeoPolygon.cxx:232
 TGeoPolygon.cxx:233
 TGeoPolygon.cxx:234
 TGeoPolygon.cxx:235
 TGeoPolygon.cxx:236
 TGeoPolygon.cxx:237
 TGeoPolygon.cxx:238
 TGeoPolygon.cxx:239
 TGeoPolygon.cxx:240
 TGeoPolygon.cxx:241
 TGeoPolygon.cxx:242
 TGeoPolygon.cxx:243
 TGeoPolygon.cxx:244
 TGeoPolygon.cxx:245
 TGeoPolygon.cxx:246
 TGeoPolygon.cxx:247
 TGeoPolygon.cxx:248
 TGeoPolygon.cxx:249
 TGeoPolygon.cxx:250
 TGeoPolygon.cxx:251
 TGeoPolygon.cxx:252
 TGeoPolygon.cxx:253
 TGeoPolygon.cxx:254
 TGeoPolygon.cxx:255
 TGeoPolygon.cxx:256
 TGeoPolygon.cxx:257
 TGeoPolygon.cxx:258
 TGeoPolygon.cxx:259
 TGeoPolygon.cxx:260
 TGeoPolygon.cxx:261
 TGeoPolygon.cxx:262
 TGeoPolygon.cxx:263
 TGeoPolygon.cxx:264
 TGeoPolygon.cxx:265
 TGeoPolygon.cxx:266
 TGeoPolygon.cxx:267
 TGeoPolygon.cxx:268
 TGeoPolygon.cxx:269
 TGeoPolygon.cxx:270
 TGeoPolygon.cxx:271
 TGeoPolygon.cxx:272
 TGeoPolygon.cxx:273
 TGeoPolygon.cxx:274
 TGeoPolygon.cxx:275
 TGeoPolygon.cxx:276
 TGeoPolygon.cxx:277
 TGeoPolygon.cxx:278
 TGeoPolygon.cxx:279
 TGeoPolygon.cxx:280
 TGeoPolygon.cxx:281
 TGeoPolygon.cxx:282
 TGeoPolygon.cxx:283
 TGeoPolygon.cxx:284
 TGeoPolygon.cxx:285
 TGeoPolygon.cxx:286
 TGeoPolygon.cxx:287
 TGeoPolygon.cxx:288
 TGeoPolygon.cxx:289
 TGeoPolygon.cxx:290
 TGeoPolygon.cxx:291
 TGeoPolygon.cxx:292
 TGeoPolygon.cxx:293
 TGeoPolygon.cxx:294
 TGeoPolygon.cxx:295
 TGeoPolygon.cxx:296
 TGeoPolygon.cxx:297
 TGeoPolygon.cxx:298
 TGeoPolygon.cxx:299
 TGeoPolygon.cxx:300
 TGeoPolygon.cxx:301
 TGeoPolygon.cxx:302
 TGeoPolygon.cxx:303
 TGeoPolygon.cxx:304
 TGeoPolygon.cxx:305
 TGeoPolygon.cxx:306
 TGeoPolygon.cxx:307
 TGeoPolygon.cxx:308
 TGeoPolygon.cxx:309
 TGeoPolygon.cxx:310
 TGeoPolygon.cxx:311
 TGeoPolygon.cxx:312
 TGeoPolygon.cxx:313
 TGeoPolygon.cxx:314
 TGeoPolygon.cxx:315
 TGeoPolygon.cxx:316
 TGeoPolygon.cxx:317
 TGeoPolygon.cxx:318
 TGeoPolygon.cxx:319
 TGeoPolygon.cxx:320
 TGeoPolygon.cxx:321
 TGeoPolygon.cxx:322
 TGeoPolygon.cxx:323
 TGeoPolygon.cxx:324
 TGeoPolygon.cxx:325
 TGeoPolygon.cxx:326
 TGeoPolygon.cxx:327
 TGeoPolygon.cxx:328
 TGeoPolygon.cxx:329
 TGeoPolygon.cxx:330
 TGeoPolygon.cxx:331
 TGeoPolygon.cxx:332
 TGeoPolygon.cxx:333
 TGeoPolygon.cxx:334
 TGeoPolygon.cxx:335
 TGeoPolygon.cxx:336
 TGeoPolygon.cxx:337
 TGeoPolygon.cxx:338
 TGeoPolygon.cxx:339
 TGeoPolygon.cxx:340
 TGeoPolygon.cxx:341
 TGeoPolygon.cxx:342
 TGeoPolygon.cxx:343
 TGeoPolygon.cxx:344
 TGeoPolygon.cxx:345
 TGeoPolygon.cxx:346
 TGeoPolygon.cxx:347
 TGeoPolygon.cxx:348
 TGeoPolygon.cxx:349
 TGeoPolygon.cxx:350
 TGeoPolygon.cxx:351
 TGeoPolygon.cxx:352
 TGeoPolygon.cxx:353
 TGeoPolygon.cxx:354
 TGeoPolygon.cxx:355
 TGeoPolygon.cxx:356
 TGeoPolygon.cxx:357
 TGeoPolygon.cxx:358
 TGeoPolygon.cxx:359
 TGeoPolygon.cxx:360
 TGeoPolygon.cxx:361
 TGeoPolygon.cxx:362
 TGeoPolygon.cxx:363
 TGeoPolygon.cxx:364
 TGeoPolygon.cxx:365
 TGeoPolygon.cxx:366
 TGeoPolygon.cxx:367
 TGeoPolygon.cxx:368
 TGeoPolygon.cxx:369
 TGeoPolygon.cxx:370
 TGeoPolygon.cxx:371
 TGeoPolygon.cxx:372
 TGeoPolygon.cxx:373
 TGeoPolygon.cxx:374
 TGeoPolygon.cxx:375
 TGeoPolygon.cxx:376
 TGeoPolygon.cxx:377
 TGeoPolygon.cxx:378
 TGeoPolygon.cxx:379
 TGeoPolygon.cxx:380
 TGeoPolygon.cxx:381
 TGeoPolygon.cxx:382
 TGeoPolygon.cxx:383
 TGeoPolygon.cxx:384
 TGeoPolygon.cxx:385
 TGeoPolygon.cxx:386
 TGeoPolygon.cxx:387
 TGeoPolygon.cxx:388
 TGeoPolygon.cxx:389
 TGeoPolygon.cxx:390
 TGeoPolygon.cxx:391
 TGeoPolygon.cxx:392
 TGeoPolygon.cxx:393
 TGeoPolygon.cxx:394
 TGeoPolygon.cxx:395
 TGeoPolygon.cxx:396
 TGeoPolygon.cxx:397
 TGeoPolygon.cxx:398
 TGeoPolygon.cxx:399
 TGeoPolygon.cxx:400
 TGeoPolygon.cxx:401
 TGeoPolygon.cxx:402
 TGeoPolygon.cxx:403
 TGeoPolygon.cxx:404
 TGeoPolygon.cxx:405
 TGeoPolygon.cxx:406
 TGeoPolygon.cxx:407
 TGeoPolygon.cxx:408
 TGeoPolygon.cxx:409
 TGeoPolygon.cxx:410
 TGeoPolygon.cxx:411
 TGeoPolygon.cxx:412
 TGeoPolygon.cxx:413
 TGeoPolygon.cxx:414
 TGeoPolygon.cxx:415
 TGeoPolygon.cxx:416
 TGeoPolygon.cxx:417
 TGeoPolygon.cxx:418
 TGeoPolygon.cxx:419
 TGeoPolygon.cxx:420
 TGeoPolygon.cxx:421
 TGeoPolygon.cxx:422
 TGeoPolygon.cxx:423
 TGeoPolygon.cxx:424
 TGeoPolygon.cxx:425
 TGeoPolygon.cxx:426
 TGeoPolygon.cxx:427
 TGeoPolygon.cxx:428
 TGeoPolygon.cxx:429
 TGeoPolygon.cxx:430