www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/cgFillWizard.m

    function [OK, F]= cgFillWizard(pf,varargin)
%CGFILLWIZARD wizard for feature filling 
%
% [OK, out] = cgFillWizard('create',pf,varargin)
%    pf   pointer to cgfeature
%    varargin Property/values pairs for cgsimfill.feature 
%             e.g. 'Project',CGP,'Tables','pTab

%  Copyright 2005-2011 The MathWorks, Inc.


% explicitly set the model so the boundary constraint is set up.

F = pf.get('cgsimfill');
if isempty(F)
    F = cgsimfill.Feature(pf,varargin{:});
else
    %work on a copy of fill object so original settings can are not overwritten on cancel
    F = copy(F);
end
cgb = cgbrowser;
if cgb.GUIExists
    pH = cgb.Figure;
else
    pH = [];
end

Tptrs = getAllUnlockedTables(F);
if isempty(Tptrs)
    h = errordlg('There are no unlocked table cells to fill in this feature.', ...
        'Feature Fill', 'modal');
    waitfor(h);
    F = [];
    OK = 0;
    return
end

TableBackup = infoarray( Tptrs );
FeatureBackup = info( pf );
[OK, F] = xregwizard(pH, 'Feature Fill Wizard', {@cgFillCardOne}, F);
if OK
    % save the cgsimfill.Feature
    pf.info = set(pf.info,'cgsimfill',F);
else
    % restore table values
    passign(Tptrs, TableBackup);
    passign(pf, FeatureBackup );
    
end