Changeset 342 for trunk/src/uvmat.m
- Timestamp:
- Dec 20, 2011, 5:14:43 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r341 r342 1986 1986 1987 1987 %% determine the input file type 1988 if (test_1 && isfield(UvData,'MovieObject_1'))||(~test_1 && isfield(UvData,'MovieObject'))1988 if (test_1 && isfield(UvData,'MovieObject_1'))||(~test_1 && ~isempty(UvData.MovieObject)) 1989 1989 FileType='movie'; 1990 1990 elseif isequal(lower(Ext),'.avi') … … 4249 4249 list_str=get(handles.ListObject,'String'); 4250 4250 IndexObj_old=get(handles.ListObject,'UserData');%retrieve previous selection 4251 IndexObj=get(handles.ListObject,'Value'); 4251 IndexObj=get(handles.ListObject,'Value');%present object selection 4252 4253 %% we select two objects or more at once (using the Ctrl key), keep only the last two items: the first is projected on uvmat, the second on view_field 4252 4254 if length(IndexObj)>2 4253 4255 IndexObj=[IndexObj(end-1) IndexObj(end)];%keeps only the last two selected items at most 4254 4256 end 4255 if length(IndexObj)==1 4256 if length(IndexObj_old)>=2 && isequal(IndexObj_old(1),IndexObj) 4257 IndexObj=IndexObj_old(2); 4258 elseif length(IndexObj_old)>=2 && isequal(IndexObj_old(2),IndexObj) 4259 IndexObj=IndexObj_old(1); 4260 else 4261 IndexObj=[IndexObj_old(1) IndexObj]; 4262 end 4263 end 4264 set(handles.ListObject,'Value',IndexObj); %keeps only the two first selected objects 4265 set(handles.ListObject,'UserData',IndexObj) 4266 %desactivate the edit object mode 4267 set(handles.edit_object,'Value',0) 4257 4258 %% we select one object 4259 if length(IndexObj)==1% 4260 if length(IndexObj_old)>=2 && isequal(IndexObj_old(1),IndexObj) % we select the first previously selected object-> 4261 IndexObj=[1 IndexObj_old(2)];% it desactivates this object and selects the first object for uvmat 4262 elseif length(IndexObj_old)>=2 && isequal(IndexObj_old(2),IndexObj) % we select the second previously selected object-> 4263 IndexObj=IndexObj_old(1);% it desactivates this object and keeps only the first previously selected object (uvmat) 4264 else % 4265 IndexObj=[IndexObj_old(1) IndexObj];% activates a second object while keeping the first previously selected one 4266 end 4267 end 4268 set(handles.ListObject,'Value',IndexObj); % marks the selected objects in the list 4269 set(handles.ListObject,'UserData',IndexObj)% keep the current object selection in memory for next time 4270 4271 %% update the object representation 4272 set(handles.edit_object,'Value',0) % desactivate the edit object mode 4268 4273 edit_object_Callback(hObject, eventdata, handles) 4269 4274 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface … … 4272 4277 return 4273 4278 end 4274 UvData.Object=update_obj(UvData,IndexObj(1),IndexObj(2)); 4275 set(handles.uvmat,'UserData',UvData) 4276 4277 %project on the selected object and update the corresponding plot 4279 if numel(IndexObj)>=2 4280 UvData.Object=update_obj(UvData,IndexObj(1),IndexObj(2));%update the current object graphic representation 4281 set(handles.uvmat,'UserData',UvData) 4282 end 4283 4284 %% project on the selected object and update the corresponding plot 4285 % hview_field=findobj(allchild(0),'tag','view_field'); 4286 % ViewObjectAxes=[];%default 4287 if ~isequal(IndexObj(1),IndexObj_old(1)) 4288 update_object(handles,IndexObj(1),handles.axes3,list_str{IndexObj(1)})%plot the projection in uvmat 4289 end 4278 4290 hview_field=findobj(allchild(0),'tag','view_field'); 4279 ViewObjectAxes=[];%default4280 if ~isequal(IndexObj(1),IndexObj_old(1))4281 update_object(handles,IndexObj(1),handles.axes3,list_str{IndexObj(1)})%plot the projection in uvmat4282 end4283 4291 if length(IndexObj)==2 && (length(IndexObj_old)==1 || ~isequal(IndexObj(2),IndexObj_old(2))) 4284 hview_field=findobj(allchild(0),'tag','view_field');4285 4292 if isempty(hview_field) 4286 4293 hview_field=view_field; … … 4288 4295 PlotHandles=guidata(hview_field); 4289 4296 update_object(handles,IndexObj(2),PlotHandles.axes3,list_str{IndexObj(2)})%plot the projection in view_field 4290 end 4291 update_object_color(handles.axes3,PlotHandles.axes3,UvData.Object{IndexObj(2)}.DisplayHandle_uvmat) 4297 update_object_color(handles.axes3,PlotHandles.axes3,UvData.Object{IndexObj(2)}.DisplayHandle_uvmat) 4298 else 4299 if ~isempty(hview_field) 4300 delete(hview_field) 4301 end 4302 hset_object=findobj(allchild(0),'tag','set_object'); 4303 if ~isempty(hset_object) 4304 delete(hset_object) 4305 end 4306 update_object_color(handles.axes3,handles.axes3,[]) 4307 end 4308 4309 %% update the color of the gfraphic object representation: the selected object in magenta, others in blue 4310 % update_object_color(handles.axes3,PlotHandles.axes3,UvData.Object{IndexObj(2)}.DisplayHandle_uvmat) 4292 4311 4293 4312 %------------------------------------------------------------------------ … … 4308 4327 if ~isempty(hset_object) 4309 4328 delete(hset_object)% delete existing version of set_object 4329 end 4310 4330 hset_object=set_object(ObjectData,[],ZBounds); 4311 end4331 % end 4312 4332 edit_test=get(handles.edit_object,'Value'); 4313 4333 if edit_test … … 4347 4367 set(hother(iobj),'Selected','off') 4348 4368 end 4369 if ~isempty(DisplayHandle) 4349 4370 linetype=get(DisplayHandle,'Type'); 4350 4371 if isequal(linetype,'line') … … 4372 4393 if isfield(SubObjectData,'DeformPoint') & ishandle(SubObjectData.DeformPoint) 4373 4394 set(SubObjectData.DeformPoint,'Color','m') 4395 end 4374 4396 end 4375 4397
Note: See TracChangeset
for help on using the changeset viewer.