Mercurial > repos > public > sbplib
comparison +multiblock/Def.m @ 543:9924f1f8c906 feature/grids
Allow labels to be block ids
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 15 Aug 2017 12:57:36 +0200 |
parents | 3377bedf371f |
children | 687756646aa9 |
comparison
equal
deleted
inserted
replaced
542:febd750965c4 | 543:9924f1f8c906 |
---|---|
47 | 47 |
48 g = multiblock.Grid(grids, obj.connections, obj.boundaryGroups); | 48 g = multiblock.Grid(grids, obj.connections, obj.boundaryGroups); |
49 end | 49 end |
50 | 50 |
51 function show(obj, label, gridLines, varargin) | 51 function show(obj, label, gridLines, varargin) |
52 default_arg('label', true) | 52 default_arg('label', 'name') |
53 default_arg('gridLines', false); | 53 default_arg('gridLines', false); |
54 | 54 |
55 if ~label && ~gridLines | 55 if isempty('label') && ~gridLines |
56 for i = 1:obj.nBlocks | 56 for i = 1:obj.nBlocks |
57 obj.blockMaps{i}.show(2,2); | 57 obj.blockMaps{i}.show(2,2); |
58 end | 58 end |
59 axis equal | 59 axis equal |
60 return | 60 return |
65 for i = 1:obj.nBlocks | 65 for i = 1:obj.nBlocks |
66 obj.blockMaps{i}.show(ms{i}(1),ms{i}(2)); | 66 obj.blockMaps{i}.show(ms{i}(1),ms{i}(2)); |
67 end | 67 end |
68 end | 68 end |
69 | 69 |
70 if label | 70 |
71 for i = 1:obj.nBlocks | 71 switch label |
72 parametrization.Ti.label(obj.blockMaps{i}, obj.blockNames{i}); | 72 case 'name' |
73 end | 73 labels = obj.blockNames; |
74 case 'id' | |
75 labels = {}; | |
76 for i = 1:obj.nBlocks | |
77 labels{i} = num2str(i); | |
78 end | |
79 otherwise | |
80 axis equal | |
81 return | |
82 end | |
83 | |
84 for i = 1:obj.nBlocks | |
85 parametrization.Ti.label(obj.blockMaps{i}, labels{i}); | |
74 end | 86 end |
75 | 87 |
76 axis equal | 88 axis equal |
77 end | 89 end |
78 end | 90 end |