Logo ROOT   6.08/07
Reference Guide
TGraphStruct.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_TGraphStruct
13 #define ROOT_TGraphStruct
14 
15 #ifndef ROOT_TObject
16 #include "TObject.h"
17 #endif
18 #ifndef ROOT_TGraphEdge
19 #include "TGraphEdge.h"
20 #endif
21 #ifndef ROOT_TGraphNode
22 #include "TGraphNode.h"
23 #endif
24 #ifndef ROOT_TList
25 #include "TList.h"
26 #endif
27 
28 struct GVizAgraph_t;
29 struct GVC_s;
30 
31 
32 class TGraphStruct : public TObject {
33 
34 protected:
35 
36  GVizAgraph_t *fGVGraph; ///< Graphviz graph
37  GVC_s *fGVC; ///< Graphviz context
38  TList *fNodes; ///< List of nodes in this TGraphStruct
39  TList *fEdges; ///< List of edges in this TGraphStruct
40  Double_t fMargin; ///< Margin around the graph (in dots)
41 
42 public:
43 
44  TGraphStruct();
45  virtual ~TGraphStruct();
46 
47  void AddEdge(TGraphEdge *edge);
48  void AddNode(TGraphNode *node);
50  TGraphNode *AddNode(const char *name, const char *title="");
51  void Draw(Option_t *option="");
52  void DumpAsDotFile(const char *filename);
53  TList *GetListOfNodes() const { return fNodes; }
54  TList *GetListOfEdges() const { return fEdges; }
55  Int_t Layout();
56  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
57  void SetMargin(Double_t m=10) {fMargin = m;}
58 
59  ClassDef(TGraphStruct,2) //Graph structure class
60 };
61 
62 #endif
void DumpAsDotFile(const char *filename)
Dump this graph structure as a "dot" file.
const char Option_t
Definition: RtypesCore.h:62
int Int_t
Definition: RtypesCore.h:41
Double_t fMargin
Margin around the graph (in dots)
Definition: TGraphStruct.h:40
The Graph Structure is an interface to the graphviz package.
Definition: TGraphStruct.h:32
TList * fNodes
List of nodes in this TGraphStruct.
Definition: TGraphStruct.h:38
An edge object connecting two nodes which can be added in a TGraphStruct.
Definition: TGraphEdge.h:29
void AddNode(TGraphNode *node)
Add the node "node" in this TGraphStruct.
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual ~TGraphStruct()
Graph Structure default destructor.
A doubly linked list.
Definition: TList.h:47
Int_t Layout()
Layout the graph into a GraphViz data structure.
void SetMargin(Double_t m=10)
Definition: TGraphStruct.h:57
TList * fEdges
List of edges in this TGraphStruct.
Definition: TGraphStruct.h:39
void AddEdge(TGraphEdge *edge)
Add the edge "edge" in this TGraphStruct.
void Draw(Option_t *option="")
Draw the graph.
TMarker * m
Definition: textangle.C:8
double Double_t
Definition: RtypesCore.h:55
A graph node object which can be added in a TGraphStruct.
Definition: TGraphNode.h:35
TList * GetListOfNodes() const
Definition: TGraphStruct.h:53
GVizAgraph_t * fGVGraph
Graphviz graph.
Definition: TGraphStruct.h:36
Mother of all ROOT objects.
Definition: TObject.h:37
TGraphStruct()
Graph Structure default constructor.
TList * GetListOfEdges() const
Definition: TGraphStruct.h:54
GVC_s * fGVC
Graphviz context.
Definition: TGraphStruct.h:37
char name[80]
Definition: TGX11.cxx:109
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.