Changeset 1099 for trunk/src/plot_object.m
- Timestamp:
- Apr 14, 2021, 4:02:22 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_object.m
r1098 r1099 245 245 end 246 246 end 247 if ismember(ObjectData.Type,{'line','polyline','polygon'}) 247 if ismember(ObjectData.Type,{'line','polyline','polygon'})&&... 248 ismember(ObjectData.ProjMode,{'projection','interp_lin','interp_tps'}) 248 249 if length(xline)<2 249 250 theta=0; … … 357 358 end 358 359 elseif length(PlotData.SubObject)==2 359 set(PlotData.SubObject(1),'XData',xinf); 360 set(PlotData.SubObject(1),'YData',yinf); 361 set(PlotData.SubObject(2),'XData',xsup); 362 set(PlotData.SubObject(2),'YData',ysup); 360 if ismember(ObjectData.ProjMode,{'projection','interp_lin','interp_tps'}) 361 set(PlotData.SubObject(1),'XData',xinf); 362 set(PlotData.SubObject(1),'YData',yinf); 363 set(PlotData.SubObject(2),'XData',xsup); 364 set(PlotData.SubObject(2),'YData',ysup); 365 end 363 366 elseif length(PlotData.SubObject)==1 364 set(PlotData.SubObject(1),'XData',xsup); 365 set(PlotData.SubObject(1),'YData',ysup); 367 if ismember(ObjectData.ProjMode,{'projection','interp_lin','interp_tps'}) 368 set(PlotData.SubObject(1),'XData',xsup); 369 set(PlotData.SubObject(1),'YData',ysup); 370 end 371 end 372 if strcmp(ObjectData.ProjMode,'none') 373 delete(PlotData.SubObject) 374 PlotData=rmfield(PlotData,'SubObject'); 366 375 end 367 376 end … … 398 407 end 399 408 if test_patch 409 createimage=1; 400 410 if isfield(PlotData,'SubObject') 401 for iobj=1:length(PlotData.SubObject) 402 if ~ishandle(PlotData.SubObject(iobj)) 403 hold on 404 hhh=image([xlim(1)+dx/2 xlim(2)-dx/2],[ylim(1)+dy/2 ylim(2)-dy/2],imflag,'Tag','proj_object','HitTest','off'); 405 set(hhh,'AlphaData',(flag)*0.2)% set partial transparency to the filling color 406 PlotData.SubObject(iobj)=hhh; 407 else 411 for iobj=1:length(PlotData.SubObject) 408 412 objtype=get(PlotData.SubObject(iobj),'Type'); 409 413 if isequal(objtype,'image') … … 411 415 set(PlotData.SubObject(iobj),'XData',[xlim(1)+dx/2 xlim(2)-dx/2]) 412 416 set(PlotData.SubObject(iobj),'YData',[ylim(1)+dy/2 ylim(2)-dy/2]) 413 end 414 end 415 end 417 createimage=0; 418 end 419 end 420 end 421 if createimage 422 hold on 423 hhh=image([xlim(1)+dx/2 xlim(2)-dx/2],[ylim(1)+dy/2 ylim(2)-dy/2],imflag,'Tag','proj_object','HitTest','off'); 424 set(hhh,'AlphaData',(flag)*0.2)% set partial transparency to the filling color 425 PlotData.SubObject(1)=hhh; 416 426 end 417 427 else% no patch image requested, erase existing ones … … 420 430 if ishandle(PlotData.SubObject(iobj)) && strcmp(get(PlotData.SubObject(iobj),'Type'),'image') 421 431 delete(PlotData.SubObject(iobj)) 432 PlotData=rmfield(PlotData,SubObject(iobj)); 422 433 end 423 434 end … … 462 473 case {'line','polyline','polygon'} 463 474 hh=line(xline,yline,'Color',col); 475 if ismember(ObjectData.ProjMode,{'projection','interp_lin','interp_tps'}) 464 476 PlotData.SubObject(1)=line(xinf,yinf,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object');%draw sub-lines 465 477 PlotData.SubObject(2)=line(xsup,ysup,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object'); 478 end 466 479 for ipt=1:sizcoord(1) 467 480 PlotData.DeformPoint(ipt)=line(ObjectData.Coord(ipt,1),ObjectData.Coord(ipt,2),'Color',... … … 496 509 end 497 510 end 511 %put the deformpoints to the front 512 listc=get(gca,'children'); 513 checkdeform=strcmp(get(listc,'tag'),'DeformPoint'); 514 [nn,Index]=sort(checkdeform,'descend'); 515 set(gca,'children',listc(Index)) 498 516 set(hh,'UserData',PlotData)
Note: See TracChangeset
for help on using the changeset viewer.