/usr/share/octave/site/m/vlfeat/toolbox/plotop/vl_clicksegment.m is in octave-vlfeat 0.9.17+dfsg0-6+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | function [P1,P2] = vl_clicksegment
% VL_CLICKSEGMENT Select a segment by clicking
% [P1,P2] = VL_CLICKSEGMENT() lets the user select a segment in the
% current figure and returns the starting and ending point P1 and P2.
%
% The user can abort the operation by pressing any key. In this case
% the function returns the empty matrix.
%
% See also: VL_CLICK(), VL_CLICKPOINT(), VL_HELP().
% Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).
% Click first segment
P1=vl_click ;
if isempty(P1)
P2=P1 ;
return ;
end
was_hold = ishold(gca) ;
hold on ;
h=plot(P1(1),P1(2),'rx') ;
% Click second segment
P2=vl_click ;
if isempty(P2)
P1=P2 ;
end
delete(h) ;
if ~was_hold, hold off ; end
|