// @(#)root/hist:$Id$
// Author: Olivier Couet 13/07/09

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

#ifndef ROOT_TGraphEdge
#define ROOT_TGraphEdge

#ifndef ROOT_TObject
#include "TObject.h"
#endif

#ifndef ROOT_TAttLine
#include "TAttLine.h"
#endif

struct GVizAgraph_t;
struct GVizAgedge_t;

class  TGraphNode;

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGraphEdge                                                           //
//                                                                      //
// Interface to the graphviz package.                                   //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


class TGraphEdge: public TObject, public TAttLine {

protected:


   TGraphNode *fNode1;     // First node
   TGraphNode *fNode2;     // Second node
   GVizAgedge_t  *fGVEdge; // Graphviz edge
   Double_t   *fX;         // X edge points (GV)
   Double_t   *fY;         // X edge points (GV)
   Int_t      *fN;         // number of edge points (GV)
                           // fN[0] = number of splines
	                	   // fN[1...n] = number of points in each spline
   Double_t    fArrX;      // Arrow X position
   Double_t    fArrY;      // Arrow Y position

public:
   TGraphEdge();
   TGraphEdge(TGraphNode *n1, TGraphNode *n2);
   virtual ~TGraphEdge();

   void           CreateGVEdge(GVizAgraph_t *gv);
   virtual Int_t  DistancetoPrimitive(Int_t px, Int_t py);
   virtual void   ExecuteEvent(Int_t event, Int_t px, Int_t py);
   void           SetGVEdge(GVizAgedge_t *gve) {fGVEdge = gve;}
   GVizAgedge_t  *GetGVEdge() {return fGVEdge;}
   TGraphNode    *GetNode1() {return fNode1;}
   TGraphNode    *GetNode2() {return fNode2;}
   void           Layout();            
   virtual void   Paint(Option_t *option="");
   virtual void   SavePrimitive(std::ostream &, Option_t *);
   void           SaveAttributes(std::ostream &, const char*);


   ClassDef(TGraphEdge,2)  //Graph edge class
};

#endif
 TGraphEdge.h:1
 TGraphEdge.h:2
 TGraphEdge.h:3
 TGraphEdge.h:4
 TGraphEdge.h:5
 TGraphEdge.h:6
 TGraphEdge.h:7
 TGraphEdge.h:8
 TGraphEdge.h:9
 TGraphEdge.h:10
 TGraphEdge.h:11
 TGraphEdge.h:12
 TGraphEdge.h:13
 TGraphEdge.h:14
 TGraphEdge.h:15
 TGraphEdge.h:16
 TGraphEdge.h:17
 TGraphEdge.h:18
 TGraphEdge.h:19
 TGraphEdge.h:20
 TGraphEdge.h:21
 TGraphEdge.h:22
 TGraphEdge.h:23
 TGraphEdge.h:24
 TGraphEdge.h:25
 TGraphEdge.h:26
 TGraphEdge.h:27
 TGraphEdge.h:28
 TGraphEdge.h:29
 TGraphEdge.h:30
 TGraphEdge.h:31
 TGraphEdge.h:32
 TGraphEdge.h:33
 TGraphEdge.h:34
 TGraphEdge.h:35
 TGraphEdge.h:36
 TGraphEdge.h:37
 TGraphEdge.h:38
 TGraphEdge.h:39
 TGraphEdge.h:40
 TGraphEdge.h:41
 TGraphEdge.h:42
 TGraphEdge.h:43
 TGraphEdge.h:44
 TGraphEdge.h:45
 TGraphEdge.h:46
 TGraphEdge.h:47
 TGraphEdge.h:48
 TGraphEdge.h:49
 TGraphEdge.h:50
 TGraphEdge.h:51
 TGraphEdge.h:52
 TGraphEdge.h:53
 TGraphEdge.h:54
 TGraphEdge.h:55
 TGraphEdge.h:56
 TGraphEdge.h:57
 TGraphEdge.h:58
 TGraphEdge.h:59
 TGraphEdge.h:60
 TGraphEdge.h:61
 TGraphEdge.h:62
 TGraphEdge.h:63
 TGraphEdge.h:64
 TGraphEdge.h:65
 TGraphEdge.h:66
 TGraphEdge.h:67
 TGraphEdge.h:68
 TGraphEdge.h:69
 TGraphEdge.h:70
 TGraphEdge.h:71
 TGraphEdge.h:72
 TGraphEdge.h:73
 TGraphEdge.h:74