ROOT  6.06/09
Reference Guide
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 #ifndef ROOT_TObject
16 #include "TObject.h"
17 #endif
18 
19 #ifndef ROOT_TAttLine
20 #include "TAttLine.h"
21 #endif
22 
23 struct GVizAgraph_t;
24 struct GVizAgedge_t;
25 
26 class TGraphNode;
27 
28 //////////////////////////////////////////////////////////////////////////
29 // //
30 // TGraphEdge //
31 // //
32 // Interface to the graphviz package. //
33 // //
34 //////////////////////////////////////////////////////////////////////////
35 
36 
37 class TGraphEdge: public TObject, public TAttLine {
38 
39 protected:
40 
41 
42  TGraphNode *fNode1; // First node
43  TGraphNode *fNode2; // Second node
44  GVizAgedge_t *fGVEdge; // Graphviz edge
45  Double_t *fX; // X edge points (GV)
46  Double_t *fY; // X edge points (GV)
47  Int_t *fN; // number of edge points (GV)
48  // fN[0] = number of splines
49  // fN[1...n] = number of points in each spline
50  Double_t fArrX; // Arrow X position
51  Double_t fArrY; // Arrow Y position
52 
53 public:
54  TGraphEdge();
56  virtual ~TGraphEdge();
57 
58  void CreateGVEdge(GVizAgraph_t *gv);
59  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
60  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
61  void SetGVEdge(GVizAgedge_t *gve) {fGVEdge = gve;}
62  GVizAgedge_t *GetGVEdge() {return fGVEdge;}
63  TGraphNode *GetNode1() {return fNode1;}
64  TGraphNode *GetNode2() {return fNode2;}
65  void Layout();
66  virtual void Paint(Option_t *option="");
67  virtual void SavePrimitive(std::ostream &, Option_t *);
68  void SaveAttributes(std::ostream &, const char*);
69 
70 
71  ClassDef(TGraphEdge,2) //Graph edge class
72 };
73 
74 #endif
Int_t * fN
Definition: TGraphEdge.h:47
GVizAgedge_t * fGVEdge
Definition: TGraphEdge.h:44
const char Option_t
Definition: RtypesCore.h:62
int Int_t
Definition: RtypesCore.h:41
An edge object connecting two nodes which can be added in a TGraphStruct.
Definition: TGraphEdge.h:37
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TGraphEdge.cxx:113
TGraphNode * GetNode1()
Definition: TGraphEdge.h:63
ClassDef(TAttLine, 2)
void Layout()
Layout this edge in the GraphViz space.
Definition: TGraphEdge.cxx:132
virtual void Paint(Option_t *option="")
Paint this edge with its current attributes.
Definition: TGraphEdge.cxx:174
Double_t * fX
Definition: TGraphEdge.h:45
GVizAgedge_t * GetGVEdge()
Definition: TGraphEdge.h:62
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to an edge.
Definition: TGraphEdge.cxx:93
Double_t fArrX
Definition: TGraphEdge.h:50
TGraphNode * GetNode2()
Definition: TGraphEdge.h:64
TGraphNode * fNode2
Definition: TGraphEdge.h:43
void SetGVEdge(GVizAgedge_t *gve)
Definition: TGraphEdge.h:61
Double_t * fY
Definition: TGraphEdge.h:46
double Double_t
Definition: RtypesCore.h:55
A graph node object which can be added in a TGraphStruct.
Definition: TGraphNode.h:43
Mother of all ROOT objects.
Definition: TObject.h:58
Double_t fArrY
Definition: TGraphEdge.h:51
void CreateGVEdge(GVizAgraph_t *gv)
Create the GraphViz edge into the GraphViz data structure gv.
Definition: TGraphEdge.cxx:75
void SaveAttributes(std::ostream &, const char *)
Save attributes as a C++ statement(s) on output stream out called by TGraphStruct::SavePrimitive.
Definition: TGraphEdge.cxx:214
virtual void SavePrimitive(std::ostream &, Option_t *)
Save primitive as a C++ statement(s) on output stream out.
Definition: TGraphEdge.cxx:206
virtual ~TGraphEdge()
Graph Edge default destructor.
Definition: TGraphEdge.cxx:63
Line Attributes class.
Definition: TAttLine.h:32
TGraphNode * fNode1
Definition: TGraphEdge.h:42