Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
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 ~TGraphStruct() override;
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="") override;
44 void DumpAsDotFile(const char *filename);
45 TList *GetListOfNodes() const { return fNodes; }
46 TList *GetListOfEdges() const { return fEdges; }
48 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
50
51 ClassDefOverride(TGraphStruct,2) //Graph structure class
52};
53
54#endif
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
const char Option_t
Option string (const char).
Definition RtypesCore.h:80
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
char name[80]
Definition TGX11.cxx:148
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
~TGraphStruct() override
TList * fEdges
List of edges in this TGraphStruct.
void AddNode(TGraphNode *node)
TList * GetListOfNodes() const
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TList * GetListOfEdges() const
GVC_s * fGVC
Graphviz context.
TGraphNode * AddNode(const char *name, const char *title="")
void Draw(Option_t *option="") override
Default Draw method for all objects.
TList * fNodes
List of nodes in this TGraphStruct.
Double_t fMargin
Margin around the graph (in dots).
TGraphEdge * AddEdge(TGraphNode *n1, TGraphNode *n2)
Int_t Layout()
void SetMargin(Double_t m=10)
GVizAgraph_t * fGVGraph
Graphviz graph.
void AddEdge(TGraphEdge *edge)
void DumpAsDotFile(const char *filename)
A doubly linked list.
Definition TList.h:38
TObject()
TObject constructor.
Definition TObject.h:259
TMarker m
Definition textangle.C:8