www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/@xregbdrydev/guiSetupConstraint.m

    function [bdev, ok] = guiSetupConstraint(bdev,varargin)
%GUISETUPCONSTRAINT Choose type and active factors for boundary dev
%
%  [BDEV, OK] = GUISETUPCONSTRAINT(BDEV)  creates a blocking GUI for
%  choosing a constraint model and it's parameters for the boundary
%  development object BDEV.  It returns an updated version of BDEV and
%  OK, which indicates whether the user pressed 'OK' or 'CANCEL'.
%
%  See also XREGBDRYDEV, CONBASE/GUITYPEANDFACTORSCHOOSER.

%  Copyright 2005-2008 The MathWorks, Inc. and Ford Global Technologies, Inc.

con = bdev.Constraint; % getconstraint( bdev );
if isempty( con ),
    IsNew= true;
    con = newconstraint( bdev );
    opts = getFitOptions(con,'all');
else
    IsNew= false;
    [opts,ok] = getFitOptions(bdev,'all');
end

classes = getconstrainttypes( bdev );


[con,opts, ok,HasChanged] = guiTypeAndFactorsChooser( con, opts, classes, varargin{:} );


if ok && (IsNew || HasChanged)
    bdev = setupConstraint(bdev,con,opts);
end

%--------------------------------------------------------------------------
% EOF
%--------------------------------------------------------------------------