From: Curt M. <we...@us...> - 2006-08-14 12:12:59
|
Update of /cvsroot/xastir/xastir/src In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25931 Modified Files: map_gdal.c map_shp.c maps.c maps.h Log Message: Removing error-text parameter from map_visible_lat_lon() as we're not using it. Changed the order of checks in map_visible_lat_lon() to perhaps speed things up slightly based on which lines get his most often (gprof). Changed skip parameter for HandlePendingEvents in map_shp.c from 50 to 64, which is a power of 2 (perhaps faster?) and roughly the switchover point (via gprof) for lower CPU. Index: map_gdal.c =================================================================== RCS file: /cvsroot/xastir/xastir/src/map_gdal.c,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** map_gdal.c 11 Aug 2006 23:58:47 -0000 1.150 --- map_gdal.c 14 Aug 2006 12:12:50 -0000 1.151 *************** *** 1378,1385 **** if (map_visible_lat_lon( envelopeH.MinY, // bottom ! envelopeH.MaxY, // top ! envelopeH.MinX, // left ! envelopeH.MaxX, // right ! NULL)) { //fprintf(stderr, "Fast Extents: Line is visible\n"); } --- 1378,1384 ---- if (map_visible_lat_lon( envelopeH.MinY, // bottom ! envelopeH.MaxY, // top ! envelopeH.MinX, // left ! envelopeH.MaxX) ) { // right //fprintf(stderr, "Fast Extents: Line is visible\n"); } *************** *** 1481,1486 **** MaxY, // top MinX, // left ! MaxX, // right ! NULL)) { //fprintf(stderr, "Line is visible\n"); } --- 1480,1484 ---- MaxY, // top MinX, // left ! MaxX) ) { // right //fprintf(stderr, "Line is visible\n"); } *************** *** 1958,1963 **** envelopeH.MaxY, // top envelopeH.MinX, // left ! envelopeH.MaxX, // right ! NULL)) { //fprintf(stderr, "Fast Extents: Polygon is visible\n"); } --- 1956,1960 ---- envelopeH.MaxY, // top envelopeH.MinX, // left ! envelopeH.MaxX) ) { // right //fprintf(stderr, "Fast Extents: Polygon is visible\n"); } *************** *** 2039,2044 **** MaxY, // top MinX, // left ! MaxX, // right ! NULL)) { //fprintf(stderr, "Polygon is visible\n"); } --- 2036,2040 ---- MaxY, // top MinX, // left ! MaxX) ) { // right //fprintf(stderr, "Polygon is visible\n"); } Index: map_shp.c =================================================================== RCS file: /cvsroot/xastir/xastir/src/map_shp.c,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** map_shp.c 11 Aug 2006 23:58:47 -0000 1.119 --- map_shp.c 14 Aug 2006 12:12:50 -0000 1.120 *************** *** 675,679 **** char file[MAX_FILENAME]; /* Complete path/name of image file */ char short_filenm[MAX_FILENAME]; - // char warning_text[MAX_FILENAME*2]; int i, fieldcount, recordcount, structure, ring; #ifndef WITH_DBFAWK --- 675,678 ---- *************** *** 1596,1602 **** adfBndsMax[1], // Top adfBndsMin[0], // Left ! adfBndsMax[0], // Right ! NULL) ) { ! // file) ) { // Error text if failure if (debug_level & 16) fprintf(stderr,"No shapes within viewport. Skipping file...\n"); --- 1595,1599 ---- adfBndsMax[1], // Top adfBndsMin[0], // Left ! adfBndsMax[0]) ) { // Right if (debug_level & 16) fprintf(stderr,"No shapes within viewport. Skipping file...\n"); *************** *** 1826,1833 **** ! // Call HandlePendingEvents() every 20 objects or so so that ! // we can interrupt map drawing if necessary. // ! if (structure % 50 == 0) { HandlePendingEvents(app_context); if (interrupt_drawing_now) { --- 1823,1836 ---- ! // Call HandlePendingEvents() every XX objects so that we ! // can interrupt map drawing if necessary. Keep this at a ! // power of two for speed. Bigger numbers speed up map ! // drawing at the expense of being able to interrupt map ! // drawing quickly. HandlePendingEvents() drops to about ! // 0.5% CPU at 64 (according to gprof). That appears to be ! // the break-even point where CPU is minimal. // ! if (structure % 64 == 0) { ! HandlePendingEvents(app_context); if (interrupt_drawing_now) { *************** *** 1894,1915 **** // fprintf(stderr,"Calling map_visible_lat_lon on a shape\n"); - /* - // Set up some warning text just in case the map has a - // problem. - xastir_snprintf(warning_text, - sizeof(warning_text), - "File:%s, Structure:%d", - file, - structure); - */ - - //fprintf(stderr,"%s\n",warning_text); - if ( map_visible_lat_lon( object->dfYMin, // Bottom object->dfYMax, // Top object->dfXMin, // Left ! object->dfXMax, // Right ! NULL) ) { ! // warning_text) ) { // Error text if failure const char *temp; --- 1897,1904 ---- // fprintf(stderr,"Calling map_visible_lat_lon on a shape\n"); if ( map_visible_lat_lon( object->dfYMin, // Bottom object->dfYMax, // Top object->dfXMin, // Left ! object->dfXMax) ) { // Right const char *temp; Index: maps.c =================================================================== RCS file: /cvsroot/xastir/xastir/src/maps.c,v retrieving revision 1.495 retrieving revision 1.496 diff -C2 -d -r1.495 -r1.496 *** maps.c 11 Aug 2006 23:58:47 -0000 1.495 --- maps.c 14 Aug 2006 12:12:50 -0000 1.496 *************** *** 3429,3438 **** // ///////////////////////////////////////////////////////////////////// ! int map_visible_lat_lon (double map_min_y, // f_bottom_map_boundary ! double map_max_y, // f_top_map_boundary ! double map_min_x, // f_left_map_boundary ! double map_max_x, // f_right_map_boundary ! char *error_message) { ! //fprintf(stderr,"map_visible_lat_lon\n"); --- 3429,3436 ---- // ///////////////////////////////////////////////////////////////////// ! int map_visible_lat_lon (double map_min_y, // f_bottom_map_boundary ! double map_max_y, // f_top_map_boundary ! double map_min_x, // f_left_map_boundary ! double map_max_x) { // f_right_map_boundary //fprintf(stderr,"map_visible_lat_lon\n"); *************** *** 3447,3455 **** // The quick rejection algorithm: // ! if (f_SE_corner_latitude > map_max_y) return(0); // map below view ! if (map_min_y > f_NW_corner_latitude) return(0); // view below map ! ! if (f_NW_corner_longitude > map_max_x) return(0); // map left of view ! if (map_min_x > f_SE_corner_longitude) return(0); // view left of map return (1); // Draw this map onto the screen --- 3445,3452 ---- // The quick rejection algorithm: // ! if (map_max_y < f_SE_corner_latitude ) return(0); // map below view ! if (map_min_x > f_SE_corner_longitude) return(0); // view left of map ! if (map_min_y > f_NW_corner_latitude ) return(0); // view below map ! if (map_min_x > f_SE_corner_longitude) return(0); // view left of map return (1); // Draw this map onto the screen *************** *** 7791,7797 **** temp->top_boundary, temp->left_boundary, ! temp->right_boundary, ! NULL) ) { ! // temp->title) ) { // Error text if failure if (temp->alert_level != 'C') { // Alert not cancelled --- 7788,7792 ---- temp->top_boundary, temp->left_boundary, ! temp->right_boundary) ) { if (temp->alert_level != 'C') { // Alert not cancelled *************** *** 8335,8338 **** --- 8330,8335 ---- // 302->256->264->269->115->116 seconds. // + // 100 times on PP200 takes 192->183 seconds. + // //start_timer(); //fprintf(stderr,"Calling draw_map() 500 times...\n"); Index: maps.h =================================================================== RCS file: /cvsroot/xastir/xastir/src/maps.h,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** maps.h 11 Aug 2006 23:58:47 -0000 1.62 --- maps.h 14 Aug 2006 12:12:51 -0000 1.63 *************** *** 162,167 **** double f_top_map_boundary, double f_left_map_boundary, ! double f_right_map_boundary, ! char *error_message); extern int map_inside_viewport_lat_lon(double map_min_y, double map_max_y, --- 162,166 ---- double f_top_map_boundary, double f_left_map_boundary, ! double f_right_map_boundary); extern int map_inside_viewport_lat_lon(double map_min_y, double map_max_y, |