annotate toolboxes/graph_visualisation/graphViz4Matlab/layouts/Treelayout.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 classdef Treelayout < Gvizlayout
Daniel@0 2 % A layout that also uses graphviz but calls dot instead of neato to
Daniel@0 3 % to display the graph like a tree.
Daniel@0 4 %
Daniel@0 5 % Matthew Dunham
Daniel@0 6 % University of British Columbia
Daniel@0 7 % http://www.cs.ubc.ca/~mdunham/
Daniel@0 8
Daniel@0 9 methods
Daniel@0 10 function obj = Treelayout(name)
Daniel@0 11 if(nargin < 1)
Daniel@0 12 obj.name = 'Treelayout';
Daniel@0 13 else
Daniel@0 14 obj.name = name;
Daniel@0 15 end
Daniel@0 16 %obj.setImage([0,153,102]/255);
Daniel@0 17 load glicons;
Daniel@0 18 obj.image = icons.tree;
Daniel@0 19 obj.shortDescription = 'Tree Layout (GraphViz)';
Daniel@0 20 end
Daniel@0 21
Daniel@0 22 function available = isavailable(obj)
Daniel@0 23 % Make sure graphViz is available.
Daniel@0 24 available = Gvizlayout.queryGviz('dot');
Daniel@0 25 if(not(available))
Daniel@0 26 fprintf('Please install or upgrade graphViz\n');
Daniel@0 27 end
Daniel@0 28 end
Daniel@0 29
Daniel@0 30 end
Daniel@0 31
Daniel@0 32 methods(Access = 'protected')
Daniel@0 33
Daniel@0 34 function callGraphViz(obj)
Daniel@0 35 % Call GraphViz to determine an optimal layout. Write this layout in
Daniel@0 36 % layout.dot for later parsing.
Daniel@0 37 err = system(['dot -Tdot -Gmaxiter=5000 -Gstart=7 -o ',obj.layoutFile,' ',obj.adjFile]);
Daniel@0 38 if(err),error('Sorry, unknown GraphViz failure, try another layout'); end
Daniel@0 39 end
Daniel@0 40
Daniel@0 41
Daniel@0 42
Daniel@0 43 end
Daniel@0 44
Daniel@0 45
Daniel@0 46
Daniel@0 47
Daniel@0 48
Daniel@0 49
Daniel@0 50
Daniel@0 51 end