// @(#)root/gl:$Id$
// Author:  Matevz and Alja Tadel  20/02/2009

/*************************************************************************
 * Copyright (C) 1995-2004, 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 "TGLAnnotation.h"

#include "TGLIncludes.h"
#include "TROOT.h"
#include "TColor.h"
#include "TGLUtil.h"
#include "TGLCamera.h"
#include "TGLRnrCtx.h"
#include "TGLSelectRecord.h"
#include "TGLViewerBase.h"
#include "TObjString.h"
#include "TGFrame.h"
#include "TGTextEdit.h"
#include "TGButton.h"
#include "TGLViewer.h"

#include "TMath.h"

#include <KeySymbols.h>

//______________________________________________________________________________
//
//
// GL-overaly annotation.
//
//

ClassImp(TGLAnnotation);

Color_t  TGLAnnotation::fgBackColor = kAzure + 10;
Color_t  TGLAnnotation::fgTextColor = kOrange;

//______________________________________________________________________________
TGLAnnotation::TGLAnnotation(TGLViewerBase *parent, const char *text, Float_t posx, Float_t posy) :
   TGLOverlayElement(TGLOverlayElement::kAnnotation),

   fPosX(posx), fPosY(posy),
   fMouseX(0),  fMouseY(0),
   fDrag(kNone),
   fDrawW(0), fDrawH(0), fTextSizeDrag(0),
   fActive(kFALSE),
   fMainFrame(0), fTextEdit(0),

   fParent(0),

   fText(text),
   fTextSize(0.03),
   fTextAlign(TGLFont::kLeft),
   fBackColor(fgBackColor),
   fTextColor(fgTextColor),
   fTransparency(100),
   fDrawRefLine(kFALSE),
   fUseColorSet(kTRUE),
   fAllowClose(kTRUE)
{
   // Constructor.
   // Create annotation as plain text

   parent->AddOverlayElement(this);
   fParent = (TGLViewer*)parent;
}

//______________________________________________________________________________
TGLAnnotation::TGLAnnotation(TGLViewerBase *parent, const char *text, Float_t posx, Float_t posy, TGLVector3 ref) :
   TGLOverlayElement(TGLOverlayElement::kAnnotation),
   fPosX(posx), fPosY(posy),
   fMouseX(0),  fMouseY(0),
   fDrag(kNone),
   fDrawW(0), fDrawH(0), fTextSizeDrag(0),
   fActive(kFALSE),
   fMainFrame(0), fTextEdit(0),

   fParent(0),

   fText(text),
   fTextSize(0.03),
   fTextAlign(TGLFont::kLeft),
   fBackColor(fgBackColor),
   fTextColor(fgTextColor),
   fTransparency(40),
   fDrawRefLine(kTRUE),
   fUseColorSet(kTRUE),
   fAllowClose(kTRUE)
{
   // Constructor.
   // Create annotaton by picking an object.

   fPointer = ref;
   parent->AddOverlayElement(this);
   fParent = (TGLViewer*)parent;
}

//______________________________________________________________________________
TGLAnnotation::~TGLAnnotation()
{
   // Destructor.

   fParent->RemoveOverlayElement(this);
   delete fMainFrame;
}

//______________________________________________________________________
Bool_t TGLAnnotation::Handle(TGLRnrCtx&          rnrCtx,
                             TGLOvlSelectRecord& selRec,
                             Event_t*            event)
{
   // Handle overlay event.
   // Return TRUE if event was handled.

   if (selRec.GetN() < 2) return kFALSE;
   Int_t recID = selRec.GetItem(1);
   switch (event->fType)
   {
      case kButtonPress:
      {
         fMouseX = event->fX;
         fMouseY = event->fY;
         fDrag = (recID == kResizeID) ? kResize : kMove;
         fTextSizeDrag = fTextSize;
         return kTRUE;
      }
      case kButtonRelease:
      {
         fDrag = kNone;
         if (recID == kDeleteID)
         {
            TGLViewer *v = fParent;
            delete this;
            v->RequestDraw(rnrCtx.ViewerLOD());
         }
         else if (recID == kEditID)
         {
            MakeEditor();
         }
         return kTRUE;
      }
      case kMotionNotify:
      {
         const TGLRect& vp = rnrCtx.RefCamera().RefViewport();
         if (vp.Width() == 0 || vp.Height() == 0) return kFALSE;

         if (fDrag == kMove)
         {
            fPosX += (Float_t)(event->fX - fMouseX) / vp.Width();
            fPosY -= (Float_t)(event->fY - fMouseY) / vp.Height();
            fMouseX = event->fX;
            fMouseY = event->fY;
            // Make sure we don't go offscreen (use fDraw variables set in draw)
            if (fPosX < 0)
               fPosX = 0;
            else if (fPosX + fDrawW > 1.0f)
               fPosX = 1.0f - fDrawW;
            if (fPosY < fDrawH)
               fPosY = fDrawH;
            else if (fPosY > 1.0f)
               fPosY = 1.0f;
         }
         else if (fDrag == kResize)
         {
            using namespace TMath;
            Float_t oovpw = 1.0f / vp.Width(), oovph = 1.0f / vp.Height();

            Float_t xw = oovpw * Min(Max(0, event->fX), vp.Width());
            Float_t yw = oovph * Min(Max(0, vp.Height() - event->fY), vp.Height());

            Float_t rx = Max((xw - fPosX) / (oovpw * fMouseX - fPosX), 0.0f);
            Float_t ry = Max((yw - fPosY) / (oovph*(vp.Height() - fMouseY) - fPosY), 0.0f);

            fTextSize  = Max(fTextSizeDrag * Min(rx, ry), 0.01f);
         }
         return kTRUE;
      }
      default:
      {
         return kFALSE;
      }
   }
}

//______________________________________________________________________________
Bool_t TGLAnnotation::MouseEnter(TGLOvlSelectRecord& /*rec*/)
{
   // Mouse has entered overlay area.

   fActive = kTRUE;
   return kTRUE;
}

