Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGraphEdge.h
Go to the documentation of this file.
1 // @(#)root/hist:$Id$
2 // Author: Olivier Couet 13/07/09
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGraphEdge
13 #define ROOT_TGraphEdge
14 
15 #include "TObject.h"
16 
17 #include "TAttLine.h"
18 
19 struct GVizAgraph_t;
20 struct GVizAgedge_t;
21 
22 class TGraphNode;
23 
24 
25 class TGraphEdge: public TObject, public TAttLine {
26 
27 protected:
28 
29 
30  TGraphNode *fNode1; ///< First node
31  TGraphNode *fNode2; ///< Second node
32  GVizAgedge_t *fGVEdge; ///< Graphviz edge
33  Double_t *fX; ///< X edge points (GV)
34  Double_t *fY; ///< X edge points (GV)
35  Int_t *fN; ///< number of edge points (GV)
36  ///< fN[0] = number of splines
37  ///< fN[1...n] = number of points in each spline
38  Double_t fArrX; ///< Arrow X position
39  Double_t fArrY; ///< Arrow Y position
40 
41 public:
42  TGraphEdge();
43  TGraphEdge(TGraphNode *n1, TGraphNode *n2);
44  virtual ~TGraphEdge();
45 
46  void CreateGVEdge(GVizAgraph_t *gv);
47  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
48  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
49  void SetGVEdge(GVizAgedge_t *gve) {fGVEdge = gve;}
50  GVizAgedge_t *GetGVEdge() {return fGVEdge;}
51  TGraphNode *GetNode1() {return fNode1;}
52  TGraphNode *GetNode2() {return fNode2;}
53  void Layout();
54  virtual void Paint(Option_t *option="");
55  virtual void SavePrimitive(std::ostream &, Option_t *);
56  void SaveAttributes(std::ostream &, const char*);
57 
58 
59  ClassDef(TGraphEdge,2) //Graph edge class
60 };
61 
62 #endif