1 classdef LeafDescription < DataTree.ICreator
2 % DataTree.ICreator implementation which does not create a tree, but a cell
3 % array of descriptions
for all leafs in the tree.
6 function node = create_tpart_node(
this, t_part_map, initvalues)
7 %
function node = create_tpart_node(
this, t_part_map, initvalues)
11 for i = 1:length(initvalues)
12 tslice = get_coords(t_part_map, t_part_map.leaf_enum(i));
13 bary = barycenter(t_part_map, t_part_map.leaf_enum(i));
14 for j = 1:length(initvalues{i})
15 if isempty(initvalues{i}(j).tslice)
16 initvalues{i}(j).tslice = tslice;
17 initvalues{i}(j).t_bary = bary;
22 node = [initvalues{:}];
25 function node = create_idmap_node(
this, id_map, initvalues)
26 %
function node = create_idmap_node(
this, id_map, initvalues)
31 for i = 1:length(initvalues)
32 for j = 1:length(initvalues{i})
33 if isempty(initvalues{i}(j).
id)
34 initvalues{i}(j).
id = DataTree.IdMapNode.flatten_cell_array(id_map{i});
38 node = [initvalues{:}];
41 function node = create_ppart_node(
this, p_part_map, initvalues)
42 %
function node = create_ppart_node(
this, p_part_map, initvalues)
46 for i = 1:length(initvalues)
47 mu_cube = get_coords(p_part_map, p_part_map.leaf_enum(i));
48 mu_bary = barycenter(p_part_map, p_part_map.leaf_enum(i));
49 for j = 1:length(initvalues{i})
50 if isempty(initvalues{i}(j).mu_cube)
51 initvalues{i}(j).mu_cube = mu_cube;
52 initvalues{i}(j).mu_bary = mu_bary;
57 node = [initvalues{:}];
60 function node = create_leaf_node(
this, arg_node, basepath, mu_cube, tslice)
61 %
function node = create_leaf_node(
this, arg_node, basepath, mu_cube, tslice)
66 node = struct('tslice', [], 't_bary', [], '
id', [], 'mu_cube', [], 'mu_bary', [], 'basepath', basepath);