Logo ROOT   6.10/09
Reference Guide
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 #include "TNamed.h"
16 
17 #include "TAttText.h"
18 
19 #include "TAttFill.h"
20 
21 #include "TAttLine.h"
22 
23 struct GVizAgraph_t;
24 struct GVizAgnode_t;
25 
26 
27 class TGraphNode : public TNamed, public TAttText, public TAttFill, public TAttLine {
28 
29 protected:
30 
31 
32 
33  GVizAgnode_t *fGVNode; ///< Graphviz node
34  Double_t fX; ///< Node's center X coordinate
35  Double_t fY; ///< Node's center Y coordinate
36  Double_t fH; ///< Node height
37  Double_t fW; ///< Node width
38 
39 public:
40 
41  TGraphNode();
42  TGraphNode(const char *name, const char *title="");
43  virtual ~TGraphNode();
44 
45  void CreateGVNode(GVizAgraph_t *gv);
46  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
47  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
48  void SetGVNode(GVizAgnode_t *gvn) {fGVNode = gvn;}
49  virtual void SetTextAngle(Float_t) {;}
50  GVizAgnode_t *GetGVNode() {return fGVNode;}
51  void Layout();
52  virtual void Paint(Option_t *option="");
53  virtual void SavePrimitive(std::ostream &, Option_t *);
54  void SaveAttributes(std::ostream &);
55 
56  ClassDef(TGraphNode,2) //Graph node class
57 };
58 
59 #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
Graphviz node.
Definition: TGraphNode.h:33
int Int_t
Definition: RtypesCore.h:41
Double_t fY
Node&#39;s center Y coordinate.
Definition: TGraphNode.h:35
Fill Area Attributes class.
Definition: TAttFill.h:19
#define ClassDef(name, id)
Definition: Rtypes.h:297
TGraphNode()
Graph node default constructor.
Definition: TGraphNode.cxx:29
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
void SetGVNode(GVizAgnode_t *gvn)
Definition: TGraphNode.h:48
void Layout()
Layout this node in the GraphViz space.
Definition: TGraphNode.cxx:106
virtual ~TGraphNode()
Graph Node default destructor.
Definition: TGraphNode.cxx:54
Text Attributes class.
Definition: TAttText.h:18
virtual void Paint(Option_t *option="")
Paint this node with its current attributes.
Definition: TGraphNode.cxx:123
Double_t fW
Node width.
Definition: TGraphNode.h:37
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:27
Double_t fH
Node height.
Definition: TGraphNode.h:36
GVizAgnode_t * GetGVNode()
Definition: TGraphNode.h:50
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
virtual void SetTextAngle(Float_t)
Set the text angle.
Definition: TGraphNode.h:49
Double_t fX
Node&#39;s center X coordinate.
Definition: TGraphNode.h:34
Line Attributes class.
Definition: TAttLine.h:18
virtual void SavePrimitive(std::ostream &, Option_t *)
Save primitive as a C++ statement(s) on output stream out.
Definition: TGraphNode.cxx:147