www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@constar/optmgr_raysfromdata.m

    function [om,ok] = optmgr_raysfromdata( c, varargin )
%OPTMGR_RAYSFROMDATA   Creates an xregoptmgr for CONSTAR objects
%   OPTMGR_RAYSFROMDATA(C) is a nested optim manger (xegoptmgr object) for 
%   the constar object C. This nested optim manger controls the number and 
%   direction of the rays use by the ray casting algorithm. In particuar, this 
%   optim manger specifies that the rays be given by the data directions.
%
%   See also OPTMGR, OPTMGR_INTERIOR, OPTMGR_BOUNDARYONLY, OPTMGR_AUTODILATION, 
%   OPTMGR_MANUALDILATION, OPTMGR_RAYSFROMNUMBER.

%  Copyright 2000-2014 The MathWorks, Inc. and Ford Global Technologies, Inc.

om = contextimplementation( xregoptmgr, c, @i_raysfromdata, [], ...
    'From data', @optmgr_raysfromdata );
om = setAltMgrs( om, { @optmgr_raysfromdata, @optmgr_raysfromnumber } );

ok = 1;

%--------------------------------------------------------------------------
function [c,r,null] = i_raysfromdata( c, ~, varargin )
% Inputs:
%    c       constar object
%    om      option manger
% Outputs:
%    c       constar object
%    r       radius
%    null    ignore

null = [];
r = 'Data';