Changeset 674 for trunk/src/geometry_calib.m
- Timestamp:
- Aug 23, 2013, 2:56:17 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r672 r674 97 97 ScreenSize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right 98 98 Left=ScreenSize(3)- 460; %right edge close to the right, with margin=40 (GUI width=420 px) 99 if ScreenSize(4)> 88099 if ScreenSize(4)>920 100 100 Height=840;%default height of the GUI 101 101 Bottom=ScreenSize(4)-Height-40; %put fig at top right 102 102 else 103 Height=ScreenSize(4)- 40;104 Bottom= 0; % GUI lies o the screen bottom105 end 106 set(handles.calib_type,'Position',[1 Height- 30 194 30])% rank 1107 set(handles.APPLY,'Position',[197 Height- 30 110 30])% rank 1108 set(handles.REPLICATE,'Position',[309 Height- 30 110 30])% rank 1109 set(handles.Intrinsic,'Position',[1 Height- 30-2-92 418 92])% rank 2110 set(handles.Extrinsic,'Position',[1 Height- 30-4-92-75 418 75])% rank 3111 set(handles.PointLists,'Position',[1 Height- 30-6-92-75-117 418 117]) % rank 4112 set(handles.CheckEnableMouse,'Position',[3 Height- 30-8-92-75-117-30 203 30])% rank 5113 set(handles.PLOT,'Position',[3 Height-3 84 120 30])% rank 6114 set(handles.Copy,'Position',[151 Height-3 84 120 30])% rank 6115 set(handles.CLEAR_PTS,'Position',[297 Height-3 84 120 30])% rank 6116 set(handles.phys_title,'Position',[38 Height-4 16 125 20])% rank 7117 set(handles.CoordUnit,'Position',[151 Height-4 16 120 30])% rank 7118 set(handles.px_title,'Position',[272 Height-4 16 125 20])% rank 7119 set(handles.ListCoord,'Position',[1 20 418 Height-4 36])% rank 8103 Height=ScreenSize(4)-80; 104 Bottom=40; % GUI lies o the screen bottom (with margin =40) 105 end 106 set(handles.calib_type,'Position',[1 Height-40 194 30])% rank 1 107 set(handles.APPLY,'Position',[197 Height-40 110 30])% rank 1 108 set(handles.REPLICATE,'Position',[309 Height-40 110 30])% rank 1 109 set(handles.Intrinsic,'Position',[1 Height-40-2-92 418 92])% rank 2 110 set(handles.Extrinsic,'Position',[1 Height-40-4-92-75 418 75])% rank 3 111 set(handles.PointLists,'Position',[1 Height-40-6-92-75-117 418 117]) % rank 4 112 set(handles.CheckEnableMouse,'Position',[3 Height-40-8-92-75-117-30 203 30])% rank 5 113 set(handles.PLOT,'Position',[3 Height-394 120 30])% rank 6 114 set(handles.Copy,'Position',[151 Height-394 120 30])% rank 6 115 set(handles.CLEAR_PTS,'Position',[297 Height-394 120 30])% rank 6 116 set(handles.phys_title,'Position',[38 Height-426 125 20])% rank 7 117 set(handles.CoordUnit,'Position',[151 Height-426 120 30])% rank 7 118 set(handles.px_title,'Position',[272 Height-426 125 20])% rank 7 119 set(handles.ListCoord,'Position',[1 20 418 Height-446])% rank 8 120 120 set(handles.geometry_calib,'Position',[Left Bottom 420 Height]) 121 121 … … 1149 1149 set(handles.ListCoordFiles,'string',listfile); 1150 1150 1151 %------------------------------------------------------------------------1152 % --- 'key_press_fcn:' function activated when a key is pressed on the keyboard1153 function key_press_fcn(hObject,eventdata,handles)1154 %------------------------------------------------------------------------1155 xx=double(get(handles.geometry_calib,'CurrentCharacter')); %get the keyboard character1156 %if ismember(xx,[8 127])%backspace or delete1157 if ismember(xx,[30 31 8 127])1158 Coord=get(handles.ListCoord,'Data');1159 ind=find(Coord(:,6));1160 Coord(:,6)=zeros(size(Coord,1),1);% desactivate the current line mark1161 switch xx1162 case 30 % arrow upward1163 Coord(ind-1,6)=1;1164 case 31% arrow downward1165 Coord(ind+1,6)=1;1166 case {8 127}% remove line1167 Coord(ind,:)=[];1168 end1169 set(handles.ListCoord,'Data',Coord);1170 PLOT_Callback(hObject,eventdata,handles)1171 end1172 1173 1174 1151 1175 1152 %------------------------------------------------------------------------ … … 1240 1217 set(handles.Psi,'String',num2str(GeometryCalib.omc(3),4)) 1241 1218 end 1219 if isfield(GeometryCalib,'SourceCalib') 1242 1220 calib=GeometryCalib.SourceCalib.PointCoord; 1243 1221 Coord=[calib zeros(size(calib,1),1)]; 1244 1222 set(handles.ListCoord,'Data',Coord) 1223 end 1245 1224 % CoordCell=reshape(CoordCell,[],5); 1246 1225 % Tabchar=cell2tab(CoordCell,' | ');%transform cells into table ready for display … … 1284 1263 % --- Executes when user attempts to close geometry_calib. 1285 1264 function geometry_calib_CloseRequestFcn(hObject, eventdata, handles) 1286 % hObject handle to geometry_calib (see GCBO) 1287 % eventdata reserved - to be defined in a future version of MATLAB 1288 % handles structure with handles and user data (see GUIDATA) 1289 1290 % Hint: delete(hObject) closes the figure 1291 delete(hObject); 1265 1266 delete(hObject); % closes the figure 1292 1267 1293 1268 %------------------------------------------------------------------------ … … 1331 1306 1332 1307 %------------------------------------------------------------------------ 1333 % --- Executes on button press in Copy .1308 % --- Executes on button press in Copy: display Coord on the Matlab work space 1334 1309 %------------------------------------------------------------------------ 1335 1310 function Copy_Callback(hObject, eventdata, handles) … … 1341 1316 commandwindow; %brings the Matlab command window to the front 1342 1317 1343 1318 %------------------------------------------------------------------------ 1344 1319 % --- Executes when selected cell(s) is changed in ListCoord. 1320 %------------------------------------------------------------------------ 1345 1321 function ListCoord_CellSelectionCallback(hObject, eventdata, handles) 1322 1346 1323 if ~isempty(eventdata.Indices) 1347 iline=eventdata.Indices(1);% selected line number 1348 Data=get(handles.ListCoord,'Data'); 1349 Data(:,6)=zeros(size(Data,1),1); 1350 Data(iline,6)=1;% mark the selected line 1351 set(handles.ListCoord,'Data',Data) 1352 update_calib_marker(Data(iline,:)) 1353 end 1354 1324 iline=eventdata.Indices(1);% selected line number 1325 Data=get(handles.ListCoord,'Data'); 1326 Data(:,6)=zeros(size(Data,1),1); 1327 Data(iline,6)=1;% mark the selected line 1328 set(handles.ListCoord,'Data',Data) 1329 update_calib_marker(Data(iline,:)) 1330 end 1331 1332 %------------------------------------------------------------------------ 1355 1333 % --- Executes when entered data in editable cell(s) in ListCoord. 1334 %------------------------------------------------------------------------ 1356 1335 function ListCoord_CellEditCallback(hObject, eventdata, handles) 1357 1336 … … 1366 1345 PLOT_Callback(hObject, eventdata, handles) 1367 1346 1347 %------------------------------------------------------------------------ 1348 % --- 'key_press_fcn:' function activated when a key is pressed on the keyboard 1349 %------------------------------------------------------------------------ 1350 function key_press_fcn(hObject,eventdata,handles) 1351 1352 xx=double(get(handles.geometry_calib,'CurrentCharacter')); %get the keyboard character 1353 %if ismember(xx,[8 127])%backspace or delete 1354 if ismember(xx,[30 31 8 127])% arrow upward, downward, backspace or delete 1355 Coord=get(handles.ListCoord,'Data'); 1356 ind=find(Coord(:,6)); 1357 Coord(:,6)=zeros(size(Coord,1),1);% desactivate the current line mark 1358 switch xx 1359 case 30 % arrow upward 1360 Coord(ind-1,6)=1; 1361 case 31% arrow downward 1362 Coord(ind+1,6)=1; 1363 case {8 127}% remove line 1364 Coord(ind,:)=[]; 1365 end 1366 set(handles.ListCoord,'Data',Coord); 1367 PLOT_Callback(hObject,eventdata,handles) 1368 end 1369 1370 1371 1372 %------------------------------------------------------------------------ 1373 % --- update the plot of calibration points 1374 %------------------------------------------------------------------------ 1368 1375 function update_calib_marker(Coord) 1369 1376 %% update the plot on uvmat
Note: See TracChangeset
for help on using the changeset viewer.