0001 function [o, others] = maroi_sphere(params)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 myclass = 'maroi_sphere';
0013 defstruct = struct('centre', [0 0 0],'radius', 0);
0014
0015 if nargin < 1
0016 params = [];
0017 end
0018 if isa(params, myclass)
0019 o = params;
0020 return
0021 end
0022
0023
0024 pparams = mars_struct('ffillmerge', defstruct, params);
0025
0026
0027 [uo, pparams] = maroi_shape(pparams);
0028
0029
0030 [pparams, others] = mars_struct('split', pparams, defstruct);
0031
0032
0033 if size(pparams.centre, 2) == 1
0034 pparams.centre = pparams.centre';
0035 end
0036
0037 pparams.radius = double(pparams.radius)
0038
0039 o = class(pparams, myclass, uo);
0040 return