source: issm/trunk/src/m/exp/manipulation/addcontour.m@ 13975

Last change on this file since 13975 was 13975, checked in by Mathieu Morlighem, 12 years ago

merged trunk-jpl and trunk for revision 13974

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1function [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot,root,options)
2%ADDCONTOUR - add a closed contour
3%
4% this script is used by exptool as an elementary operation
5% on an ARGUS profile
6%
7% Usage:
8% [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot,root,options)
9
10 title('click to add a point to the new profile, RETURN to exit','FontSize',14)
11 hold on
12
13 loop=1;
14 x=[];
15 y=[];
16
17 while loop
18
19 [xi,yi] = ginput(1);
20
21 if ~isempty(xi)
22 x(end+1,1)=xi;
23 y(end+1,1)=yi;
24
25 %plot everything
26 undoplots(prevplot);
27 plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
28 'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
29 plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
30
31 else
32
33 %check that the profile is not empty
34 if ~isempty(x)
35 x(end+1)=x(1);
36 y(end+1)=y(1);
37 A(end+1).x=x;
38 A(end).y=y;
39 A(end).name=root;
40 A(end).density=1;
41 numprofiles=numprofiles+1;
42 numpoints=numpoints+length(x);
43 closed(end+1)=1;
44 end
45
46 %get out
47 loop=0;
48 end
49 end
50end
Note: See TracBrowser for help on using the repository browser.