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; }
47 Int_t Layout();
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
Definition RtypesCore.h:45
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
char name[80]
Definition TGX11.cxx:110
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.
~TGraphStruct() override
Graph Structure default destructor.
TList * fEdges
List of edges in this TGraphStruct.
void AddNode(TGraphNode *node)
Add the node "node" in this TGraphStruct.
TList * GetListOfNodes() const
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
TList * GetListOfEdges() const
GVC_s * fGVC
Graphviz context.
TList * fNodes
List of nodes in this TGraphStruct.
Double_t fMargin
Margin around the graph (in dots)
Int_t Layout()
Layout the graph into a GraphViz data structure.
void SetMargin(Double_t m=10)
GVizAgraph_t * fGVGraph
Graphviz graph.
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:38
Mother of all ROOT objects.
Definition TObject.h:41
th1 Draw()
TMarker m
Definition textangle.C:8