Changeset 252 for trunk/src/uvmat.m
- Timestamp:
- May 15, 2011, 11:17:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r251 r252 230 230 set(hObject,'WindowButtonUpFcn',{'mouse_up',handles}) 231 231 set(hObject,'DeleteFcn',{@closefcn})% 232 set(handles.list_object_1,'ButtonDownFcn',{@list_object_1_Callback,handles})% allows activation of lis_object_1_callback with right mouse click 233 set(handles.list_object_2,'ButtonDownFcn',{@list_object_2_Callback,handles}) 232 234 233 235 %% refresh projection plane … … 1676 1678 function runplus_Callback(hObject, eventdata, handles) 1677 1679 %------------------------------------------------------------------- 1680 eventdata 1678 1681 set(handles.runplus,'BackgroundColor',[1 1 0])%paint the command button in yellow 1679 1682 drawnow … … 2570 2573 else 2571 2574 % create a default projection 2572 % UvData.Object{1}.ProjMode='projection';%main plotting plane 2573 % UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat 2574 % set(handles.list_object_1,'Value',1); 2575 % set(handles.list_object_1,'String',{''}); 2575 UvData.Object{1}.ProjMode='projection';%main plotting plane 2576 UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat 2577 set(handles.list_object_1,'Value',1); 2578 list_object=get(handles.list_object_1,'String') 2579 if isempty(list_object) 2580 list_object={''}; 2581 elseif ~isempty(list_object{1}) 2582 list_object=[{''};list_object]; 2583 end 2584 set(handles.list_object_1,'String',list_object); 2585 set(handles.list_object_2,'String',list_object); 2576 2586 end 2577 2587 % if ~isfield(UvData.Object{1},'plotaxes') … … 4295 4305 list_str=get(handles.list_object_1,'String'); 4296 4306 IndexObj=get(handles.list_object_1,'Value'); 4297 str_1=list_str{IndexObj}; 4298 % val_2=get(handles.list_object_2,'Value'); 4299 % str_2=get(handles.list_object_2,'String'); 4300 % if isequal(val_2,IndexObj)% if the first selection is equal to the second, it will suppress the second 4301 % set(handles.list_object_2,'Value',numel(str_2))%select the end of the list ('...') 4302 % list_object_2_Callback(hObject, eventdata, handles) 4303 % end 4304 update_object(handles,IndexObj,1,str_1) 4307 %IndexObj(2)=get(handles.list_object_2,'Value'); 4308 update_object(handles,IndexObj,1,list_str{IndexObj}) 4305 4309 4306 4310 %------------------------------------------------------------------------ … … 4310 4314 list_str=get(handles.list_object_2,'String'); 4311 4315 IndexObj=get(handles.list_object_2,'Value'); 4312 if ischar(list_str) || isempty(list_str{IndexObj})% || strcmp(list_str{IndexObj},'...') 4316 %IndexObj(2)=get(handles.list_object_2,'Value')-1; 4317 % if no projection object is selected, close view_field 4318 if ischar(list_str) || isempty(list_str{IndexObj}) 4313 4319 hview_field=findobj(allchild(0),'Tag','view_field'); 4314 4320 if ~isempty(hview_field) … … 4320 4326 end 4321 4327 else 4322 update_object(handles,IndexObj,2,list_str{IndexObj}) 4328 if isequal(get(handles.uvmat,'SelectionType'),'alt') 4329 option=4;%will show object properties on the GUI set_object 4330 else 4331 option=2; % just update the projection 4332 end 4333 update_object(handles,IndexObj,option,list_str{IndexObj}) 4323 4334 end 4324 4335 … … 4327 4338 %------------------------------------------------------------------------ 4328 4339 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 4329 if numel(UvData.Object)< IndexObj;4340 if numel(UvData.Object)<max(IndexObj); 4330 4341 return 4331 4342 end 4343 % if option==1 ||option==3 4332 4344 ObjectData=UvData.Object{IndexObj}; 4345 % else 4346 % ObjectData=UvData.Object{IndexObj}; 4347 % end 4333 4348 ObjectData.Name=ObjectName; 4334 4349 if isequal(get(handles.edit_object,'Value'),1) … … 4352 4367 end 4353 4368 end 4354 hset_object=set_object(ObjectData,[],ZBounds);% call the set_object interface, 4355 4356 % %project the current field on the object and plot it 4357 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 4358 if option==1%length(UvData.Object)>= IndexObj && isfield(UvData.Object{IndexObj},'plotaxes')&& ishandle(UvData.Object{IndexObj}.plotaxes) 4369 4370 if option==3 ||option==4% right mouse selection, show the GUI set_object: 4371 hset_object=set_object(ObjectData,[],ZBounds); 4372 end 4373 4374 %project on the selected object and update the corresponding plot 4375 hview_field=findobj(allchild(0),'tag','view_field'); 4376 % PlotHandles=guidata(hview_field); 4377 if option==1 || option==3%length(UvData.Object)>= IndexObj && isfield(UvData.Object{IndexObj},'plotaxes')&& ishandle(UvData.Object{IndexObj}.plotaxes) 4359 4378 PlotHandles=handles; 4360 4379 else 4361 hview_field=findobj(allchild(0),'tag','view_field');4362 4380 if isempty(hview_field) 4363 4381 hview_field=view_field; … … 4365 4383 PlotHandles=guidata(hview_field); 4366 4384 end 4367 %plot_field(ProjData,PlotHandles.axes3,PlotHandles); 4368 set(handles.uvmat,'UserData',UvData) 4369 hother=findobj('Tag','proj_object');%find all the proj objects 4385 if option==1 ||option==2% lefet mouse selection, peroject the field: 4386 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 4387 plot_field(ProjData,PlotHandles.axes3,read_plot_param(PlotHandles));%read plotting parameters on the uvmat interfacPlotHandles); 4388 UvData.Object=update_obj(UvData,IndexObj,[]); 4389 set(handles.uvmat,'UserData',UvData) 4390 end 4391 4392 4393 % set(handles.uvmat,'UserData',UvData) 4394 hother=[findobj(handles.axes3,'Tag','proj_object') ;findobj(PlotHandles.axes3,'Tag','proj_object')] ;%find all the proj objects 4395 hother=[hother ;findobj(handles.axes3,'Tag','DeformPoint'); findobj(PlotHandles.axes3,'Tag','DeformPoint')]; 4370 4396 for iobj=1:length(hother) 4371 4397 if isequal(get(hother(iobj),'Type'),'rectangle')||isequal(get(hother(iobj),'Type'),'patch') … … 4383 4409 set(hother(iobj),'Selected','off') 4384 4410 end 4385 hother=findobj('Tag','DeformPoint');4386 set(hother,'Color','b');4387 set(hother,'Selected','off')4388 4411 if isfield(ObjectData,'DisplayHandle_uvmat') 4389 4412 if ishandle(ObjectData.DisplayHandle_uvmat) … … 4417 4440 end 4418 4441 end 4419 % end 4420 end 4421 % pause(0.1) 4422 figure(hset_object)%put set_object in front 4442 end 4423 4443 4424 4444 %------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.