www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgoptimnode/duplicate.m

    function Tnew = duplicate(T, ptrmethod)
%DUPLICATE Duplicate the tree node
%
%  Tnew = DUPLICATE(T) where T and Tnew are the old and new tree node
%  object respectively will make a copy of T and attach it to the same
%  parent node as T.  Pointers that are duplicated are found by calling the
%  getduplicationptrs method on the node and its children.
%
%  Tnew = DUPLICATE(T, PTRMETHOD) where PTRMETHD is a string or function
%  handle will instead use the given function for retrieving the duplication
%  pointers.

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


% Call parent duplicate method
if nargin==1
    Tnew = duplicate(T.cgcontainer);
else
    Tnew = duplicate(T.cgcontainer, ptrmethod);
end

% Call duplicate on the cgoptim
pData = getdata(Tnew);
pData.info = pData.duplicatestores(project(Tnew));