[GRASS-SVN] r43861 - grass/branches/develbranch_6/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 11 09:21:53 EDT 2010


Author: mmetz
Date: 2010-10-11 06:21:53 -0700 (Mon, 11 Oct 2010)
New Revision: 43861

Modified:
   grass/branches/develbranch_6/lib/vector/Vlib/net.c
Log:
easier dglib cache debugging (backport from trunk r43859)

Modified: grass/branches/develbranch_6/lib/vector/Vlib/net.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/Vlib/net.c	2010-10-11 13:21:10 UTC (rev 43860)
+++ grass/branches/develbranch_6/lib/vector/Vlib/net.c	2010-10-11 13:21:53 UTC (rev 43861)
@@ -466,6 +466,7 @@
     int i, line, *pclip, cArc, nRet;
     dglSPReport_s *pSPReport;
     dglInt32_t nDistance;
+    int use_cache = 1;		/* set to 0 to disable dglib cache */
 
     G_debug(3, "Vect_net_shortest_path(): from = %d, to = %d", from, to);
 
@@ -486,22 +487,28 @@
 
     pclip = NULL;
     if (List != NULL) {
-	nRet =
-	    dglShortestPath(&(Map->graph), &pSPReport, (dglInt32_t) from,
-			    (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); */
+	if (use_cache) {
+	    nRet =
+		dglShortestPath(&(Map->graph), &pSPReport, (dglInt32_t) from,
+				(dglInt32_t) to, clipper, pclip, &(Map->spCache));
+	}
+	else {
+	    nRet =
+		dglShortestPath(&(Map->graph), &pSPReport, (dglInt32_t) from,
+				(dglInt32_t) to, clipper, pclip, NULL);
+	}
     }
     else {
-	nRet =
-	    dglShortestDistance(&(Map->graph), &nDistance, (dglInt32_t) from,
-				(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 (use_cache) {
+	    nRet =
+		dglShortestDistance(&(Map->graph), &nDistance, (dglInt32_t) from,
+				    (dglInt32_t) to, clipper, pclip, &(Map->spCache));
+	}
+	else {
+	    nRet =
+		dglShortestDistance(&(Map->graph), &nDistance, (dglInt32_t) from,
+				    (dglInt32_t) to, clipper, pclip, NULL);
+	}
     }
 
     if (nRet == 0) {



More information about the grass-commit mailing list