//______________________________________________________________________
void TGLAnnotation::MouseLeave()
{
   // Mouse has left overlay area.

   fActive = kFALSE;
}

/**************************************************************************/
void TGLAnnotation::Render(TGLRnrCtx& rnrCtx)
{
   // Render the annotation.

   const TGLRect& vp = rnrCtx.RefCamera().RefViewport();
   if (vp.Width() == 0 && vp.Height() == 0)
      return;

   Float_t old_depth_range[2];
   glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
   glDepthRange(0, 0.001);


   glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POLYGON_BIT);
   TGLCapabilitySwitch lights_off(GL_LIGHTING, kFALSE);
   glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
   glDisable(GL_CULL_FACE);
   glEnable(GL_BLEND);
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

   // prepare colors
   Color_t bgCol = fBackColor;
   Color_t fgCol = fTextColor;
   
   if (fUseColorSet)
   {
      fgCol = rnrCtx.ColorSet().Markup().GetColorIndex();

      TColor* c1 = gROOT->GetColor(rnrCtx.ColorSet().Markup().GetColorIndex());
      TColor* c2 = gROOT->GetColor(rnrCtx.ColorSet().Background().GetColorIndex());

      if (c1 && c2) {
         Float_t f1 = 0.5, f2 = 0.5;
         bgCol = TColor::GetColor(c1->GetRed()  *f1  + c2->GetRed()  *f2,
                                  c1->GetGreen()*f1  + c2->GetGreen()*f2,
                                  c1->GetBlue() *f1  + c2->GetBlue() *f2);
      }
   }

   // reset matrix
   rnrCtx.ProjectionMatrixPushIdentity();

   glPushMatrix();
   // set ortho camera to [0,1] [0.1]
   glLoadIdentity();
   glTranslatef(-1.0f, -1.0f, 0.0f);
   glScalef(2.0f, 2.0f, 1.0f);

   glEnable(GL_POLYGON_OFFSET_FILL);
   glPolygonOffset(0.1f, 1.0f);

   glPushMatrix();

   TGLUtil::LineWidth(1.0f);

   // move to pos
   glTranslatef(fPosX, fPosY, 0.0f);

   TObjArray  *lines = fText.Tokenize("\n");
   TIter       line_iter(lines);
   TObjString *osl;

   Float_t widthTxt, heightTxt, sx, sy, descent, line_height;
   {
      // get unscaled text size
      Int_t fs = TGLFontManager::GetFontSize(TMath::Nint(vp.Height()*fTextSize), 12, 64);
      rnrCtx.RegisterFontNoScale(fs, "arial", TGLFont::kTexture, fFont);
      descent     = fFont.GetDescent();
      line_height = fFont.GetLineHeight();

      Float_t llx, lly, llz, urx, ury, urz;
      widthTxt = heightTxt = 0;
      while ((osl = (TObjString*) line_iter()) != 0)
      {
         fFont.BBox(osl->GetString().Data(), llx, lly, llz, urx, ury, urz);
         widthTxt   = TMath::Max(widthTxt, urx);
         heightTxt += line_height;
      }
      widthTxt  += 2.0f * descent;
      heightTxt += 2.0f * descent;

      // keep proportions
      sy = fTextSize / (line_height + descent);
      sx = sy / vp.Aspect();
      fDrawW = sx*widthTxt;
      fDrawH = sy*heightTxt;
   }
   glScalef(sx, sy, 1.0f);

   glPushName(kMoveID);

   Float_t x1, x2, y1, y2;
   Float_t z3 =  0.0f;  // main background
   Float_t z2 = -0.01f; // outlines and text
   Float_t z1 = -0.02f; // button on top of text
   Float_t z0 = -0.03f; // button on top of text

   // main background
   glLoadName(kMoveID);
   x1 =  0.0f;
   x2 =  widthTxt;
   y1 = -heightTxt;
   y2 =  0.0f;
   TGLUtil::ColorTransparency(bgCol, fTransparency);
   glBegin(GL_QUADS);
   glVertex3f(x1, y1, z3);
   glVertex3f(x2, y1, z3);
   glVertex3f(x2, y2, z3);
   glVertex3f(x1, y2, z3);
   glEnd();
   // main polygon outline
   TGLUtil::ColorTransparency(fgCol, GetLineTransparency());
   glBegin(GL_LINE_LOOP);
   glVertex3f(x1, y1, z2);
   glVertex3f(x2, y1, z2);
   glVertex3f(x2, y2, z2);
   glVertex3f(x1, y2, z2);
   glEnd();

   // annotation text
   TGLUtil::Color(fgCol);
   fFont.PreRender();
   glPushMatrix();
   Float_t tx = 0;
   line_iter.Reset();
   while ((osl = (TObjString*) line_iter()) != 0)
   {
      if (fTextAlign == TGLFont::kLeft) {
         tx = 0;
      }
      else if  (fTextAlign == TGLFont::kCenterH) {
         tx = 0.5f * widthTxt - descent ;
      }
      else {
         tx = widthTxt - 2.0f * descent;
      }
      glTranslatef(0.0f, -line_height, 0.0f);
      fFont.Render(osl->GetString(), tx+descent, 0, z2, fTextAlign, TGLFont::kTop) ;
   }
   glPopMatrix();
   fFont.PostRender();

   delete lines;

   // buttons
   if (fActive)
   {
      Float_t bbox[6];
      fFont.PreRender();
      fFont.BBox("X", bbox[0], bbox[1], bbox[2], bbox[3], bbox[4], bbox[5]);
      glLoadName(kEditID);
      fFont.Render("E", descent, descent, z2, fTextAlign, TGLFont::kTop);
      x2 = bbox[3] + 2.0f * descent;
      if (fAllowClose)
      {
         glLoadName(kDeleteID);
         fFont.Render("X", x2 + descent, descent, z2, fTextAlign, TGLFont::kTop);
      }
      fFont.PostRender();

      x1 = 0.0f;
      y1 = 0.0f;
      y2 = line_height + descent;
      {
         // edit button
         glLoadName(kEditID);
         // polygon
         TGLUtil::ColorTransparency(bgCol, fTransparency);
         glBegin(GL_QUADS);
         glVertex3f(x1, y1, z3);
         glVertex3f(x2, y1, z3);
         glVertex3f(x2, y2, z3);
         glVertex3f(x1, y2, z3);
         glEnd();
         //  outline
         TGLUtil::ColorTransparency(fgCol, GetLineTransparency());
         glBegin(GL_LINE_LOOP);
         glVertex3f(x1, y1, z0);
         glVertex3f(x2, y1, z0);
         glVertex3f(x2, y2, z0);
         glVertex3f(x1, y2, z0);
         glEnd();
      }
      x1 += x2;
      x2 += x2;
      if (fAllowClose)
      {
         // close button
         glLoadName(kDeleteID);
         // polygon
         TGLUtil::ColorTransparency(bgCol, fTransparency);
         glBegin(GL_QUADS);
         glVertex3f(x1, y1, z3);
         glVertex3f(x2, y1, z3);
         glVertex3f(x2, y2, z3);
         glVertex3f(x1, y2, z3);
         glEnd();
         //  outline
         TGLUtil::ColorTransparency(fgCol, GetLineTransparency());
         glBegin(GL_LINE_LOOP);
         glVertex3f(x1, y1, z0);
         glVertex3f(x2, y1, z0);
         glVertex3f(x2, y2, z0);
         glVertex3f(x1, y2, z0);
         glEnd();
      }
      {
         // resize button
         glLoadName(kResizeID);
         // polygon
         x1 =  widthTxt - line_height;
         x2 =  widthTxt;
         y1 = -heightTxt;
         y2 = -heightTxt + line_height;
         TGLUtil::ColorTransparency(bgCol, fTransparency);
         glBegin(GL_QUADS);
         glVertex3f(x1, y1, z1);
         glVertex3f(x2, y1, z1);
         glVertex3f(x2, y2, z1);
         glVertex3f(x1, y2, z1);
         glEnd();
         // draw resize corner lines
         TGLUtil::ColorTransparency(fgCol, GetLineTransparency());
         glBegin(GL_LINES);
         Float_t aOff = 0.25*line_height;
         glVertex3f(x1+aOff, y1+aOff, z0);
         glVertex3f(x2-aOff, y1+aOff, z0);
         glVertex3f(x2-aOff, y1+aOff, z0);
         glVertex3f(x2-aOff, y2-aOff, z0);
         glEnd();
      }
   }

   glPopName();

   glPopMatrix();

   if (fDrawRefLine)
   {
      TGLVertex3 op = rnrCtx.RefCamera().WorldToViewport(fPointer);
      op[0] /= vp.Width();  op[1] /= vp.Height();

      Float_t fx = op[0] < fPosX ? 0.0f : (op[0] > fPosX + fDrawW ? 1.0f : 0.5f);
      Float_t fy = op[1] < fPosY-fDrawH ? 1.0f : (op[1] > fPosY ? 0.0f : 0.5f);

      if (fx != 0.5f || fy != 0.5f)
      {
         TGLUtil::ColorTransparency(bgCol, fTransparency);
         TGLUtil::LineWidth(2);
         glBegin(GL_LINES);
         glVertex3f(fPosX + fx*fDrawW, fPosY - fy*fDrawH, z3);
         glVertex3f(op[0], op[1], z3);
         glEnd();
      }
   }

   glPopMatrix();
   rnrCtx.ProjectionMatrixPop();

   glDepthRange(old_depth_range[0], old_depth_range[1]);
   glPopAttrib();
}

