Преглед на файлове

dglib cache enabled again

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@36113 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz преди 16 години
родител
ревизия
79e1d42513
променени са 1 файла, в които са добавени 12 реда и са изтрити 7 реда
  1. 12 7
      lib/vector/Vlib/net.c

+ 12 - 7
lib/vector/Vlib/net.c

@@ -432,9 +432,8 @@ Vect_net_build_graph(struct Map_info *Map,
 	G_fatal_error(_("GngFlatten error"));
 	G_fatal_error(_("GngFlatten error"));
 
 
     /* init SP cache */
     /* init SP cache */
-    /* Disabled because of BUG1 in dglib. Without cache it is terribly slow, but with cache there
-     *  are too many errors. */
-    /* dglInitializeSPCache( gr, &(Map->spCache) ); */
+    /* disable to debug dglib cache */
+    dglInitializeSPCache(gr, &(Map->spCache));
 
 
     G_message(_("Graph was built"));
     G_message(_("Graph was built"));
 
 
@@ -487,16 +486,22 @@ Vect_net_shortest_path(struct Map_info *Map, int from, int to,
 
 
     pclip = NULL;
     pclip = NULL;
     if (List != NULL) {
     if (List != NULL) {
-	/*nRet = dglShortestPath ( &(Map->graph), &pSPReport, from, to, clipper, pclip, &(Map->spCache)); */
 	nRet =
 	nRet =
 	    dglShortestPath(&(Map->graph), &pSPReport, (dglInt32_t) from,
 	    dglShortestPath(&(Map->graph), &pSPReport, (dglInt32_t) from,
-			    (dglInt32_t) to, clipper, pclip, NULL);
+			    (dglInt32_t) to, clipper, pclip, &(Map->spCache));
+	/* comment out above and uncomment below to debug dglib cache */
+	/* nRet =
+	    dglShortestPath(&(Map->graph), &pSPReport, (dglInt32_t) from,
+			    (dglInt32_t) to, clipper, pclip, NULL); */
     }
     }
     else {
     else {
-	/*nRet = dglShortestDistance ( &(Map->graph), &nDistance, from, to, clipper, pclip, &(Map->spCache)); */
 	nRet =
 	nRet =
 	    dglShortestDistance(&(Map->graph), &nDistance, (dglInt32_t) from,
 	    dglShortestDistance(&(Map->graph), &nDistance, (dglInt32_t) from,
-				(dglInt32_t) to, clipper, pclip, NULL);
+				(dglInt32_t) to, clipper, pclip, &(Map->spCache));
+	/* comment out above and uncomment below to debug dglib cache */
+	/* nRet =
+	    dglShortestDistance(&(Map->graph), &nDistance, (dglInt32_t) from,
+				(dglInt32_t) to, clipper, pclip, NULL); */
     }
     }
 
 
     if (nRet == 0) {
     if (nRet == 0) {