Logo ROOT   6.16/01
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#include "TObject.h"
16
17#include "TAttLine.h"
18
19struct GVizAgraph_t;
20struct GVizAgedge_t;
21
22class TGraphNode;
23
24
25class TGraphEdge: public TObject, public TAttLine {
26
27protected:
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
41public:
42 TGraphEdge();
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;}
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
int Int_t
Definition: RtypesCore.h:41
double Double_t
Definition: RtypesCore.h:55
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
Line Attributes class.
Definition: TAttLine.h:18
An edge object connecting two nodes which can be added in a TGraphStruct.
Definition: TGraphEdge.h:25
void CreateGVEdge(GVizAgraph_t *gv)
Create the GraphViz edge into the GraphViz data structure gv.
Definition: TGraphEdge.cxx:75
virtual ~TGraphEdge()
Graph Edge default destructor.
Definition: TGraphEdge.cxx:63
TGraphNode * fNode1
First node.
Definition: TGraphEdge.h:30
GVizAgedge_t * fGVEdge
Graphviz edge.
Definition: TGraphEdge.h:32
TGraphNode * fNode2
Second node.
Definition: TGraphEdge.h:31
virtual void SavePrimitive(std::ostream &, Option_t *)
Save primitive as a C++ statement(s) on output stream out.
Definition: TGraphEdge.cxx:206
void SetGVEdge(GVizAgedge_t *gve)
Definition: TGraphEdge.h:49
void Layout()
Layout this edge in the GraphViz space.
Definition: TGraphEdge.cxx:132
TGraphNode * GetNode2()
Definition: TGraphEdge.h:52
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:35
Double_t fArrY
Arrow Y position.
Definition: TGraphEdge.h:39
GVizAgedge_t * GetGVEdge()
Definition: TGraphEdge.h:50
Double_t * fY
X edge points (GV)
Definition: TGraphEdge.h:34
TGraphEdge()
Graph Edge default constructor.
Definition: TGraphEdge.cxx:32
Double_t fArrX
Arrow X position.
Definition: TGraphEdge.h:38
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 Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to an edge.
Definition: TGraphEdge.cxx:93
Double_t * fX
X edge points (GV)
Definition: TGraphEdge.h:33
TGraphNode * GetNode1()
Definition: TGraphEdge.h:51
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TGraphEdge.cxx:113
virtual void Paint(Option_t *option="")
Paint this edge with its current attributes.
Definition: TGraphEdge.cxx:174
A graph node object which can be added in a TGraphStruct.
Definition: TGraphNode.h:27
Mother of all ROOT objects.
Definition: TObject.h:37