22extern gvplugin_library_t gvplugin_dot_layout_LTX_library;
27lt_symlist_t lt_preloaded_symbols[] = {
28 {
"gvplugin_dot_layout_LTX_library", (
void*)(&gvplugin_dot_layout_LTX_library) },
104 TGraphEdge *edge =
new TGraphEdge(n1, n2);
127 TGraphNode *node = (TGraphNode*)
fNodes->FindObject(
name);
130 node =
new TGraphNode(
name, title);
147 file=fopen(filename,
"wt");
175 node = (TGraphNode*)
fNodes->First();
178 node = (TGraphNode*)
fNodes->After(node);
179 if (node) node->
Draw();
186 edge = (TGraphEdge*)
fEdges->First();
189 edge = (TGraphEdge*)
fEdges->After(edge);
190 if (edge) edge->
Draw();
206 fGVC = gvContextPlugins(lt_preloaded_symbols, 0);
217 fGVGraph = (GVizAgraph_t*)agopen((
char*)
"GVGraph", Agdirected, 0);
219 fGVGraph = (GVizAgraph_t*)agopen((
char*)
"GVGraph", AGDIGRAPH);
224 node = (TGraphNode*)
fNodes->First();
227 node = (TGraphNode*)
fNodes->After(node);
234 edge = (TGraphEdge*)
fEdges->First();
237 edge = (TGraphEdge*)
fEdges->After(edge);
243 int ierr = gvLayout(
fGVC, (Agraph_t*)
fGVGraph, (
char*)
"dot");
244 if (ierr)
return ierr;
248 node = (TGraphNode*)
fNodes->First();
251 node = (TGraphNode*)
fNodes->After(node);
258 edge = (TGraphEdge*)
fEdges->First();
261 edge = (TGraphEdge*)
fEdges->After(edge);
278 TGraphNode *node =
nullptr;
280 node =
static_cast<TGraphNode *
>(i == 0 ?
fNodes->First() :
fNodes->After(node));
282 out <<
" TGraphNode *" << node->
GetName() <<
" = graphstruct->AddNode(\"" << node->
GetName() <<
"\", \""
283 << TString(node->
GetTitle()).ReplaceSpecialCppChars() <<
"\");\n";
291 TGraphEdge *edge =
nullptr;
293 edge =
static_cast<TGraphEdge *
>(i == 0 ?
fEdges->First() :
fEdges->After(edge));
296 out <<
" graphstruct->AddEdge(graphedge);\n";
int Int_t
Signed integer 4 bytes (int).
const char Option_t
Option string (const char).
Buffer base class used for serializing objects.
An edge object connecting two nodes which can be added in a TGraphStruct.
void CreateGVEdge(GVizAgraph_t *gv)
Create the GraphViz edge into the GraphViz data structure gv.
void Layout()
Layout this edge in the GraphViz space.
void SaveAttributes(std::ostream &, const char *)
Save attributes as a C++ statement(s) on output stream out called by TGraphStruct::SavePrimitive.
A graph node object which can be added in a TGraphStruct.
void SaveAttributes(std::ostream &)
Save attributes as a C++ statement(s) on output stream out called by TGraphStruct::SavePrimitive.
void CreateGVNode(GVizAgraph_t *gv)
Create the GraphViz node into the GraphViz data structure gv.
void Layout()
Layout this node in the GraphViz space.
TList * fEdges
List of edges in this TGraphStruct.
void AddNode(TGraphNode *node)
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
GVC_s * fGVC
Graphviz context.
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).
void SetMargin(Double_t m=10)
GVizAgraph_t * fGVGraph
Graphviz graph.
void AddEdge(TGraphEdge *edge)
void Streamer(TBuffer &) override
Stream an object of class TObject.
void DumpAsDotFile(const char *filename)
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.