ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TGraphNode.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_TGraphNode
13 #define ROOT_TGraphNode
14 
15 #ifndef ROOT_TNamed
16 #include "TNamed.h"
17 #endif
18 
19 #ifndef ROOT_TAttText
20 #include "TAttText.h"
21 #endif
22 
23 #ifndef ROOT_TAttFill
24 #include "TAttFill.h"
25 #endif
26 
27 #ifndef ROOT_TAttLine
28 #include "TAttLine.h"
29 #endif
30 
31 struct GVizAgraph_t;
32 struct GVizAgnode_t;
33 
34 //////////////////////////////////////////////////////////////////////////
35 // //
36 // TGraphNode //
37 // //
38 // Interface to the graphviz package. //
39 // //
40 //////////////////////////////////////////////////////////////////////////
41 
42 
43 class TGraphNode : public TNamed, public TAttText, public TAttFill, public TAttLine {
44 
45 protected:
46 
47 
48 
49  GVizAgnode_t *fGVNode; // Graphviz node
50  Double_t fX; // Node's center X coordinate
51  Double_t fY; // Node's center Y coordinate
52  Double_t fH; // Node height
53  Double_t fW; // Node width
54 
55 public:
56 
57  TGraphNode();
58  TGraphNode(const char *name, const char *title="");
59  virtual ~TGraphNode();
60 
61  void CreateGVNode(GVizAgraph_t *gv);
63  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
64  void SetGVNode(GVizAgnode_t *gvn) {fGVNode = gvn;}
65  virtual void SetTextAngle(Float_t) {;}
66  GVizAgnode_t *GetGVNode() {return fGVNode;}
67  void Layout();
68  virtual void Paint(Option_t *option="");
69  virtual void SavePrimitive(std::ostream &, Option_t *);
70  void SaveAttributes(std::ostream &);
71 
72  ClassDef(TGraphNode,2) //Graph node class
73 };
74 
75 #endif
void CreateGVNode(GVizAgraph_t *gv)
Create the GraphViz node into the GraphViz data structure gv.
Definition: TGraphNode.cxx:61
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
GVizAgnode_t * fGVNode
Definition: TGraphNode.h:49
int Int_t
Definition: RtypesCore.h:41
Float_t py
Definition: hprod.C:33
Double_t fY
Definition: TGraphNode.h:51
Fill Area Attributes class.
Definition: TAttFill.h:32
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void SetGVNode(GVizAgnode_t *gvn)
Definition: TGraphNode.h:64
ClassDef(TAttLine, 2)
void Layout()
Layout this node in the GraphViz space.
Definition: TGraphNode.cxx:106
virtual ~TGraphNode()
Graph Node default destructor.
Definition: TGraphNode.cxx:54
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
Text Attributes class.
Definition: TAttText.h:32
virtual void Paint(Option_t *option="")
Paint this node with its current attributes.
Definition: TGraphNode.cxx:123
Double_t fW
Definition: TGraphNode.h:53
void SaveAttributes(std::ostream &)
Save attributes as a C++ statement(s) on output stream out called by TGraphStruct::SavePrimitive.
Definition: TGraphNode.cxx:155
double Double_t
Definition: RtypesCore.h:55
A graph node object which can be added in a TGraphStruct.
Definition: TGraphNode.h:43
Double_t fH
Definition: TGraphNode.h:52
GVizAgnode_t * GetGVNode()
Definition: TGraphNode.h:66
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TGraphNode.cxx:92
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a node.
Definition: TGraphNode.cxx:77
#define name(a, b)
Definition: linkTestLib0.cpp:5
Float_t px
Definition: hprod.C:33
virtual void SetTextAngle(Float_t)
Definition: TGraphNode.h:65
Double_t fX
Definition: TGraphNode.h:50
Line Attributes class.
Definition: TAttLine.h:32
virtual void SavePrimitive(std::ostream &, Option_t *)
Save primitive as a C++ statement(s) on output stream out.
Definition: TGraphNode.cxx:147