Logo ROOT   6.10/09
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 #include "TObject.h"
16 #include "TGraphEdge.h"
17 #include "TGraphNode.h"
18 #include "TList.h"
19 
20 struct GVizAgraph_t;
21 struct GVC_s;
22 
23 
24 class TGraphStruct : public TObject {
25 
26 protected:
27 
28  GVizAgraph_t *fGVGraph; ///< Graphviz graph
29  GVC_s *fGVC; ///< Graphviz context
30  TList *fNodes; ///< List of nodes in this TGraphStruct
31  TList *fEdges; ///< List of edges in this TGraphStruct
32  Double_t fMargin; ///< Margin around the graph (in dots)
33 
34 public:
35 
36  TGraphStruct();
37  virtual ~TGraphStruct();
38 
39  void AddEdge(TGraphEdge *edge);
40  void AddNode(TGraphNode *node);
42  TGraphNode *AddNode(const char *name, const char *title="");
43  void Draw(Option_t *option="");
44  void DumpAsDotFile(const char *filename);
45  TList *GetListOfNodes() const { return fNodes; }
46  TList *GetListOfEdges() const { return fEdges; }
47  Int_t Layout();
48  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
49  void SetMargin(Double_t m=10) {fMargin = m;}
50 
51  ClassDef(TGraphStruct,2) //Graph structure class
52 };
53 
54 #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:32
The Graph Structure is an interface to the graphviz package.
Definition: TGraphStruct.h:24
TList * fNodes
List of nodes in this TGraphStruct.
Definition: TGraphStruct.h:30
An edge object connecting two nodes which can be added in a TGraphStruct.
Definition: TGraphEdge.h:25
void AddNode(TGraphNode *node)
Add the node "node" in this TGraphStruct.
#define ClassDef(name, id)
Definition: Rtypes.h:297
virtual ~TGraphStruct()
Graph Structure default destructor.
A doubly linked list.
Definition: TList.h:43
Int_t Layout()
Layout the graph into a GraphViz data structure.
void SetMargin(Double_t m=10)
Definition: TGraphStruct.h:49
TList * fEdges
List of edges in this TGraphStruct.
Definition: TGraphStruct.h:31
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:27
TList * GetListOfNodes() const
Definition: TGraphStruct.h:45
GVizAgraph_t * fGVGraph
Graphviz graph.
Definition: TGraphStruct.h:28
Mother of all ROOT objects.
Definition: TObject.h:37
TGraphStruct()
Graph Structure default constructor.
TList * GetListOfEdges() const
Definition: TGraphStruct.h:46
GVC_s * fGVC
Graphviz context.
Definition: TGraphStruct.h:29
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.