SNAP Library 2.1, Developer Reference  2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
gviz.h
Go to the documentation of this file.
00001 //#//////////////////////////////////////////////
00003 typedef enum TGVizLayout_ { gvlDot, gvlNeato, gvlTwopi, gvlCirco, gvlSfdp } TGVizLayout;
00004 
00006 // GraphViz
00007 namespace TSnap {
00009 
00014 template<class PGraph> void DrawGViz(const PGraph& Graph, const TGVizLayout& Layout, const TStr& PltFNm, const TStr& Desc=TStr(), const bool& NodeLabels=false, const TIntStrH& NIdColorH=TIntStrH());
00016 
00021 template<class PGraph> void DrawGViz(const PGraph& Graph, const TGVizLayout& Layout, const TStr& PltFNm, const TStr& Desc, const TIntStrH& NodeLabelH);
00022   
00023 namespace TSnapDetail {
00025 void GVizDoLayout(const TStr& GraphInFNm, TStr OutFNm, const TGVizLayout& Layout);
00027 TStr GVizGetLayoutStr(const TGVizLayout& Layout);
00028 } // namespace TSnapDetail
00029 
00031 // GraphViz implementation
00032 
00033 template<class PGraph>
00034 void DrawGViz(const PGraph& Graph, const TGVizLayout& Layout, const TStr& PltFNm, const TStr& Desc, const bool& NodeLabels, const TIntStrH& NIdColorH) {
00035   const TStr Ext = PltFNm.GetFExt();
00036   const TStr GraphFNm = PltFNm.GetSubStr(0, PltFNm.Len()-Ext.Len()) + "dot";
00037   SaveGViz(Graph, GraphFNm, Desc, NodeLabels, NIdColorH);
00038   TSnap::TSnapDetail::GVizDoLayout(GraphFNm, PltFNm, Layout);
00039 }
00040 
00041 template<class PGraph>
00042 void DrawGViz(const PGraph& Graph, const TGVizLayout& Layout, const TStr& PltFNm, const TStr& Desc, const TIntStrH& NodeLabelH) {
00043   const TStr Ext = PltFNm.GetFExt();
00044   const TStr GraphFNm = PltFNm.GetSubStr(0, PltFNm.Len()-Ext.Len()) + "dot";
00045   SaveGViz(Graph, GraphFNm, Desc, NodeLabelH);
00046   TSnap::TSnapDetail::GVizDoLayout(GraphFNm, PltFNm, Layout);
00047 }
00048 
00049 } // namespace TSNap