Logo ROOT   6.08/07
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 class TGraphEdge: public TObject, public TAttLine {
30 
31 protected:
32 
33 
34  TGraphNode *fNode1; ///< First node
35  TGraphNode *fNode2; ///< Second node
36  GVizAgedge_t *fGVEdge; ///< Graphviz edge
37  Double_t *fX; ///< X edge points (GV)
38  Double_t *fY; ///< X edge points (GV)
39  Int_t *fN; ///< number of edge points (GV)
40  ///< fN[0] = number of splines
41  ///< fN[1...n] = number of points in each spline
42  Double_t fArrX; ///< Arrow X position
43  Double_t fArrY; ///< Arrow Y position
44 
45 public:
46  TGraphEdge();
48  virtual ~TGraphEdge();
49 
50  void CreateGVEdge(GVizAgraph_t *gv);
51  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
52  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
53  void SetGVEdge(GVizAgedge_t *gve) {fGVEdge = gve;}
54  GVizAgedge_t *GetGVEdge() {return fGVEdge;}
55  TGraphNode *GetNode1() {return fNode1;}
56  TGraphNode *GetNode2() {return fNode2;}
57  void Layout();
58  virtual void Paint(Option_t *option="");
59  virtual void SavePrimitive(std::ostream &, Option_t *);
60  void SaveAttributes(std::ostream &, const char*);
61 
62 
63  ClassDef(TGraphEdge,2) //Graph edge class
64 };
65 
66 #endif
Int_t * fN
number of edge points (GV) fN[0] = number of splines fN[1...n] = number of points in each spline ...
Definition: TGraphEdge.h:39
GVizAgedge_t * fGVEdge
Graphviz edge.
Definition: TGraphEdge.h:36
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:29
#define ClassDef(name, id)
Definition: Rtypes.h:254
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:55
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
X edge points (GV)
Definition: TGraphEdge.h:37
GVizAgedge_t * GetGVEdge()
Definition: TGraphEdge.h:54
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
Arrow X position.
Definition: TGraphEdge.h:42
TGraphNode * GetNode2()
Definition: TGraphEdge.h:56
TGraphEdge()
Graph Edge default constructor.
Definition: TGraphEdge.cxx:32
TGraphNode * fNode2
Second node.
Definition: TGraphEdge.h:35
void SetGVEdge(GVizAgedge_t *gve)
Definition: TGraphEdge.h:53
Double_t * fY
X edge points (GV)
Definition: TGraphEdge.h:38
double Double_t
Definition: RtypesCore.h:55
A graph node object which can be added in a TGraphStruct.
Definition: TGraphNode.h:35
Mother of all ROOT objects.
Definition: TObject.h:37
Double_t fArrY
Arrow Y position.
Definition: TGraphEdge.h:43
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:24
TGraphNode * fNode1
First node.
Definition: TGraphEdge.h:34