Changeset 71 for trunk/src/mouse_down.m
- Timestamp:
- Mar 29, 2010, 6:34:55 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_down.m
r67 r71 25 25 26 26 MouseAction='none'; %default 27 huvmat=findobj(allchild(0),' Name','uvmat');%find the uvmat interface handle which controls theoption of mouse action27 huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle which controls theoption of mouse action 28 28 if isempty(huvmat) 29 29 return … … 49 49 %edit an existing point or line if found 50 50 hcurrentobject=gco;% current object handle (selected by the mouse) 51 hcurrentfig= gcbo;% current figure handle51 hcurrentfig=hObject;% current figure handle 52 52 fig_tag=get(hcurrentfig,'Tag'); 53 53 tag_obj=get(gco,'Tag'); … … 105 105 end 106 106 107 % zoom has first priority 107 108 if testzoom %&& ~test_create && ~test_edit && ~test_edit_vect && exist('xy','var') 108 109 AxeData.Drawing='zoom'; %initiate drawing mode 109 110 AxeData.CurrentObject=[];%unselect objects 111 set(haxes,'UserData',AxeData); 110 112 return 111 113 end 112 114 if isempty(huvmat) 115 return 116 end 117 118 %ruler has second priority 119 if test_ruler 120 UvData.RulerCoord(1,1)=xy(1,1); 121 UvData.RulerCoord(1,2)=xy(1,2); 122 UvData.RulerHandle=line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','ruler'); 123 set(huvmat,'UserData',UvData) 124 AxeData.Drawing='ruler'; 125 set(haxes,'UserData',AxeData); 113 126 return 114 127 end … … 163 176 end 164 177 IndexObj=ObjectData.IndexObj; 165 set(hhuvmat.list_object_1,'Value',IndexObj); 166 set(hhuvmat.list_object_2,'Value',IndexObj); 178 %indicate on the list of the GUI uvmat which object has been selected 179 if strcmp(get(hcurrentfig,'tag'),'uvmat') %if the uvmat graph has been selected, object projection is on the other frame view_field 180 set(hhuvmat.list_object_2,'Value',IndexObj); 181 else 182 set(hhuvmat.list_object_1,'Value',IndexObj); 183 end 167 184 testdeform=0; 168 185 set(gcbo,'Pointer','circle'); … … 207 224 set(huvmat,'UserData',UvData) 208 225 list_str=get(hhuvmat.list_object_1,'String'); 209 list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Style]; 210 if ~isequal(list_str{end},'...') 211 list_str{end+1}='...'; 212 end 226 list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Style]; 213 227 set(hhuvmat.list_object_1,'String',list_str) 228 list_str{end+1}='...'; 214 229 set(hhuvmat.list_object_2,'String',list_str) 215 230 if strcmp(fig_tag,'view_field')%we are in view_field plot 216 set(hhuvmat.list_object_1,'Value',IndexObj) 231 set(hhuvmat.list_object_1,'Value',IndexObj)% the projection field will be plotted in uvmat frame 217 232 else%we are in uvmat plot 218 233 set(hhuvmat.list_object_2,'Value',IndexObj) … … 234 249 if ~(isequal(coord_value,1)||isequal(coord_value,3)); %active only with no transform or px (no phys) 235 250 set(hhuvmat.transform_fct,'Value',1) 251 uvmat('transform_fct_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat 236 252 set(hhuvmat.FixedLimits,'Value',0)% put FixedLimits option to 'off' 237 253 set(hhuvmat.FixedLimits,'BackgroundColor',[0.7 0.7 0.7]) 238 uvmat('run0_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat239 254 return 240 255 end 241 256 Coord=get(h_ListCoord,'String'); 242 data=read_geometry_calib(Coord) %transform char cell to numbers257 data=read_geometry_calib(Coord);%transform char cell to numbers 243 258 ind_range=10;%range of research around each existing point 244 259 test_newpoint=1; … … 255 270 val=get(h_ListCoord,'Value'); 256 271 if length(Coord)>=val 257 Coord(val+1:length(Coord)+1)=Coord(val:length(Coord)) % push the list forward beyond the current point272 Coord(val+1:length(Coord)+1)=Coord(val:length(Coord));% push the list forward beyond the current point 258 273 end 259 274 Coord{val}=strline; 260 275 set(h_ListCoord,'String',Coord) 261 set(h_ListCoord,'Value',val+1)276 % set(h_ListCoord,'Value',val+1) 262 277 data=read_geometry_calib(Coord);%transform char cell to numbers 263 278 XCoord=data.Coord(:,4); … … 274 289 hhh=findobj('Tag','calib_marker');%look for handle of point marker (circle) 275 290 if ~isempty(hhh) 276 set(hhh,'XData',xy(1,1)) 277 set(hhh,'YData',xy(1,2)) 291 set(hhh,'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range]) 278 292 else 279 line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','calib_marker','LineStyle','.','Marker','o','MarkerSize',20); 280 end 293 rectangle('Curvature',[1 1],... 294 'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range],'EdgeColor','m',... 295 'LineStyle','-','Tag','calib_marker'); 296 % line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','calib_marker','LineStyle','.','Marker','o','MarkerSize',ind_range); 297 end 298 AxeData.Drawing='calibration'; 281 299 end 282 300 end … … 296 314 end 297 315 298 %create ruler 299 if test_ruler 300 UvData.RulerCoord(1,1)=xy(1,1); 301 UvData.RulerCoord(1,2)=xy(1,2); 302 UvData.RulerHandle=line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','ruler'); 303 set(huvmat,'UserData',UvData) 304 end 316 305 317 set(haxes,'UserData',AxeData); 306 318
Note: See TracChangeset
for help on using the changeset viewer.