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