Changeset 14345
- Timestamp:
- 02/13/13 10:17:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/wrappers/ExpSimplify/ExpSimplify.cpp
r14344 r14345 14 14 _pprintLine_(" - tol: tolerance (maximal euclidean distance allowed between the new line and a vertex)"); 15 15 _pprintLine_(" Additional options:"); 16 _pprintLine_(" - 'remove1': remove singleton from exp file (default is true)"); 17 _pprintLine_(" - 'remove2': remove pairs from exp file (default is true)"); 16 _pprintLine_(" - 'min': minimum number of vertices to save contours in exp file (default is 3)"); 18 17 _pprintLine_(""); 19 18 _pprintLine_(" Example:"); … … 97 96 char* expfile = NULL; 98 97 double tolerance; 99 bool remove1,remove2,save;100 98 Options *options = NULL; 99 int minimumvertices; 101 100 102 101 /*output*/ … … 131 130 132 131 /*Process options*/ 133 options->Get(& remove1,"remove1",true);134 options->Get(&remove2,"remove2",true);132 options->Get(&minimumvertices,"min",3); 133 if(minimumvertices<1) _error_("'min' (minimum number of verties) should be a positive integer"); 135 134 136 135 /*Read old contours and allocate new contours*/ … … 181 180 182 181 /*Do we save new profile?*/ 183 save = true; 184 if(newnods==0){ 185 save = false; 186 } 187 else if(remove1 && newnods==1){ 188 save = false; 189 } 190 else if(remove2 && newnods==2){ 191 save = false; 192 } 193 if(save){ 194 printf(" New number of vertices in contour #%i: %i\n",counter+1,newnods); 182 if(newnods>=minimumvertices){ 183 printf(" Final number of vertices in contour #%i: %i\n",counter+1,newnods); 195 184 newcontour = xNew<Contour<double> >(1); 196 185 newcontour->nods = newnods; … … 211 200 } 212 201 else{ 213 printf(" Newnumber of vertices in contour #%i: %i (not saved)\n",counter+1,newnods);202 printf(" Final number of vertices in contour #%i: %i (not saved)\n",counter+1,newnods); 214 203 } 215 204 … … 217 206 xDelete<bool>(flags); 218 207 } 208 printf(" Initial number of contours: %i\n",oldcontours->Size()); 209 printf(" Final number of contours: %i\n",newcontours->Size()); 219 210 220 211 /*Write data: */
Note:
See TracChangeset
for help on using the changeset viewer.