//______________________________________________________________________________
Char_t TGLAnnotation::GetLineTransparency() const
{
   // Returns transparecy of annotation outline.
   // If annotation is selected enforce visiblity of outline.

   if (fActive)
      return TMath::Min(70, fTransparency);
   else
      return fTransparency;
}

//______________________________________________________________________________
void TGLAnnotation::MakeEditor()
{
   // Show the annotation editor.

   if (fMainFrame == 0)
   {
      fMainFrame = new TGMainFrame(gClient->GetRoot(), 1000, 1000);
      fMainFrame->SetWindowName("Annotation Editor");

      TGVerticalFrame* vf = new TGVerticalFrame(fMainFrame);

      fTextEdit = new TGTextEdit(vf,  1000, 1000, kSunkenFrame);
      vf->AddFrame(fTextEdit,  new TGLayoutHints(kLHintsExpandX|kLHintsExpandY));

      TGHorizontalFrame* hf = new TGHorizontalFrame(vf);

      TGTextButton* btt1 = new TGTextButton(hf, "OK");
      hf->AddFrame(btt1, new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));

      TGTextButton* btt2 = new TGTextButton(hf, "Cancel");
      hf->AddFrame(btt2, new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));

      btt1->Connect("Clicked()", "TGLAnnotation", this, "UpdateText()");
      btt2->Connect("Clicked()", "TGLAnnotation", this, "CloseEditor()");

      vf->AddFrame(hf, new TGLayoutHints(kLHintsBottom | kLHintsRight | kLHintsExpandX, 2, 2, 5, 1));

      fMainFrame->AddFrame(vf,  new TGLayoutHints(kLHintsExpandX|kLHintsExpandY));
      fMainFrame->SetCleanup(kDeepCleanup);
      fMainFrame->MapSubwindows();
   }

   TGText *tgt = new TGText();
   tgt->LoadBuffer(fText.Data());
   fTextEdit->SetText(tgt);

   Int_t nrow = tgt->RowCount();
   Int_t h = nrow*20;
   Int_t w = fTextEdit->ReturnLongestLineWidth();
   fMainFrame->Resize(TMath::Max(100, w+30), TMath::Max(100, h+40));

   fMainFrame->Layout();
   fMainFrame->MapWindow();
}

