Mercurial > hg > camir-aes2014
comparison toolboxes/graph_visualisation/graphViz4Matlab/layouts/Treelayout.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 classdef Treelayout < Gvizlayout | |
2 % A layout that also uses graphviz but calls dot instead of neato to | |
3 % to display the graph like a tree. | |
4 % | |
5 % Matthew Dunham | |
6 % University of British Columbia | |
7 % http://www.cs.ubc.ca/~mdunham/ | |
8 | |
9 methods | |
10 function obj = Treelayout(name) | |
11 if(nargin < 1) | |
12 obj.name = 'Treelayout'; | |
13 else | |
14 obj.name = name; | |
15 end | |
16 %obj.setImage([0,153,102]/255); | |
17 load glicons; | |
18 obj.image = icons.tree; | |
19 obj.shortDescription = 'Tree Layout (GraphViz)'; | |
20 end | |
21 | |
22 function available = isavailable(obj) | |
23 % Make sure graphViz is available. | |
24 available = Gvizlayout.queryGviz('dot'); | |
25 if(not(available)) | |
26 fprintf('Please install or upgrade graphViz\n'); | |
27 end | |
28 end | |
29 | |
30 end | |
31 | |
32 methods(Access = 'protected') | |
33 | |
34 function callGraphViz(obj) | |
35 % Call GraphViz to determine an optimal layout. Write this layout in | |
36 % layout.dot for later parsing. | |
37 err = system(['dot -Tdot -Gmaxiter=5000 -Gstart=7 -o ',obj.layoutFile,' ',obj.adjFile]); | |
38 if(err),error('Sorry, unknown GraphViz failure, try another layout'); end | |
39 end | |
40 | |
41 | |
42 | |
43 end | |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | |
50 | |
51 end |