Changeset 33


Ignore:
Timestamp:
04/24/09 10:46:15 (16 years ago)
Author:
seroussi
Message:

initial input

Location:
issm/trunk/src/m/utils
Files:
20 added
14 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/utils/Exp/expmaster.m

    r1 r33  
    3333numpoints=0;
    3434closed=[];
    35 if nargin>1,
    36         isexist=1;
    37         for i=1:nargin-1
    38                 filename=varargin{i};
    39                 if ~exist(filename),
    40                         error(['expmaster error message:, ' filename ' does not exist. Exiting...']);
    41                 else
    42                         %read file
    43                         B=expread(filename,1);
    44                         %go through all profiles of B
    45                         for i=1:size(B,2)
    46                                 %plug profile in A
    47                                 if numprofiles
    48                                         A(numprofiles+1)=B(i);
    49                                 else
    50                                         A=B(i);
    51                                 end
    52                                 %update numprofiles and numpoints
    53                                 numpoints=numpoints+length(B(i).x);
    54                                 numprofiles=numprofiles+1;
    55                                 %figure out if the profile is closed or not
    56                                 if (B(i).x(1)==B(i).x(end) & B(i).y(1)==B(i).y(end))
    57                                         closed(numprofiles)=1;
    58                                 else
    59                                         closed(numprofiles)=0;
    60                                 end
     35for i=1:nargin-1
     36        filename=varargin{i};
     37        if ~exist(filename),
     38                error(['expmaster error message:, ' filename ' does not exist. Exiting...']);
     39        else
     40                %read file
     41                B=expread(filename,1);
     42                %go through all profiles of B
     43                for i=1:size(B,2)
     44                        %plug profile in A
     45                        if numprofiles
     46                                A(numprofiles+1)=B(i);
     47                        else
     48                                A=B(i);
    6149                        end
    62                 end
    63         end
    64 else
    65         isexist=0;
     50                        %update numprofiles and numpoints
     51                        numpoints=numpoints+length(B(i).x);
     52                        numprofiles=numprofiles+1;
     53                        %figure out if the profile is closed or not
     54                        if (B(i).x(1)==B(i).x(end) & B(i).y(1)==B(i).y(end))
     55                                closed(numprofiles)=1;
     56                        else
     57                                closed(numprofiles)=0;
     58                        end
     59                end
     60        end
    6661end
    6762
     
    6964[path root ext ver]=fileparts(newfile);
    7065
    71 %Figure out how nany plots have been done so far
    72 g=get(gca,'children');
    73 prevplot=length(g);
    74 prevplot2=prevplot;
     66%get current figure
     67set(gcf,'Renderer','zbuffer'); %fixes a bug on Mac OS X (not needed in future Matlab version
     68F=getframe(gca);
     69F=F.cdata;
     70%get current axis
     71xlim=get(gca,'Xlim');
     72ylim=get(gca,'Ylim');
     73%recreate x_m and y_m
     74x_m=linspace(xlim(1),xlim(2),size(F,2));
     75y_m=linspace(ylim(2),ylim(1),size(F,1)); %getframe reverse axis...
     76%plot the data in another figure
     77figure
     78imagesc(x_m,y_m,F); set(gca,'Ydir','normal');
    7579
    7680%plot existing profile if any
     81prevplot=1;
     82prevplot2=1;
    7783hold on
    7884if numprofiles
     
    94100while loop
    95101
    96         %is there a profile in A?
    97         if isexist
    98 
    99                 %Go through A and rule out the empty profiles
    100                 list=[];
    101                 for i=1:size(A,2);
    102                         if length(A(i).x)==0
    103                                 list(end+1)=i;
    104                                 numprofiles=numprofiles-1;
    105                         end
    106                 end
    107                 A(list)=[];
    108                 closed(list)=[];
    109 
    110                 %display menu
    111                 title('Main Menu','FontSize',14);
    112                 button=menu('Menu','add a profile',...  %1
    113                 'remove a profile',...                  %2
    114                 'modify the position of a point',...    %3
    115                 'add points inside a profile',...       %4
    116                 'add points at the end of a profile',...%5
    117                 'remove points',...                     %6
    118                 'remove several points',...             %7
    119                 'cut a segment',...                     %8
    120                 'cut a large area',...                  %9
    121                 'merge profiles',...                    %10
    122                 'close profile',...                     %11
    123                 'undo',...                              %12
    124                 'redo',...                              %13
    125                 'quit');                                %14
    126 
    127 
    128                 %UNDO??
    129                 if button==12;
    130                         if counter==1
    131                                 disp('Already at oldest change');
    132                         else
    133                                 counter=counter-1;
    134                                 A=backup{counter,1};
    135                                 numprofiles=backup{counter,2};
    136                                 numpoints=backup{counter,3};
    137                                 closed=backup{counter,4};
    138                         end
    139                 end
    140 
    141                 %REDO??
    142                 if button==13
    143                         if counter==size(backup,1)
    144                                 disp('Already at newest change');
    145                         else
    146                                 counter=counter+1;
    147                                 A=backup{counter,1};
    148                                 numprofiles=backup{counter,2};
    149                                 numpoints=backup{counter,3};
    150                                 closed=backup{counter,4};
    151                         end
    152                 end
    153 
    154                 switch button
     102        %Go through A and rule out the empty profiles
     103        list=[];
     104        for i=1:size(A,2);
     105                if length(A(i).x)==0
     106                        list(end+1)=i;
     107                        numprofiles=numprofiles-1;
     108                end
     109        end
     110        A(list)=[];
     111        closed(list)=[];
     112
     113        %display menu
     114        title('Main Menu','FontSize',14);
     115        button=menu('Menu','add a profile (open)',...%1
     116                'add a contour (closed)',...              %2
     117                'remove a profile',...                    %3
     118                'modify the position of a point',...      %4
     119                'add points inside a profile',...         %5
     120                'add points at the end of a profile',...  %6
     121                'remove points',...                       %7
     122                'remove several points',...               %8
     123                'cut a segment',...                       %9
     124                'cut a large area',...                    %10
     125                'merge profiles',...                      %11
     126                'close profile',...                       %12
     127                'undo',...                                %13
     128                'redo',...                                %14
     129                'quit');                                  %15
     130
     131
     132        %UNDO??
     133        if button==13;
     134                if counter==1
     135                        disp('Already at oldest change');
     136                else
     137                        counter=counter-1;
     138                        A=backup{counter,1};
     139                        numprofiles=backup{counter,2};
     140                        numpoints=backup{counter,3};
     141                        closed=backup{counter,4};
     142                end
     143        end
     144
     145        %REDO??
     146        if button==14
     147                if counter==size(backup,1)
     148                        disp('Already at newest change');
     149                else
     150                        counter=counter+1;
     151                        A=backup{counter,1};
     152                        numprofiles=backup{counter,2};
     153                        numpoints=backup{counter,3};
     154                        closed=backup{counter,4};
     155                end
     156        end
     157
     158        switch button
    155159
    156160                case 1
     
    165169                case 2
    166170
     171                        [A,numprofiles,numpoints,closed]=addcontour(A,numprofiles,numpoints,closed,prevplot2,root);
     172                        counter=counter+1;
     173                        backup{counter,1}=A;
     174                        backup{counter,2}=numprofiles;
     175                        backup{counter,3}=numpoints;
     176                        backup{counter,4}=closed;
     177
     178                case 3
     179
    167180                        [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot2,root);
    168181                        counter=counter+1;
     
    172185                        backup{counter,4}=closed;
    173186
    174                 case 3
     187                case 4
    175188
    176189                        [A,numprofiles,numpoints,closed]=modifyposition(A,numprofiles,numpoints,closed,prevplot,root);
     
    181194                        backup{counter,4}=closed;
    182195
    183                 case 4
     196                case 5
    184197
    185198                        [A,numprofiles,numpoints,closed]=addinsideprofile(A,numprofiles,numpoints,closed,prevplot,root);
     
    190203                        backup{counter,4}=closed;
    191204
    192                 case 5
     205                case 6
    193206
    194207                        [A,numprofiles,numpoints,closed]=addendprofile(A,numprofiles,numpoints,closed,prevplot2,root);
     
    199212                        backup{counter,4}=closed;
    200213
    201                 case 6
     214                case 7
    202215
    203216                        [A,numprofiles,numpoints,closed]=removepoints(A,numprofiles,numpoints,closed,prevplot,root);
     
    208221                        backup{counter,4}=closed;
    209222
    210                 case 7
     223                case 8
    211224
    212225                        [A,numprofiles,numpoints,closed]=removeseveralpoints(A,numprofiles,numpoints,closed,prevplot,root);
     
    217230                        backup{counter,4}=closed;
    218231
    219                 case 8
     232                case 9
    220233
    221234                        [A,numprofiles,numpoints,closed]=cutprofile(A,numprofiles,numpoints,closed,prevplot,root);
     
    226239                        backup{counter,4}=closed;
    227240
    228                 case 9
     241                case 10
    229242
    230243                        [A,numprofiles,numpoints,closed]=cutarea(A,numprofiles,numpoints,closed,prevplot,root);
     
    235248                        backup{counter,4}=closed;
    236249
    237                 case 10
     250                case 11
    238251
    239252                        [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root);
     
    245258
    246259
    247                 case 11
     260                case 12
    248261
    249262                        [A,numprofiles,numpoints,closed]=closeprofile(A,numprofiles,numpoints,closed,prevplot,root);
     
    254267                        backup{counter,4}=closed;
    255268
    256                 %QUIT
    257                 case 14
     269                        %QUIT
     270                case 15
    258271
    259272                        loop=0;
     
    263276                        %do nothing
    264277
    265                 end
    266 
    267     %no argus file has been given in input, go to addcontour directly
    268         else
    269                 [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot2,root);
    270                 counter=counter+1;
    271                 backup{counter,1}=A;
    272                 backup{counter,2}=numprofiles;
    273                 backup{counter,3}=numpoints;
    274                 backup{counter,4}=closed;
    275                 isexist=1;
    276          end
    277 
    278          %Now erase all that have been done and plot the new structure A as it is
    279          undoplots(prevplot);
     278        end
     279
     280        %Now erase all that have been done and plot the new structure A as it is
     281        undoplots(prevplot);
    280282        if numprofiles
     283                prevplot2=1;
    281284                for i=1:numprofiles
    282285                        plot(A(i).x,A(i).y,'-r','MarkerSize',10);
     
    289292
    290293%write contour using expwrite
    291 title('New file written, exiting','FontSize',14);
     294title('New file written, exiting...','FontSize',14);
    292295if isempty(A)
    293296        disp('Profile empty, no file written')
     
    295298        expwrite(A,newfile);
    296299end
     300
     301%close window
     302close;
  • issm/trunk/src/m/utils/Exp/ginputquick.m

    r1 r33  
    2121
    2222%   Copyright 1984-2005 The MathWorks, Inc.
    23 %   $Revision: 1.2 $  $Date: 2009/03/27 00:44:53 $
     23%   $Revision: 1.1 $  $Date: 2009/04/03 22:56:26 $
    2424
    2525out1 = []; out2 = []; out3 = []; y = [];
  • issm/trunk/src/m/utils/Exp/manipulation/addendprofile.m

    r1 r33  
    1010        %some checks
    1111        if numprofiles==0
    12                 disp('no profile present')
     12                disp('no profile present, exiting...')
    1313                return
    1414        end       
  • issm/trunk/src/m/utils/Exp/manipulation/addinsideprofile.m

    r1 r33  
    1010        %some checks
    1111        if numprofiles==0
    12                 disp('no profile present')
     12                disp('no profile present, exiting...')
    1313                return
    1414        end       
    1515        if numpoints<2
    16                 disp('at least two points are required')
     16                disp('at least two points are required, exiting...')
    1717                return
    1818        end       
     
    3939                        %check that at least one segment exists
    4040                        if indsel==0
    41                                 disp('at least two points in one profile are required')
     41                                disp('at least two points in one profile are required, exiting...')
    4242                                return
    4343                        end
  • issm/trunk/src/m/utils/Exp/manipulation/closeprofile.m

    r1 r33  
    2222        while loop
    2323
     24                %some checks,
     25                if numprofiles==0   
     26                        disp('no profile present, exiting...')
     27                        return           
     28                end 
     29                if ~any(~closed),
     30                        disp('All the profiles are closed, exiting...')
     31                        return
     32                end
     33
    2434                [xi,yi] = ginput(1);
    2535                                         
     
    3040
    3141                        if ismember(profsel,selection)
    32                                 %profile was in selection, close it
     42                                %profile was in selection, remove it from the selection
    3343                                selection(find(selection==profsel))=[];
    3444                                %back to red
    3545                                plot(A(profsel).x,A(profsel).y,'-r','MarkerSize',10);
     46                        elseif closed(profsel),
     47                                %profile already closed, do nothing
     48                                disp('selected profile aready closed, make another selection'),
    3649                        else
    3750                                %add the profile to the list to be closed
     
    4356                        %close the profiles
    4457                        for i=1:length(selection),
    45                                 if (A(selection(i)).x(end)~=A(selection(i)).x(1) | A(selection(i)).y(end)~=A(selection(i)).y(1))
    46                                         A(selection(i)).x(end+1)=A(selection(i)).x(1);
    47                                         A(selection(i)).y(end+1)=A(selection(i)).y(1);
    48                                         numpoints=numpoints+1;
    49                                         closed(selection(i))=1;
    50                                 else
    51                                         disp('one profile is already closed')
    52                                 end
     58                                A(selection(i)).x(end+1)=A(selection(i)).x(1);
     59                                A(selection(i)).y(end+1)=A(selection(i)).y(1);
     60                                numpoints=numpoints+1;
     61                                closed(selection(i))=1;
    5362                        end
    5463                        loop=0;
  • issm/trunk/src/m/utils/Exp/manipulation/cutarea.m

    r1 r33  
    2626                %some checks
    2727                if numprofiles==0
    28                         disp('no profile present')
     28                        disp('no profile present, exiting...')
    2929                        return
    3030                end       
    3131                if numpoints<3
    32                         disp('at least two points are needed')
     32                        disp('at least two points are needed, exiting...')
    3333                        return
    3434                end       
     
    131131                                                        end
    132132                                                end
     133
    133134                                                %plot new profile
    134135                                                undoplots(prevplot);
     
    137138                                                end
    138139                                                points=[];
     140
    139141                                        end
    140142                                end
  • issm/trunk/src/m/utils/Exp/manipulation/cutprofile.m

    r1 r33  
    1010        %some checks
    1111        if numprofiles==0
    12                 disp('no profile present')
     12                disp('no profile present, exiting...')
    1313                return
    1414        end       
  • issm/trunk/src/m/utils/Exp/manipulation/mergeprofiles.m

    r1 r33  
    11function [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root);
    2 %MERGEPROFILES - morge profiles
     2%MERGEPROFILES - merge profiles
    33%
    44%   this script is used by expmaster as an elementary operation
     
    99%      [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root)
    1010
    11         hold on
    12         loop=1;
     11hold on
     12loop=1;
    1313
    14         %Take all the tips coordinates
    15         tips=zeros(2*numprofiles,4);
    16         for i=1:numprofiles
     14%Take all the tips coordinates of open profiles
     15counter=1; tips=[];
     16for i=1:numprofiles
     17        if ~closed(i),
    1718                %x and y coord, profile number, 1 if beginning, 2 and if end
    18                 tips(2*i-1,:)=[A(i).x(1)   A(i).y(1)   i  1];
    19                 tips(2*i,:) = [A(i).x(end) A(i).y(end) i  2];
     19                if length(A(i).x)==1,
     20                        tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
     21                        counter=counter+1;
     22                else
     23                        tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
     24                        tips(counter+1,:) = [A(i).x(end) A(i).y(end) i  2];
     25                        counter=counter+2;
     26                end
    2027        end
    21         %remove the closed profiles fron the list
    22         tips([2*find(closed)-1;2*find(closed)],:)=[];
     28end
    2329
     30if size(tips,1)<2
     31        disp('at least one unclosed profile is required')
     32        return
     33end
     34
     35%plot the tips
     36plot(tips(:,1),tips(:,2),'rs','Markersize',10);
     37firsttip=1;
     38
     39%loop (at least 2 clicks needed)
     40while loop
     41
     42        %some checks
    2443        if size(tips,1)<2
    2544                disp('at least one unclosed profiles are required')
     
    2746        end
    2847
    29         %plot the tips
    30         plot(tips(:,1),tips(:,2),'rs','Markersize',10);
    31         firsttip=1;
     48        %select a point
     49        if firsttip
     50                title('click on the first tip, RETURN to exit','FontSize',14)
     51        else
     52                title('click on the second tip, RETURN to exit','FontSize',14)
     53        end
    3254
    33         %loop (at least 2 clicks needed)
    34         while loop
    35        
    36                 %some checks
    37                 if size(tips,1)<2
    38                         disp('at least one unclosed profiles are required')
    39                         return
    40                 end
     55        [xi,yi] = ginput(1);
    4156
    42                 %select a point
     57        if ~isempty(xi)
     58
    4359                if firsttip
    44                         title('click on the first tip, RETURN to exit','FontSize',14)
     60                        %find the selected tip
     61                        distance=(xi-tips(:,1)).^2+(yi-tips(:,2)).^2;
     62                        [dmin tip1]=min(distance);
     63                        numprofile1=tips(tip1,3);
     64                        firsttip=0;
     65
     66                        %remove tip1 from tips list
     67                        newtips=tips;
     68                        newtips(tip1,:)=[];
     69
     70                        %plot selected tip
     71                        plot(tips(tip1,1),tips(tip1,2),'bs','MarkerSize',10);
     72                        plot(A(numprofile1).x,A(numprofile1).y,'-g');
     73
     74                %second selection
    4575                else
    46                         title('click on the second tip, RETURN to exit','FontSize',14)
    47                 end
     76                        distance=(xi-newtips(:,1)).^2+(yi-newtips(:,2)).^2;
     77                        [dmin tip2]=min(distance);
     78                        numprofile2=newtips(tip2,3);
    4879
    49                 [xi,yi] = ginput(1);
     80                        if numprofile1==numprofile2
     81                                %close the profile
     82                                A(numprofile1).x(end+1)=A(numprofile1).x(1);
     83                                A(numprofile1).y(end+1)=A(numprofile1).y(1);
     84                                numpoints=numpoints+1;
     85                                closed(numprofile1)=1;
    5086
    51                 if ~isempty(xi)
     87                        else
    5288
    53                         if firsttip
    54                                 %find the selected tip
    55                                 distance=(xi-tips(:,1)).^2+(yi-tips(:,2)).^2;
    56                                 [dmin tip1]=min(distance);
    57                                 numprofile1=tips(tip1,3);
    58                                 firsttip=0;
     89                                if tips(tip1,4)==1 & newtips(tip2,4)==1,
     90                                        A(numprofile1).x=[flipud(A(numprofile2).x); A(numprofile1).x];
     91                                        A(numprofile1).y=[flipud(A(numprofile2).y); A(numprofile1).y];
     92                                        numprofiles=numprofiles-1;
    5993
    60                                 %remove tip1 grom tips list
    61                                 newtips=tips;
    62                                 newtips(tip1,:)=[];
     94                                elseif tips(tip1,4)==1 & newtips(tip2,4)==2,
     95                                        A(numprofile1).x=[A(numprofile2).x; A(numprofile1).x];
     96                                        A(numprofile1).y=[A(numprofile2).y; A(numprofile1).y];
     97                                        numprofiles=numprofiles-1;
    6398
    64                                 %plot selected tip
    65                                 plot(tips(tip1,1),tips(tip1,2),'bs','MarkerSize',10);
    66                                 plot(A(numprofile1).x,A(numprofile1).y,'-g');
     99                                elseif tips(tip1,4)==2 & newtips(tip2,4)==1,
     100                                        A(numprofile1).x=[A(numprofile1).x; A(numprofile2).x];
     101                                        A(numprofile1).y=[A(numprofile1).y; A(numprofile2).y];
     102                                        numprofiles=numprofiles-1;
    67103
    68                         %second selection
    69                         else
    70                                 distance=(xi-newtips(:,1)).^2+(yi-newtips(:,2)).^2;
    71                                 [dmin tip2]=min(distance);
    72                                 numprofile2=newtips(tip2,3);
    73 
    74                                 %reverse if necessary
    75                                 if numprofile2<numprofile1
    76                                         fakeprofile=numprofile2;
    77                                         numprofile2=numprofile1;
    78                                         numprofile1=fakeprofile;
     104                                elseif tips(tip1,4)==2 & newtips(tip2,4)==2,
     105                                        A(numprofile1).x=[A(numprofile1).x; flipud(A(numprofile2).x)];
     106                                        A(numprofile1).y=[A(numprofile1).y; flipud(A(numprofile2).y)];
     107                                        numprofiles=numprofiles-1;
    79108                                end
    80109
    81                                 if numprofile1==numprofile2
    82                                         %close the profile
    83                                         A(numprofile1).x(end+1)=A(numprofile1).x(1);
    84                                         A(numprofile1).y(end+1)=A(numprofile1).y(1);
    85                                         numpoints=numpoints+1;
    86                                         closed(numprofile1)=1;
     110                                %delete profile2
     111                                A(numprofile2)=[];
     112                                closed(numprofile2)=[];
    87113
    88                                 else
     114                        end
    89115
    90                                         if tips(tip1,4)==1 & newtips(tip2,4)==1,
    91                                                 A(numprofile1).x=[flipud(A(numprofile2).x); A(numprofile1).x];
    92                                                 A(numprofile1).y=[flipud(A(numprofile2).y); A(numprofile1).y];
    93                                                 numprofiles=numprofiles-1;
    94                                                 closed(numprofile1)=1;
     116                        %update tips
     117                        counter=1; tips=[];
     118                        for i=1:numprofiles
     119                                if ~closed(i),
     120                                        %x and y coord, profile number, 1 if beginning, 2 and if end
     121                                        if length(A(i).x)==1,
     122                                                tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
     123                                                counter=counter+1;
     124                                        else
     125                                                tips(counter,:)=[A(i).x(1)   A(i).y(1)   i  1];
     126                                                tips(counter+1,:) = [A(i).x(end) A(i).y(end) i  2];
     127                                                counter=counter+2;
     128                                        end
     129                                end
     130                        end
    95131
    96                                         elseif tips(tip1,4)==1 & newtips(tip2,4)==2,
    97                                                 A(numprofile1).x=[A(numprofile2).x; A(numprofile1).x];
    98                                                 A(numprofile1).y=[A(numprofile2).y; A(numprofile1).y];
    99                                                 numprofiles=numprofiles-1;
    100                                                 closed(numprofile1)=1;
     132                        %plot new profile
     133                        undoplots(prevplot);
     134                        for i=1:numprofiles
     135                                plot(A(i).x,A(i).y,'-r','MarkerSize',10);
     136                        end
     137                        if ~isempty(tips)
     138                                plot(tips(:,1),tips(:,2),'rs','Markersize',10);
     139                        end
    101140
    102                                         elseif tips(tip1,4)==2 & newtips(tip2,4)==1,
    103                                                 A(numprofile1).x=[A(numprofile1).x; A(numprofile2).x];
    104                                                 A(numprofile1).y=[A(numprofile1).y; A(numprofile2).y];
    105                                                 numprofiles=numprofiles-1;
    106                                                 closed(numprofile1)=1;
    107 
    108                                         elseif tips(tip1,4)==2 & newtips(tip2,4)==2,
    109                                                 A(numprofile1).x=[A(numprofile1).x; flipud(A(numprofile2).x)];
    110                                                 A(numprofile1).y=[A(numprofile1).y; flipud(A(numprofile2).y)];
    111                                                 numprofiles=numprofiles-1;
    112                                                 closed(numprofile1)=1;
    113                                         end
    114 
    115                                         %delete profile2
    116                                         A(numprofile2)=[];
    117                                         closed(numprofile2)=[];
    118 
    119                                 end
    120 
    121                                 %update tips
    122                                 tips=newtips;
    123                                 tips(tip2,:)=[];
    124                                 tips(find(tips(:,3)==numprofile2),3)=numprofile1;
    125 
    126                                 %plot new profile
    127                                 undoplots(prevplot);
    128                                 for i=1:numprofiles
    129                                         plot(A(i).x,A(i).y,'-r','MarkerSize',10);
    130                                 end
    131                                 plot(tips(:,1),tips(:,2),'rs','Markersize',10);
    132 
    133                                 %back to beginning
    134                                 firsttip=1;
    135                         end
    136                 else
    137                         %RETRUN-> quit
    138                         loop=0;
     141                        %back to beginning
     142                        firsttip=1;
    139143                end
     144        else
     145                %RETRUN-> quit
     146                loop=0;
    140147        end
    141148end
  • issm/trunk/src/m/utils/Exp/manipulation/modifyposition.m

    r1 r33  
    1010        %some checks
    1111        if numprofiles==0
    12                 disp('no profile present')
     12                disp('no profile present, exiting..')
    1313                return
    1414        end
  • issm/trunk/src/m/utils/Exp/manipulation/removepoints.m

    r1 r33  
    1010        %some checks
    1111        if numprofiles==0
    12                 disp('no profile present')
     12                disp('no profile present, exiting...')
    1313                return
    1414        end
  • issm/trunk/src/m/utils/Exp/manipulation/removeprofile.m

    r1 r33  
    1818                %some checks
    1919                if numprofiles==0
    20                         disp('no profile to be removed')
     20                        disp('no profile to be removed, exiting...')
    2121                        return
    2222                end
  • issm/trunk/src/m/utils/Exp/manipulation/removeseveralpoints.m

    r1 r33  
    1010        %some checks
    1111        if numprofiles==0
    12                 disp('no profile present')
     12                disp('no profile present, exiting...')
    1313                return
    1414        end       
    1515        if numpoints<3
    16                 disp('at least two points are needed')
     16                disp('at least 3 points are required, exiting...')
    1717                return
    1818        end       
     
    2929        %loop (at least 3 clicks needed)
    3030        while loop
     31
     32                %some checks
     33                if numpoints<3
     34                        disp('at least 3 points are required, exiting...')
     35                        return
     36                end
    3137
    3238                %select a point
     
    5460                                        text(A(selection).x(indsel),A(selection).y(indsel),num2str(1),'FontSize',14,'background',[0.7 0.7 0.9]);
    5561                                end
     62                                %disp(['p1= ' num2str(indsel)]),
    5663                        else
    5764                                %get the 2d or 3d point for the given contou
     
    6471                                                points(end+1)=indsel;
    6572                                                text(A(selection).x(indsel),A(selection).y(indsel),num2str(2),'FontSize',14,'background',[0.7 0.7 0.9]);
     73                                                %disp(['p2= ' num2str(indsel)]),
    6674                                        %third click?
    6775                                        else
    6876                                                p1=points(1); p2=points(2); p3=indsel;
     77                                                %disp(['p3= ' num2str(indsel)]),
    6978                                                if p1<p2
    7079                                                        if p3>p1 & p3<p2
     
    7281                                                                A(selection).y(p1+1:p2-1)=[];
    7382                                                                numpoints=numpoints-(p2-p1-1);
    74                                                                 loop=0;
    7583                                                        else
    7684                                                                A(selection).x=A(selection).x(p1:p2);
     
    8391                                                                        numpoints=numpoints+1;
    8492                                                                end
    85                                                                 loop=0;
    8693                                                        end
    8794                                                else
     
    9097                                                                A(selection).y(p2+1:p1-1)=[];
    9198                                                                numpoints=numpoints-(p1-p2-1);
    92                                                                 loop=0;
    93 
    9499                                                        else
    95100                                                                A(selection).x=A(selection).x(p2:p1);
     
    102107                                                                        numpoints=numpoints+1;
    103108                                                                end
    104                                                                 loop=0;
    105109                                                        end
    106110                                                end
     111
     112                                                %plot new profiles
     113                                                undoplots(prevplot);
     114                                                for i=1:numprofiles
     115                                                        plot(A(i).x,A(i).y,'-rs','MarkerSize',10);
     116                                                end
     117                                                points=[];
     118
    107119                                        end
    108120                                end
  • issm/trunk/src/m/utils/Nightly/nightlyrun.m

    r1 r33  
    55
    66%Go to Test directory
    7 eval(['cd ' ISSM_DIR '/tests/']);
     7eval(['cd ' ISSM_DIR '/test/']);
    88
    99%Run all verification tests
  • issm/trunk/src/m/utils/UpdateArchive/updatearchive.m

    r1 r33  
    66
    77%Go to Test directory
    8 eval(['cd ' ISSM_DIR '/Tests/']);
     8eval(['cd ' ISSM_DIR '/test/']);
    99
    1010%Run all verification tests
Note: See TracChangeset for help on using the changeset viewer.