Make neighbor index list within the radius R [syntax] [nextIX , nextDD] = vb_find_neighbor_all(R, xxF, xxD, Vindx, Ndisp) [input] xxF{i} : <<cell>> Next-neighbor index that share the same triangle xxD{i} : <<cell>> Distance between next-neighbor and the vertex-i Vindx : <<vector>> Vertex index list for calculation Ndisp : <<int>> display process each Ndisp point nextIX{i} : Neighbor index list for the vertex-i nextDD{i} : Distance from the vertex-i [history] Ver 1.0 written by M. Sato 2003-3-15 2004-03-09 Taku Yoshioka Display progress bar 2010-05-26 Taku Yoshioka Minor change (verbose level support) 2011-06-20 taku-y [minor] Progress message was added. Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [nextIX , nextDD] = vb_find_neighbor_all(R, xxF, xxD, Vindx, Ndisp) 0002 % Make neighbor index list within the radius R 0003 % 0004 % [syntax] 0005 % [nextIX , nextDD] = vb_find_neighbor_all(R, xxF, xxD, Vindx, Ndisp) 0006 % 0007 % [input] 0008 % xxF{i} : <<cell>> Next-neighbor index that share the same triangle 0009 % xxD{i} : <<cell>> Distance between next-neighbor and the vertex-i 0010 % Vindx : <<vector>> Vertex index list for calculation 0011 % Ndisp : <<int>> display process each Ndisp point 0012 % 0013 % nextIX{i} : Neighbor index list for the vertex-i 0014 % nextDD{i} : Distance from the vertex-i 0015 % 0016 % [history] 0017 % Ver 1.0 written by M. Sato 2003-3-15 0018 % 2004-03-09 Taku Yoshioka 0019 % Display progress bar 0020 % 2010-05-26 Taku Yoshioka 0021 % Minor change (verbose level support) 0022 % 2011-06-20 taku-y 0023 % [minor] Progress message was added. 0024 % 0025 % Copyright (C) 2011, ATR All Rights Reserved. 0026 % License : New BSD License(see VBMEG_LICENSE.txt) 0027 0028 verbose_const = vb_define_verbose; 0029 global vbmeg_inst; 0030 if isempty(vbmeg_inst) | ~isfield(vbmeg_inst,'verbose_level'), 0031 verbose_level = verbose_const.VERBOSE_LEVEL_NOTICE; 0032 else 0033 verbose_level = vbmeg_inst.verbose_level; 0034 end 0035 0036 tic; 0037 vb_disp_nonl('Start neighbor search: '); 0038 0039 % Total Vertex point number 0040 Nvertex = size(xxF,1); 0041 0042 if nargin<4, Vindx = 1:Nvertex; end; 0043 if nargin<5, Ndisp = 100000; end; 0044 0045 nextIX = cell(Nvertex,1); 0046 nextDD = cell(Nvertex,1); 0047 0048 % Number of target vertex for calculation 0049 N = length(Vindx); 0050 0051 % progress 0052 prg = 0; 0053 prg_all = N; 0054 h_prg = vb_disp_waitbar(prg/prg_all,'Neighbor search'); 0055 vb_disp_nonl(sprintf('%3d %% processed',ceil(100*(prg/prg_all)))); 0056 0057 % Make neighbor index list within the radius R 0058 for n=1:N, 0059 ix = Vindx(n); % Current vertex index 0060 0061 [inext, nextdd] = vb_find_neighbor(R, ix, xxF, xxD ); 0062 nextIX{ix} = inext; 0063 nextDD{ix} = nextdd; 0064 0065 if mod(n,Ndisp)==0, 0066 for ii=1:15; vb_disp_nonl(sprintf('\b')); end 0067 vb_disp_nonl(sprintf('%3d %% processed',ceil(100*(prg/prg_all)))); 0068 vb_disp_waitbar(prg/prg_all,h_prg); 0069 end 0070 prg = prg+1; 0071 end 0072 0073 vb_disp_nonl(sprintf(' %f[sec]\n',toc)); 0074 if ~isempty(h_prg) && ishandle(h_prg) 0075 close(h_prg); 0076 end 0077 0078 return;