www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtools/@projectList/pCreateFilteredList.m
function pCreateFilteredList(obj, evt) %PCREATEFILTEREDLIST Create the items to list from the project % % PCREATEFILTEREDLIST(OBJ, [EVT]) recreates the filtered list of nodes to % display in the listview. % Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc. if ~isempty(obj.Project) if strcmp(obj.FilterStyle, 'typeobject') pNodes = preorder(obj.Project.info, @i_filterbytype, obj.FilterTypeObject); else if isempty(obj.FilterFunction) pNodes = preorder(obj.Project.info, @address); else pNodes = preorder(obj.Project.info, @i_filterbycustomfunc, obj.FilterFunction); end end if iscell(pNodes) pNodes = [pNodes{:}]; end else pNodes = null(xregpointer,0); end obj.Items = pNodes; function pItem = i_filterbytype(node, tpobj) % Function that filters the project's nodes according to a set of CAGE type % objects. if ismajoritem(node) nodeTP = typeobject(node); KeepNode = false; n = 1; while ~KeepNode && n<=length(tpobj) KeepNode = nodeTP.matchtype(tpobj(n)); n = n+1; end if KeepNode pItem = address(node); else pItem = null(xregpointer,0); end else pItem = null(xregpointer,0); end function pItem = i_filterbycustomfunc(node, customfunc) % Function that executes a user-defined filtering function and either keeps % the node or rejects it. if feval(customfunc, node) pItem = address(node); else pItem = null(xregpointer,0); end