Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 ~TGraphEdge() override;
45
46 void CreateGVEdge(GVizAgraph_t *gv);
47 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
48 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
49 void SetGVEdge(GVizAgedge_t *gve) {fGVEdge = gve;}
50 GVizAgedge_t *GetGVEdge() {return fGVEdge;}
53 void Layout();
54 void Paint(Option_t *option="") override;
55 void SavePrimitive(std::ostream &, Option_t *) override;
56 void SaveAttributes(std::ostream &, const char*);
57
58
59 ClassDefOverride(TGraphEdge,2) //Graph edge class
60};
61
62#endif
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
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.
void Paint(Option_t *option="") override
Paint this edge with its current attributes.
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
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to an edge.
void SetGVEdge(GVizAgedge_t *gve)
Definition TGraphEdge.h:49
void SavePrimitive(std::ostream &, Option_t *) override
Save primitive as a C++ statement(s) on output stream out.
void Layout()
Layout this edge in the GraphViz space.
~TGraphEdge() override
Graph Edge default destructor.
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.
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.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Double_t * fX
X edge points (GV)
Definition TGraphEdge.h:33
TGraphNode * GetNode1()
Definition TGraphEdge.h:51
A graph node object which can be added in a TGraphStruct.
Definition TGraphNode.h:27
Mother of all ROOT objects.
Definition TObject.h:41