Home > functions > job > job_edit_act_dir > job_edit_act_select_vertex.m

job_edit_act_select_vertex

PURPOSE ^

Select vertex

SYNOPSIS ^

function job_edit_act_select_vertex(inst_id)

DESCRIPTION ^

 Select vertex
 
 --- Syntax
 job_edit_act_select_vertex(inst_id)

 --- History
 ????-??-?? Taku Yoshioka
 2008-09-04 Taku Yoshioka

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function job_edit_act_select_vertex(inst_id)
0002 % Select vertex
0003 %
0004 % --- Syntax
0005 % job_edit_act_select_vertex(inst_id)
0006 %
0007 % --- History
0008 % ????-??-?? Taku Yoshioka
0009 % 2008-09-04 Taku Yoshioka
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 global vbmeg_inst; 
0015 if isempty(vbmeg_inst.editact{inst_id}.V), return; end
0016 
0017 %
0018 % Global variables
0019 %
0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0021 V = vbmeg_inst.editact{inst_id}.V;
0022 Vinf = vbmeg_inst.editact{inst_id}.Vinf;
0023 ed5 = vbmeg_inst.editact{inst_id}.ed5;
0024 model_type_fold_rb = vbmeg_inst.editact{inst_id}.model_type_fold_rb;
0025 
0026 %
0027 % Select vertex
0028 %
0029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0030 if get(model_type_fold_rb,'Value')~=get(model_type_fold_rb,'Max'), 
0031   V = Vinf;
0032 end
0033 
0034 waitforbuttonpress;
0035 tmp = (select3d)';
0036 if length(tmp)==0, return; end
0037 
0038 % Search nearest vertex
0039 tmp = repmat(tmp, [size(V,1) 1]);
0040 [tmp,ix] = min(sum((tmp - V).^2, 2));
0041 
0042 % Vertex index
0043 set(ed5,'String',num2str(ix));
0044 vbmeg_inst.editact{inst_id}.ix = ix;
0045 
0046 %
0047 % Update plot
0048 %
0049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0050 job_edit_act_update_spatialpattern(inst_id);

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005