//______________________________________________________________________________
void TGLAnnotation::CloseEditor()
{
   // Close the annotation editor.

   fMainFrame->UnmapWindow();
}

//______________________________________________________________________________
void TGLAnnotation::UpdateText()
{
   // Modify the annotation text from the text-edit widget.

   fText = fTextEdit->GetText()->AsString();
   fMainFrame->UnmapWindow();
   fParent->RequestDraw();
}
 TGLAnnotation.cxx:1
 TGLAnnotation.cxx:2
 TGLAnnotation.cxx:3
 TGLAnnotation.cxx:4
 TGLAnnotation.cxx:5
 TGLAnnotation.cxx:6
 TGLAnnotation.cxx:7
 TGLAnnotation.cxx:8
 TGLAnnotation.cxx:9
 TGLAnnotation.cxx:10
 TGLAnnotation.cxx:11
 TGLAnnotation.cxx:12
 TGLAnnotation.cxx:13
 TGLAnnotation.cxx:14
 TGLAnnotation.cxx:15
 TGLAnnotation.cxx:16
 TGLAnnotation.cxx:17
 TGLAnnotation.cxx:18
 TGLAnnotation.cxx:19
 TGLAnnotation.cxx:20
 TGLAnnotation.cxx:21
 TGLAnnotation.cxx:22
 TGLAnnotation.cxx:23
 TGLAnnotation.cxx:24
 TGLAnnotation.cxx:25
 TGLAnnotation.cxx:26
 TGLAnnotation.cxx:27
 TGLAnnotation.cxx:28
 TGLAnnotation.cxx:29
 TGLAnnotation.cxx:30
 TGLAnnotation.cxx:31
 TGLAnnotation.cxx:32
 TGLAnnotation.cxx:33
 TGLAnnotation.cxx:34
 TGLAnnotation.cxx:35
 TGLAnnotation.cxx:36
 TGLAnnotation.cxx:37
 TGLAnnotation.cxx:38
 TGLAnnotation.cxx:39
 TGLAnnotation.cxx:40
 TGLAnnotation.cxx:41
 TGLAnnotation.cxx:42
 TGLAnnotation.cxx:43
 TGLAnnotation.cxx:44
 TGLAnnotation.cxx:45
 TGLAnnotation.cxx:46
 TGLAnnotation.cxx:47
 TGLAnnotation.cxx:48
 TGLAnnotation.cxx:49
 TGLAnnotation.cxx:50
 TGLAnnotation.cxx:51
 TGLAnnotation.cxx:52
 TGLAnnotation.cxx:53
 TGLAnnotation.cxx:54
 TGLAnnotation.cxx:55
 TGLAnnotation.cxx:56
 TGLAnnotation.cxx:57
 TGLAnnotation.cxx:58
 TGLAnnotation.cxx:59
 TGLAnnotation.cxx:60
 TGLAnnotation.cxx:61
 TGLAnnotation.cxx:62
 TGLAnnotation.cxx:63
 TGLAnnotation.cxx:64
 TGLAnnotation.cxx:65
 TGLAnnotation.cxx:66
 TGLAnnotation.cxx:67
 TGLAnnotation.cxx:68
 TGLAnnotation.cxx:69
 TGLAnnotation.cxx:70
 TGLAnnotation.cxx:71
 TGLAnnotation.cxx:72
 TGLAnnotation.cxx:73
 TGLAnnotation.cxx:74
 TGLAnnotation.cxx:75
 TGLAnnotation.cxx:76
 TGLAnnotation.cxx:77
 TGLAnnotation.cxx:78
 TGLAnnotation.cxx:79
 TGLAnnotation.cxx:80
 TGLAnnotation.cxx:81
 TGLAnnotation.cxx:82
 TGLAnnotation.cxx:83
 TGLAnnotation.cxx:84
 TGLAnnotation.cxx:85
 TGLAnnotation.cxx:86
 TGLAnnotation.cxx:87
 TGLAnnotation.cxx:88
 TGLAnnotation.cxx:89
 TGLAnnotation.cxx:90
 TGLAnnotation.cxx:91
 TGLAnnotation.cxx:92
 TGLAnnotation.cxx:93
 TGLAnnotation.cxx:94
 TGLAnnotation.cxx:95
 TGLAnnotation.cxx:96
 TGLAnnotation.cxx:97
 TGLAnnotation.cxx:98
 TGLAnnotation.cxx:99
 TGLAnnotation.cxx:100
 TGLAnnotation.cxx:101
 TGLAnnotation.cxx:102
 TGLAnnotation.cxx:103
 TGLAnnotation.cxx:104
 TGLAnnotation.cxx:105
 TGLAnnotation.cxx:106
 TGLAnnotation.cxx:107
 TGLAnnotation.cxx:108
 TGLAnnotation.cxx:109
 TGLAnnotation.cxx:110
 TGLAnnotation.cxx:111
 TGLAnnotation.cxx:112
 TGLAnnotation.cxx:113
 TGLAnnotation.cxx:114
 TGLAnnotation.cxx:115
 TGLAnnotation.cxx:116
 TGLAnnotation.cxx:117
 TGLAnnotation.cxx:118
 TGLAnnotation.cxx:119
 TGLAnnotation.cxx:120
 TGLAnnotation.cxx:121
 TGLAnnotation.cxx:122
 TGLAnnotation.cxx:123
 TGLAnnotation.cxx:124
 TGLAnnotation.cxx:125
 TGLAnnotation.cxx:126
 TGLAnnotation.cxx:127
 TGLAnnotation.cxx:128
 TGLAnnotation.cxx:129
 TGLAnnotation.cxx:130
 TGLAnnotation.cxx:131
 TGLAnnotation.cxx:132
 TGLAnnotation.cxx:133
 TGLAnnotation.cxx:134
 TGLAnnotation.cxx:135
 TGLAnnotation.cxx:136
 TGLAnnotation.cxx:137
 TGLAnnotation.cxx:138
 TGLAnnotation.cxx:139
 TGLAnnotation.cxx:140
 TGLAnnotation.cxx:141
 TGLAnnotation.cxx:142
 TGLAnnotation.cxx:143
 TGLAnnotation.cxx:144
 TGLAnnotation.cxx:145
 TGLAnnotation.cxx:146
 TGLAnnotation.cxx:147
 TGLAnnotation.cxx:148
 TGLAnnotation.cxx:149
 TGLAnnotation.cxx:150
 TGLAnnotation.cxx:151
 TGLAnnotation.cxx:152
 TGLAnnotation.cxx:153
 TGLAnnotation.cxx:154
 TGLAnnotation.cxx:155
 TGLAnnotation.cxx:156
 TGLAnnotation.cxx:157
 TGLAnnotation.cxx:158
 TGLAnnotation.cxx:159
 TGLAnnotation.cxx:160
 TGLAnnotation.cxx:161
 TGLAnnotation.cxx:162
 TGLAnnotation.cxx:163
 TGLAnnotation.cxx:164
 TGLAnnotation.cxx:165
 TGLAnnotation.cxx:166
 TGLAnnotation.cxx:167
 TGLAnnotation.cxx:168
 TGLAnnotation.cxx:169
 TGLAnnotation.cxx:170
 TGLAnnotation.cxx:171
 TGLAnnotation.cxx:172
 TGLAnnotation.cxx:173
 TGLAnnotation.cxx:174
 TGLAnnotation.cxx:175
 TGLAnnotation.cxx:176
 TGLAnnotation.cxx:177
 TGLAnnotation.cxx:178
 TGLAnnotation.cxx:179
 TGLAnnotation.cxx:180
 TGLAnnotation.cxx:181
 TGLAnnotation.cxx:182
 TGLAnnotation.cxx:183
 TGLAnnotation.cxx:184
 TGLAnnotation.cxx:185
 TGLAnnotation.cxx:186
 TGLAnnotation.cxx:187
 TGLAnnotation.cxx:188
 TGLAnnotation.cxx:189
 TGLAnnotation.cxx:190
 TGLAnnotation.cxx:191
 TGLAnnotation.cxx:192
 TGLAnnotation.cxx:193
 TGLAnnotation.cxx:194
 TGLAnnotation.cxx:195
 TGLAnnotation.cxx:196
 TGLAnnotation.cxx:197
 TGLAnnotation.cxx:198
 TGLAnnotation.cxx:199
 TGLAnnotation.cxx:200
 TGLAnnotation.cxx:201
 TGLAnnotation.cxx:202
 TGLAnnotation.cxx:203
 TGLAnnotation.cxx:204
 TGLAnnotation.cxx:205
 TGLAnnotation.cxx:206
 TGLAnnotation.cxx:207
 TGLAnnotation.cxx:208
 TGLAnnotation.cxx:209
 TGLAnnotation.cxx:210
 TGLAnnotation.cxx:211
 TGLAnnotation.cxx:212
 TGLAnnotation.cxx:213
 TGLAnnotation.cxx:214
 TGLAnnotation.cxx:215
 TGLAnnotation.cxx:216
 TGLAnnotation.cxx:217
 TGLAnnotation.cxx:218
 TGLAnnotation.cxx:219
 TGLAnnotation.cxx:220
 TGLAnnotation.cxx:221
 TGLAnnotation.cxx:222
 TGLAnnotation.cxx:223
 TGLAnnotation.cxx:224
 TGLAnnotation.cxx:225
 TGLAnnotation.cxx:226
 TGLAnnotation.cxx:227
 TGLAnnotation.cxx:228
 TGLAnnotation.cxx:229
 TGLAnnotation.cxx:230
 TGLAnnotation.cxx:231
 TGLAnnotation.cxx:232
 TGLAnnotation.cxx:233
 TGLAnnotation.cxx:234
 TGLAnnotation.cxx:235
 TGLAnnotation.cxx:236
 TGLAnnotation.cxx:237
 TGLAnnotation.cxx:238
 TGLAnnotation.cxx:239
 TGLAnnotation.cxx:240
 TGLAnnotation.cxx:241
 TGLAnnotation.cxx:242
 TGLAnnotation.cxx:243
 TGLAnnotation.cxx:244
 TGLAnnotation.cxx:245
 TGLAnnotation.cxx:246
 TGLAnnotation.cxx:247
 TGLAnnotation.cxx:248
 TGLAnnotation.cxx:249
 TGLAnnotation.cxx:250
 TGLAnnotation.cxx:251
 TGLAnnotation.cxx:252
 TGLAnnotation.cxx:253
 TGLAnnotation.cxx:254
 TGLAnnotation.cxx:255
 TGLAnnotation.cxx:256
 TGLAnnotation.cxx:257
 TGLAnnotation.cxx:258
 TGLAnnotation.cxx:259
 TGLAnnotation.cxx:260
 TGLAnnotation.cxx:261
 TGLAnnotation.cxx:262
 TGLAnnotation.cxx:263
 TGLAnnotation.cxx:264
 TGLAnnotation.cxx:265
 TGLAnnotation.cxx:266
 TGLAnnotation.cxx:267
 TGLAnnotation.cxx:268
 TGLAnnotation.cxx:269
 TGLAnnotation.cxx:270
 TGLAnnotation.cxx:271
 TGLAnnotation.cxx:272
 TGLAnnotation.cxx:273
 TGLAnnotation.cxx:274
 TGLAnnotation.cxx:275
 TGLAnnotation.cxx:276
 TGLAnnotation.cxx:277
 TGLAnnotation.cxx:278
 TGLAnnotation.cxx:279
 TGLAnnotation.cxx:280
 TGLAnnotation.cxx:281
 TGLAnnotation.cxx:282
 TGLAnnotation.cxx:283
 TGLAnnotation.cxx:284
 TGLAnnotation.cxx:285
 TGLAnnotation.cxx:286
 TGLAnnotation.cxx:287
 TGLAnnotation.cxx:288
 TGLAnnotation.cxx:289
 TGLAnnotation.cxx:290
 TGLAnnotation.cxx:291
 TGLAnnotation.cxx:292
 TGLAnnotation.cxx:293
 TGLAnnotation.cxx:294
 TGLAnnotation.cxx:295
 TGLAnnotation.cxx:296
 TGLAnnotation.cxx:297
 TGLAnnotation.cxx:298
 TGLAnnotation.cxx:299
 TGLAnnotation.cxx:300
 TGLAnnotation.cxx:301
 TGLAnnotation.cxx:302
 TGLAnnotation.cxx:303
 TGLAnnotation.cxx:304
 TGLAnnotation.cxx:305
 TGLAnnotation.cxx:306
 TGLAnnotation.cxx:307
 TGLAnnotation.cxx:308
 TGLAnnotation.cxx:309
 TGLAnnotation.cxx:310
 TGLAnnotation.cxx:311
 TGLAnnotation.cxx:312
 TGLAnnotation.cxx:313
 TGLAnnotation.cxx:314
 TGLAnnotation.cxx:315
 TGLAnnotation.cxx:316
 TGLAnnotation.cxx:317
 TGLAnnotation.cxx:318
 TGLAnnotation.cxx:319
 TGLAnnotation.cxx:320
 TGLAnnotation.cxx:321
 TGLAnnotation.cxx:322
 TGLAnnotation.cxx:323
 TGLAnnotation.cxx:324
 TGLAnnotation.cxx:325
 TGLAnnotation.cxx:326
 TGLAnnotation.cxx:327
 TGLAnnotation.cxx:328
 TGLAnnotation.cxx:329
 TGLAnnotation.cxx:330
 TGLAnnotation.cxx:331
 TGLAnnotation.cxx:332
 TGLAnnotation.cxx:333
 TGLAnnotation.cxx:334
 TGLAnnotation.cxx:335
 TGLAnnotation.cxx:336
 TGLAnnotation.cxx:337
 TGLAnnotation.cxx:338
 TGLAnnotation.cxx:339
 TGLAnnotation.cxx:340
 TGLAnnotation.cxx:341
 TGLAnnotation.cxx:342
 TGLAnnotation.cxx:343
 TGLAnnotation.cxx:344
 TGLAnnotation.cxx:345
 TGLAnnotation.cxx:346
 TGLAnnotation.cxx:347
 TGLAnnotation.cxx:348
 TGLAnnotation.cxx:349
 TGLAnnotation.cxx:350
 TGLAnnotation.cxx:351
 TGLAnnotation.cxx:352
 TGLAnnotation.cxx:353
 TGLAnnotation.cxx:354
 TGLAnnotation.cxx:355
 TGLAnnotation.cxx:356
 TGLAnnotation.cxx:357
 TGLAnnotation.cxx:358
 TGLAnnotation.cxx:359
 TGLAnnotation.cxx:360
 TGLAnnotation.cxx:361
 TGLAnnotation.cxx:362
 TGLAnnotation.cxx:363
 TGLAnnotation.cxx:364
 TGLAnnotation.cxx:365
 TGLAnnotation.cxx:366
 TGLAnnotation.cxx:367
 TGLAnnotation.cxx:368
 TGLAnnotation.cxx:369
 TGLAnnotation.cxx:370
 TGLAnnotation.cxx:371
 TGLAnnotation.cxx:372
 TGLAnnotation.cxx:373
 TGLAnnotation.cxx:374
 TGLAnnotation.cxx:375
 TGLAnnotation.cxx:376
 TGLAnnotation.cxx:377
 TGLAnnotation.cxx:378
 TGLAnnotation.cxx:379
 TGLAnnotation.cxx:380
 TGLAnnotation.cxx:381
 TGLAnnotation.cxx:382
 TGLAnnotation.cxx:383
 TGLAnnotation.cxx:384
 TGLAnnotation.cxx:385
 TGLAnnotation.cxx:386
 TGLAnnotation.cxx:387
 TGLAnnotation.cxx:388
 TGLAnnotation.cxx:389
 TGLAnnotation.cxx:390
 TGLAnnotation.cxx:391
 TGLAnnotation.cxx:392
 TGLAnnotation.cxx:393
 TGLAnnotation.cxx:394
 TGLAnnotation.cxx:395
 TGLAnnotation.cxx:396
 TGLAnnotation.cxx:397
 TGLAnnotation.cxx:398
 TGLAnnotation.cxx:399
 TGLAnnotation.cxx:400
 TGLAnnotation.cxx:401
 TGLAnnotation.cxx:402
 TGLAnnotation.cxx:403
 TGLAnnotation.cxx:404
 TGLAnnotation.cxx:405
 TGLAnnotation.cxx:406
 TGLAnnotation.cxx:407
 TGLAnnotation.cxx:408
 TGLAnnotation.cxx:409
 TGLAnnotation.cxx:410
 TGLAnnotation.cxx:411
 TGLAnnotation.cxx:412
 TGLAnnotation.cxx:413
 TGLAnnotation.cxx:414
 TGLAnnotation.cxx:415
 TGLAnnotation.cxx:416
 TGLAnnotation.cxx:417
 TGLAnnotation.cxx:418
 TGLAnnotation.cxx:419
 TGLAnnotation.cxx:420
 TGLAnnotation.cxx:421
 TGLAnnotation.cxx:422
 TGLAnnotation.cxx:423
 TGLAnnotation.cxx:424
 TGLAnnotation.cxx:425
 TGLAnnotation.cxx:426
 TGLAnnotation.cxx:427
 TGLAnnotation.cxx:428
 TGLAnnotation.cxx:429
 TGLAnnotation.cxx:430
 TGLAnnotation.cxx:431
 TGLAnnotation.cxx:432
 TGLAnnotation.cxx:433
 TGLAnnotation.cxx:434
 TGLAnnotation.cxx:435
 TGLAnnotation.cxx:436
 TGLAnnotation.cxx:437
 TGLAnnotation.cxx:438
 TGLAnnotation.cxx:439
 TGLAnnotation.cxx:440
 TGLAnnotation.cxx:441
 TGLAnnotation.cxx:442
 TGLAnnotation.cxx:443
 TGLAnnotation.cxx:444
 TGLAnnotation.cxx:445
 TGLAnnotation.cxx:446
 TGLAnnotation.cxx:447
 TGLAnnotation.cxx:448
 TGLAnnotation.cxx:449
 TGLAnnotation.cxx:450
 TGLAnnotation.cxx:451
 TGLAnnotation.cxx:452
 TGLAnnotation.cxx:453
 TGLAnnotation.cxx:454
 TGLAnnotation.cxx:455
 TGLAnnotation.cxx:456
 TGLAnnotation.cxx:457
 TGLAnnotation.cxx:458
 TGLAnnotation.cxx:459
 TGLAnnotation.cxx:460
 TGLAnnotation.cxx:461
 TGLAnnotation.cxx:462
 TGLAnnotation.cxx:463
 TGLAnnotation.cxx:464
 TGLAnnotation.cxx:465
 TGLAnnotation.cxx:466
 TGLAnnotation.cxx:467
 TGLAnnotation.cxx:468
 TGLAnnotation.cxx:469
 TGLAnnotation.cxx:470
 TGLAnnotation.cxx:471
 TGLAnnotation.cxx:472
 TGLAnnotation.cxx:473
 TGLAnnotation.cxx:474
 TGLAnnotation.cxx:475
 TGLAnnotation.cxx:476
 TGLAnnotation.cxx:477
 TGLAnnotation.cxx:478
 TGLAnnotation.cxx:479
 TGLAnnotation.cxx:480
 TGLAnnotation.cxx:481
 TGLAnnotation.cxx:482
 TGLAnnotation.cxx:483
 TGLAnnotation.cxx:484
 TGLAnnotation.cxx:485
 TGLAnnotation.cxx:486
 TGLAnnotation.cxx:487
 TGLAnnotation.cxx:488
 TGLAnnotation.cxx:489
 TGLAnnotation.cxx:490
 TGLAnnotation.cxx:491
 TGLAnnotation.cxx:492
 TGLAnnotation.cxx:493
 TGLAnnotation.cxx:494
 TGLAnnotation.cxx:495
 TGLAnnotation.cxx:496
 TGLAnnotation.cxx:497
 TGLAnnotation.cxx:498
 TGLAnnotation.cxx:499
 TGLAnnotation.cxx:500
 TGLAnnotation.cxx:501
 TGLAnnotation.cxx:502
 TGLAnnotation.cxx:503
 TGLAnnotation.cxx:504
 TGLAnnotation.cxx:505
 TGLAnnotation.cxx:506
 TGLAnnotation.cxx:507
 TGLAnnotation.cxx:508
 TGLAnnotation.cxx:509
 TGLAnnotation.cxx:510
 TGLAnnotation.cxx:511
 TGLAnnotation.cxx:512
 TGLAnnotation.cxx:513
 TGLAnnotation.cxx:514
 TGLAnnotation.cxx:515
 TGLAnnotation.cxx:516
 TGLAnnotation.cxx:517
 TGLAnnotation.cxx:518
 TGLAnnotation.cxx:519
 TGLAnnotation.cxx:520
 TGLAnnotation.cxx:521
 TGLAnnotation.cxx:522
 TGLAnnotation.cxx:523
 TGLAnnotation.cxx:524
 TGLAnnotation.cxx:525
 TGLAnnotation.cxx:526
 TGLAnnotation.cxx:527
 TGLAnnotation.cxx:528
 TGLAnnotation.cxx:529
 TGLAnnotation.cxx:530
 TGLAnnotation.cxx:531
 TGLAnnotation.cxx:532
 TGLAnnotation.cxx:533
 TGLAnnotation.cxx:534
 TGLAnnotation.cxx:535
 TGLAnnotation.cxx:536
 TGLAnnotation.cxx:537
 TGLAnnotation.cxx:538
 TGLAnnotation.cxx:539
 TGLAnnotation.cxx:540
 TGLAnnotation.cxx:541
 TGLAnnotation.cxx:542
 TGLAnnotation.cxx:543
 TGLAnnotation.cxx:544
 TGLAnnotation.cxx:545
 TGLAnnotation.cxx:546