SNAP Library , Developer Reference  2013-01-07 14:03:36
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 
00002 
00003 typedef enum { gvlDot, gvlNeato, gvlTwopi, gvlCirco } TGVizLayout;
00004 
00006 // GraphViz
00007 namespace TSnap {
00011 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());
00015 template<class PGraph> void DrawGViz(const PGraph& Graph, const TGVizLayout& Layout, const TStr& PltFNm, const TStr& Desc, const TIntStrH& NIdColorH);
00016 
00017 namespace TSnapDetail {
00019 void GVizDoLayout(const TStr& GraphInFNm, TStr OutFNm, const TGVizLayout& Layout);
00021 TStr GVizGetLayoutStr(const TGVizLayout& Layout);
00022 } // namespace TSnapDetail
00023 
00025 // GraphViz implementation
00026 
00027 template<class PGraph>
00028 void DrawGViz(const PGraph& Graph, const TGVizLayout& Layout, const TStr& PltFNm, const TStr& Desc, const bool& NodeLabels, const TIntStrH& NIdColorH) {
00029   const TStr Ext = PltFNm.GetFExt();
00030   const TStr GraphFNm = PltFNm.GetSubStr(0, PltFNm.Len()-Ext.Len()) + "dot";
00031   SaveGViz(Graph, GraphFNm, Desc, NodeLabels, NIdColorH);
00032   TSnap::TSnapDetail::GVizDoLayout(GraphFNm, PltFNm, Layout);
00033 }
00034 
00035 template<class PGraph>
00036 void DrawGViz(const PGraph& Graph, const TGVizLayout& Layout, const TStr& PltFNm, const TStr& Desc, const TIntStrH& NodeLabelH) {
00037   const TStr Ext = PltFNm.GetFExt();
00038   const TStr GraphFNm = PltFNm.GetSubStr(0, PltFNm.Len()-Ext.Len()) + "dot";
00039   SaveGViz(Graph, GraphFNm, Desc, NodeLabelH);
00040   TSnap::TSnapDetail::GVizDoLayout(GraphFNm, PltFNm, Layout);
00041 }
00042 
00043 } // namespace TSNap