source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vlutil/toolbox/clicksegment.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 603 bytes
Line 
1function [P1,P2] = clicksegment
2% CLICKSEGMENT  Select a segment by clicking
3%  [P1,P2] = CLICKSEGMENT lets the user select a segment in the
4%  current figure and returns the starting and ending point P1 and P2.
5%
6%  The user can abort the operation by pressing any key. In this
7%  case the function returns the empty matrix.
8%
9%  See also CLICK, CLICKPOINT.
10
11
12% Click first segment
13P1=click ;
14if isempty(P1)
15  P2=P1 ;
16  return ;
17end
18
19was_hold = ishold(gca) ;
20hold on ;
21h=plot(P1(1),P1(2),'rx') ;
22
23% Click second segment
24P2=click ;
25if isempty(P2)
26  P1=P2 ;
27end
28delete(h) ;
29if ~was_hold, hold off ; end
30
Note: See TracBrowser for help on using the repository browser.