Changeset 1857 in Sophya
- Timestamp:
- Jan 14, 2002, 2:42:24 PM (24 years ago)
- Location:
- trunk/SophyaPI/PIGcont
- Files:
-
- 2 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIGcont/Makefile
r1844 r1857 4 4 5 5 all: $(LIB)libPIGcont.a 6 $(LIB)libPIGcont.a : $(OBJ)gp_alloc.o $(OBJ)gp_axis.o $(OBJ)gp_contour.o $(OBJ)gpc_set.o$(OBJ)picntools.o $(OBJ)pigncont.o6 $(LIB)libPIGcont.a : $(OBJ)gp_alloc.o $(OBJ)gp_axis.o $(OBJ)gp_contour.o $(OBJ)picntools.o $(OBJ)pigncont.o 7 7 $(AR) $(ARFLAGS) $@ $($(ARARGS)) 8 8 ifeq ($(CXX),cxx) … … 11 11 12 12 clean: 13 rm -f $(OBJ)gp_alloc.o $(OBJ)gp_axis.o $(OBJ)gp_contour.o $(OBJ) gpc_set.o $(OBJ)picntools.o $(OBJ)pigncont.o13 rm -f $(OBJ)gp_alloc.o $(OBJ)gp_axis.o $(OBJ)gp_contour.o $(OBJ)picntools.o $(OBJ)pigncont.o 14 14 ifeq ($(CXX),cxx) 15 15 cd $(REPM); rm -f *.o … … 20 20 $(OBJ)gp_contour.o: gp_contour.c gp_contour.h gp_types.h gpc_misc.h \ 21 21 gp_dynarray.h gp_graph3d.h gp_alloc.h gp_axis.h 22 $(OBJ)gpc_set.o: gpc_set.c gpc_set.h gp_contour.h gp_types.h gpc_misc.h \23 gp_dynarray.h gp_graph3d.h24 22 $(OBJ)picntools.o: picntools.cc $(INC)machdefs.h \ 25 23 picntools.h $(INC)pisysdep.h \ … … 88 86 $(INC)ntuple.h \ 89 87 $(INC)ntupintf.h gp_contour.h gp_types.h \ 90 gpc_misc.h gp_dynarray.h gp_graph3d.h gp_alloc.h gpc_set.h88 gpc_misc.h gp_dynarray.h gp_graph3d.h gp_alloc.h 91 89 $(OBJ)pigncont.o: pigncont.cc $(INC)machdefs.h \ 92 90 $(INC)histos.h \ … … 167 165 $(INC)periodic.h \ 168 166 $(INC)piscdrawwdg.h gp_contour.h gp_types.h \ 169 gpc_misc.h gp_dynarray.h gp_graph3d.h gp_alloc.h gpc_set.h167 gpc_misc.h gp_dynarray.h gp_graph3d.h gp_alloc.h -
trunk/SophyaPI/PIGcont/gp_alloc.c
r1844 r1857 55 55 56 56 void contour_free(struct gnuplot_contours *ptr){ 57 char *c;57 //char *c; 58 58 struct coordinate *coords; 59 59 struct gnuplot_contours *old; … … 61 61 62 62 cur = ptr; 63 //printf("\n contour_free %x \n",cur); 63 64 while(cur){ 65 /*printf(" contour_free %x \n",cur);*/ 64 66 old = cur; 65 cur = cur->next; 66 c=old->label; 67 coords = old->coords; 68 if(c){free(c); c=NULL;} 67 cur = cur->next; 68 coords = old->coords; 69 69 if(coords){free(coords) ; coords = NULL;} 70 70 free(old); 71 } 71 old=NULL; 72 } 73 72 74 73 75 } -
trunk/SophyaPI/PIGcont/gp_contour.c
r1844 r1857 41 41 * Hans-Martin Keller, 1995,1997 (hkeller@gwdg.de) 42 42 * 43 * Quelques modifs (adaptation pour SOPHYA/PEIDA) O. PErdereau 11/2001 43 44 */ 44 45 … … 47 48 #include "gp_alloc.h" 48 49 #include "gp_axis.h" 50 51 #include <sys/time.h> 52 #include <sys/resource.h> 53 49 54 /* #include "setshow.h" */ 50 55 … … 52 57 53 58 char contour_format[32] = "%8.3g"; /* format for contour key entries */ 54 t_contour_kind contour_kind = CONTOUR_KIND_LINEAR;55 t_contour_levels_kind contour_levels_kind = LEVELS_AUTO;56 int contour_levels = DEFAULT_CONTOUR_LEVELS;57 int contour_order = DEFAULT_CONTOUR_ORDER;58 int contour_pts = DEFAULT_NUM_APPROX_PTS;59 static t_contour_kind contour_kind = CONTOUR_KIND_LINEAR; 60 static t_contour_levels_kind contour_levels_kind = LEVELS_AUTO; 61 static int contour_levels = DEFAULT_CONTOUR_LEVELS; 62 static int contour_order = DEFAULT_CONTOUR_ORDER; 63 static int contour_pts = DEFAULT_NUM_APPROX_PTS; 59 64 60 65 dynarray dyn_contour_levels_list;/* storage for z levels to draw contours at */ … … 70 75 71 76 /* Valeur de zero - Reza 21/12/2001 - Pourquoi zero = 0. ??? */ 72 staticdouble zero = 0.;77 double zero = 0.; 73 78 74 79 /* FIXME HBB 2000052: yet another local copy of 'epsilon'. Why? */ … … 206 211 struct iso_curve *iso_lines; 207 212 { 213 struct rusage r_usage; 214 int rcus; 215 208 216 int i; 209 217 /*OP int num_of_z_levels;*/ /* # Z contour levels. */ … … 217 225 218 226 contour_list = NULL; 219 227 /******* DEBUG ******** 228 rcus = getrusage( RUSAGE_SELF , &r_usage); 229 if(rcus==0) 230 printf("contour[1] / rusage -> %ld , %ld , %ld \n", r_usage.ru_maxrss , r_usage.ru_ixrss , r_usage.ru_ixrss); 231 else 232 perror("contour/1er appel"); 233 *************/ 220 234 /* 221 235 * Calculate min/max values : … … 224 238 &x_min, &y_min, &z_min, &x_max, &y_max, &z_max); 225 239 240 226 241 dz = fabs(z_max - z_min); 227 242 /* … … 232 247 gen_triangle(num_isolines, iso_lines, &p_polys, &p_edges); 233 248 crnt_cntr_pt_index = 0; 249 250 234 251 /*AJOUT OP */ 235 252 if (contour_levels_kind == LEVELS_NUM) { … … 279 296 /* Free all contouring related temporary data. */ 280 297 while (p_polys) { 298 281 299 p_poly = p_polys->next; 282 300 free(p_polys); 283 301 p_polys = p_poly; 284 302 } 285 while (p_edges) { 303 304 305 while (p_edges) { 286 306 p_edge = p_edges->next; 287 307 free(p_edges); 288 308 p_edges = p_edge; 289 309 } 310 /*********DEBUG 311 rcus = getrusage( RUSAGE_SELF , &r_usage); 312 if(rcus==0) 313 printf("contour[5] / rusage -> %ld , %ld , %ld \n", r_usage.ru_maxrss , r_usage.ru_ixrss , r_usage.ru_ixrss); 314 else 315 perror("contour / 5eme appel"); 316 rcus = getrusage( RUSAGE_SELF , &r_usage); 317 ********/ 290 318 291 319 return contour_list; … … 1534 1562 } 1535 1563 } 1564 1565 1566 /* setting et getting de variables */ 1567 /* OP 01/2002 */ 1568 1569 void set_contour_kind(t_contour_kind in){ 1570 contour_kind = in; 1571 } 1572 1573 t_contour_kind get_contour_kind(){ 1574 return (contour_kind); 1575 } 1576 1577 void set_contour_levels_kind(t_contour_levels_kind in){ 1578 contour_levels_kind = in; 1579 1580 } 1581 1582 t_contour_levels_kind get_contour_levels_kind(){ 1583 1584 return(contour_levels_kind); 1585 } 1586 1587 void set_contour_levels(int num){ 1588 contour_levels = num; 1589 } 1590 1591 int get_contour_levels(){ 1592 return(contour_levels); 1593 } 1594 void set_contour_levels_list(double *vec){ 1595 1596 contour_levels_list=vec; 1597 } 1598 1599 /******* 1600 void set_contour_levels_list(double *vec,int sz){ 1601 int i; 1602 printf(" <set_contour_levels_list> sz %d \n",sz); 1603 contour_levels_list = (double *) malloc(sz*sizeof(double)); 1604 for (i=0 ; i<sz ; i++){ 1605 printf(" <set_contour_levels_list> i %d vec %g\n",i,vec[i]); 1606 contour_levels_list[i] = vec[i]; 1607 1608 } 1609 } 1610 void free_contour_levels_list(){ 1611 if(contour_levels_list != NULL){ 1612 free(contour_levels_list); 1613 contour_levels_list = NULL; 1614 } 1615 } 1616 *****/ 1617 double * get_contour_levels_list(){ 1618 1619 return(contour_levels_list); 1620 } 1621 -
trunk/SophyaPI/PIGcont/gp_contour.h
r1844 r1857 77 77 78 78 extern char contour_format[]; 79 extern t_contour_kind contour_kind; 80 extern t_contour_levels_kind contour_levels_kind; 81 extern int contour_levels; 82 extern int contour_order; 83 extern int contour_pts; 79 /***********************************************/ 80 /* VARIABLES MAINTENANT STATIQUES - OP 01/2002 */ 81 /*extern t_contour_kind contour_kind;*/ 82 /*extern t_contour_levels_kind contour_levels_kind;*/ 83 /*extern int contour_levels;*/ 84 /*extern int contour_order;*/ 85 /*extern int contour_pts;*/ 86 /***********************************************/ 84 87 85 88 /* storage for z levels to draw contours at */ … … 94 97 int Get_Num_Of_Z_Levels(); 95 98 99 /* seting de variables OP 01/2002 */ 100 101 void set_contour_kind(t_contour_kind); 102 t_contour_kind get_contour_kind(); 103 104 void set_contour_levels_kind(t_contour_levels_kind); 105 t_contour_levels_kind get_contour_levels_kind(); 106 107 void set_contour_levels(int); 108 int get_contour_levels(); 109 void set_contour_levels_list(double *); 110 double * get_contour_levels_list(); 111 112 113 96 114 #endif /* GNUPLOT_CONTOUR_H */ -
trunk/SophyaPI/PIGcont/objlist.list
r1844 r1857 2 2 gp_axis.o 3 3 gp_contour.o 4 gpc_set.o5 4 picntools.o 6 5 pigncont.o -
trunk/SophyaPI/PIGcont/picntools.cc
r1838 r1857 14 14 //++ 15 15 // Class PICnTools 16 // Lib PI 17 // include pid rwtools.h16 // Lib PIGcont 17 // include pidcntools.h 18 18 // 19 19 // Classe de fenêtre de dialogue permettant de modifier interactivement 20 // Les attributs graphique des "Drawer" attachés aux "PIBaseWdg". 20 // les attributs graphique des "PIContourDrawer" ainsi que 21 // les parametres de calcul des contours. 21 22 //-- 22 23 // Links Parents … … 27 28 // PIDrawer 28 29 // PIBaseWdg 30 // PIContourDrawer 29 31 //-- 30 32 //++ … … 41 43 // void ShowPICnTools() 42 44 // Méthode statique permettant l'affichage de la fenêtre de contrôle des 43 // attributs graphiques des " Drawer". L'instance de la classe44 // "PICnTools" est créée si nécessaire.45 // attributs graphiques des "PIContourDrawer". L'instance de la classe 46 // "PICnTools" est créée si nécessaire. Un seul "PIContourDrawer" est gere. 45 47 // void HidePICnTools() 46 // Désac ative (cache) la fenêtre "PICnTools" (méthode statique).48 // Désactive (cache) la fenêtre "PICnTools" (méthode statique). 47 49 // void SetCurrentBaseWdg(PIBaseWdgGen* cbw) 48 // Méthode statique permettant de s électionner le"PIBaseWdg" courant.50 // Méthode statique permettant de s'attacher au "PIBaseWdg" courant. 49 51 // PIBaseWdgGen* GetCurrentBaseWdg() 50 52 // Retourne le "PIBaseWdg" courant (méthode statique). 53 // void SetCurrentCnDrw( PIContourDrawer* pcd) 54 // Méthode statique permettant de s'attacher au "PIContourDrawer". 55 // PIBaseWdgGen* :GetCurrentCnDrw() 56 // Retourne le "PIContourDrawer" (méthode statique). 51 57 //-- 52 58 … … 375 381 cpx += bsx*1.2+spx; 376 382 377 /******378 mButcf[3] = new PIButton(this, "Calc", 3200, bsx*0.8, bsyo, cpx, cpy);379 mButcf[3]->ActivatePress(true);380 mButcf[3]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);381 *****/382 383 cpx += bsx*0.8+spx; 383 384 … … 453 454 return; 454 455 } 455 456 // Liste des differentes options de calcul 456 457 static t_contour_kind crbe_algo[3]={CONTOUR_KIND_LINEAR,CONTOUR_KIND_CUBIC_SPL,CONTOUR_KIND_BSPLINE}; 457 458 static t_contour_levels_kind lev_kind[4]={LEVELS_AUTO,LEVELS_NUM,LEVELS_INCREMENTAL,LEVELS_DISCRETE}; -
trunk/SophyaPI/PIGcont/pigncont.cc
r1853 r1857 12 12 #include "picntools.h" 13 13 #include "pigncont.h" 14 15 #include <sys/time.h> 16 #include <sys/resource.h> 14 17 15 18 /* A virer ?? Reza 21/12/2001 … … 369 372 370 373 struct gnuplot_contours *cntcur = _contours; 374 /***** 371 375 struct gnuplot_contours *cntold; 372 376 373 while(cntcur) { 377 while(cntcur) { 374 378 //cout << " ~GNUPlotContour() : destruction de _contours" << _contours <<endl; 375 cntold = cntcur; 376 cntcur = cntold->next; 377 gp_free(cntold); 378 cntold=NULL; 379 } 380 379 cntold = cntcur; 380 cntcur = cntold->next; 381 gp_free(cntold); 382 cntold=NULL; 383 } 384 *******/ 385 contour_free(cntcur); 381 386 _contours = NULL; 382 387 … … 390 395 391 396 void GNUPlotContour::CalcContour(){ 392 cout << " GNUPlotContour::CalcContour(): determination des contours "<<endl; 397 //cout << " GNUPlotContour::CalcContour(): determination des contours "<<endl; 398 399 struct rusage r_usage; 400 int rcus; 393 401 394 402 set_contour_kind(Contour_kind); … … 416 424 } 417 425 426 427 rcus = getrusage( RUSAGE_SELF , &r_usage); 428 429 //if(rcus==0) 430 // cout << " rusage -> "<< r_usage.ru_maxrss <<" , "<< r_usage.ru_ixrss <<" , "<< r_usage.ru_ixrss <<endl; 431 //else 432 // perror("1er appel"); 433 418 434 if(_contours) { 419 //cout << " GNUPlotContour::CalcContour(): destruction des contours "<<endl;435 cout << " GNUPlotContour::CalcContour(): destruction des contours "<<_contours<<endl; 420 436 struct gnuplot_contours *cntcur = _contours; 421 struct gnuplot_contours *cntold; 422 while(cntcur) { 423 cntold = cntcur; 424 cntcur = cntold->next; 425 gp_free(cntold); 426 } 437 /****** 438 struct gnuplot_contours *cntold; 439 while(cntcur) { 440 cout << " GNUPlotContour::CalcContour(): destruction des contours "<< cntcur<<endl; 441 cntold = cntcur; 442 cntcur = cntold->next; 443 gp_free(cntold); 444 cntold = NULL; 445 } 446 ******/ 447 contour_free(cntcur); 427 448 _contours = NULL; 428 449 429 450 } 430 451 431 432 433 //struct gnuplot_contours *cntcur; 452 //struct gnuplot_contours *cntcur; 434 453 //struct gnuplot_contours *cntold; 435 454 455 456 //rcus = getrusage( RUSAGE_SELF , &r_usage); 457 //if(rcus==0) 458 // cout << " rusage -> "<< r_usage.ru_maxrss <<" , "<< r_usage.ru_ixrss <<" , "<< r_usage.ru_ixrss <<endl; 459 //else 460 // perror("2d appel"); 461 462 436 463 _contours = contour (_nx,iso1); 464 465 466 //rcus = getrusage( RUSAGE_SELF , &r_usage); 467 //if(rcus==0) 468 // cout << " rusage -> "<< r_usage.ru_maxrss <<" , "<< r_usage.ru_ixrss <<" , "<< r_usage.ru_ixrss <<endl; 469 //else 470 // perror("3ieme appel"); 471 437 472 //free_contour_levels_list(); 438 473 439 474 440 475 } -
trunk/SophyaPI/PIGcont/pigncont.h
r1844 r1857 15 15 #include "gp_contour.h" 16 16 #include "gp_alloc.h" 17 #include "gpc_set.h"17 //#include "gpc_set.h" 18 18 } 19 19
Note:
See TracChangeset
for help on using the changeset viewer.